/* ========================================
   DeviceHeed - Main Stylesheet
   ======================================== */

/* === CSS Variables === */
:root {
    /* Colors */
    --primary-color: #0066CC;
    --primary-dark: #004D99;
    --primary-light: #3385D6;
    --secondary-color: #2C3E50;
    --accent-color: #00CC88;
    --text-dark: #1A1A1A;
    --text-medium: #4A4A4A;
    --text-light: #7A7A7A;
    --bg-white: #FFFFFF;
    --bg-light: #F8F9FA;
    --bg-section: #F5F7FA;
    --border-color: #E0E0E0;
    --error-color: #DC3545;
    --success-color: #28A745;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 3rem;
    --spacing-xl: 4rem;

    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-heading: 'Poppins', 'Inter', sans-serif;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;

    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.15);
    --shadow-glow: 0 0 20px rgba(0, 102, 204, 0.3);

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-round: 50%;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    --gradient-accent: linear-gradient(135deg, var(--accent-color) 0%, #00AA70 100%);
    --gradient-soft: linear-gradient(135deg, rgba(0, 102, 204, 0.1) 0%, rgba(0, 204, 136, 0.1) 100%);
}

/* === Reset & Base Styles === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-white);
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: var(--spacing-sm);
    color: var(--secondary-color);
}

h1 { font-size: 3rem; }
h2 { font-size: 2.5rem; }
h3 { font-size: 2rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: var(--spacing-sm);
    color: var(--text-medium);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul {
    list-style: none;
}

/* === Container & Layout === */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.container-wide {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.container-narrow {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

section {
    padding: var(--spacing-xl) 0;
}

.section-light {
    background-color: var(--bg-light);
}

.section-dark {
    background-color: var(--secondary-color);
    color: var(--bg-white);
}

/* === Navigation === */
.navbar {
    background-color: var(--bg-white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: var(--transition-normal);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
}

.navbar-brand {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.navbar-brand:hover {
    color: var(--primary-dark);
}

.navbar-menu {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
}

.navbar-menu a {
    color: var(--text-dark);
    font-weight: 500;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.navbar-menu a:hover,
.navbar-menu a.active {
    color: var(--primary-color);
    background-color: rgba(0, 102, 204, 0.05);
}

.navbar-menu .btn-primary {
    color: var(--bg-white);
    background: var(--gradient-primary);
    padding: 0.875rem 2rem;
}

.navbar-menu .btn-primary:hover {
    color: var(--bg-white);
    background: var(--gradient-primary);
}

.navbar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-dark);
}

/* === Buttons === */
.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    font-family: var(--font-primary);
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
    z-index: -1;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--bg-white);
    box-shadow: 0 4px 15px rgba(0, 102, 204, 0.2);
}

.btn-primary:hover {
    background: var(--gradient-primary);
    color: var(--bg-white);
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(0, 102, 204, 0.3);
}

.btn-primary:active {
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(0, 102, 204, 0.2);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    box-shadow: 0 4px 15px rgba(0, 102, 204, 0.1);
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: var(--bg-white);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 102, 204, 0.25);
}

.btn-large {
    padding: 1.125rem 2.5rem;
    font-size: 1.125rem;
}

.btn-block {
    display: block;
    width: 100%;
}

/* === Hero Section === */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--bg-white);
    padding: var(--spacing-xl) 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="2" fill="white" opacity="0.1"/></svg>');
    opacity: 0.3;
}

.hero .container {
    position: relative;
    z-index: 1;
}

.hero h1 {
    color: var(--bg-white);
    margin-bottom: var(--spacing-md);
    font-size: 3.5rem;
}

.hero-subheadline {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-lg);
    color: rgba(255, 255, 255, 0.9);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.hero-cta {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
    flex-wrap: wrap;
    margin-top: var(--spacing-lg);
}

.hero-cta .btn {
    min-width: 200px;
}

.hero-cta .btn-secondary {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--bg-white);
    border-color: var(--bg-white);
}

.hero-cta .btn-secondary:hover {
    background-color: var(--bg-white);
    color: var(--primary-color);
}

/* === Grid System === */
.grid {
    display: grid;
    gap: var(--spacing-md);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* === Cards === */
.card {
    background-color: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    box-shadow: var(--shadow-sm);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(255, 255, 255, 1) 0%, rgba(248, 249, 250, 0.5) 100%);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 102, 204, 0.05), transparent);
    transition: left 0.5s ease;
}

.card:hover::before {
    left: 100%;
}

.card:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-8px) scale(1.02);
    border-color: var(--primary-light);
}

.card-icon {
    width: 60px;
    height: 60px;
    background: var(--gradient-soft);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--spacing-sm);
    font-size: 2rem;
    color: var(--primary-color);
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.15);
}

.card-title {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-sm);
    color: var(--secondary-color);
}

.card-text {
    color: var(--text-medium);
    margin-bottom: var(--spacing-sm);
}

.card-price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: var(--spacing-sm) 0;
}

.card-price-unit {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-light);
}

.card-features {
    list-style: none;
    margin-top: var(--spacing-sm);
}

.card-features li {
    padding: var(--spacing-xs) 0;
    color: var(--text-medium);
    position: relative;
    padding-left: 1.5rem;
}

.card-features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--accent-color);
    font-weight: 700;
}

/* === Problem/Solution Section === */
.problems-section {
    background-color: var(--bg-section);
}

.problem-card {
    text-align: center;
}

.problem-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-sm);
}

.problem-title {
    color: var(--error-color);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
}

.solution-list {
    margin-top: var(--spacing-sm);
    text-align: left;
}

.solution-list li {
    padding: var(--spacing-xs) 0;
    padding-left: 1.5rem;
    position: relative;
}

.solution-list li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent-color);
    font-weight: 700;
}

/* === Timeline (Come Funziona) === */
.timeline {
    position: relative;
    padding: var(--spacing-md) 0;
}

.timeline-item {
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    position: relative;
}

.timeline-number {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    background-color: var(--primary-color);
    color: var(--bg-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    box-shadow: var(--shadow-md);
}

.timeline-content {
    flex: 1;
    background-color: var(--bg-white);
    padding: var(--spacing-md);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.timeline-title {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-sm);
    color: var(--secondary-color);
}

.timeline-description {
    color: var(--text-medium);
    margin-bottom: var(--spacing-sm);
}

.timeline-meta {
    display: flex;
    gap: var(--spacing-md);
    margin-top: var(--spacing-sm);
    font-size: 0.875rem;
    color: var(--text-light);
}

/* === Form Styles === */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 500;
    color: var(--text-dark);
}

.form-control {
    width: 100%;
    padding: 0.875rem;
    font-family: var(--font-primary);
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.form-control::placeholder {
    color: var(--text-light);
}

/* textarea defaults: allow vertical resize, keep modest height for 2 lines (rows="2" also respected)
   Reduce min-height so a two-line textarea looks compact across the site. */
textarea.form-control {
    resize: vertical;
    min-height: 64px; /* comfortable ~2 line height with padding */
}

/* utility: make a form-group span the full width of a grid (useful in grid forms) */
.form-group--full {
    grid-column: 1 / -1;
}

select.form-control {
    cursor: pointer;
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.form-checkbox input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
}

/* === Section Headers === */
.section-header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-sm);
    color: var(--secondary-color);
}

.section-subtitle {
    font-size: 1.25rem;
    color: var(--text-light);
    max-width: 700px;
    margin: 0 auto;
}

/* === Pricing Calculator === */
.pricing-calculator {
    background-color: var(--bg-light);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-top: var(--spacing-lg);
}

.pricing-breakdown {
    margin-top: var(--spacing-md);
}

.pricing-item {
    display: flex;
    justify-content: space-between;
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--border-color);
}

.pricing-total {
    display: flex;
    justify-content: space-between;
    padding: var(--spacing-md) 0;
    margin-top: var(--spacing-sm);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.pricing-savings {
    text-align: center;
    margin-top: var(--spacing-md);
    padding: var(--spacing-md);
    background-color: var(--accent-color);
    color: var(--bg-white);
    border-radius: var(--radius-md);
    font-weight: 600;
}

/* === CTA Sections === */
.cta-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--bg-white);
    text-align: center;
    padding: var(--spacing-xl) 0;
}

.cta-section h2 {
    color: var(--bg-white);
    margin-bottom: var(--spacing-sm);
}

.cta-section p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.25rem;
    margin-bottom: var(--spacing-lg);
}

/* === Footer === */
.footer {
    background-color: var(--secondary-color);
    color: var(--bg-white);
    padding: var(--spacing-xl) 0 var(--spacing-md);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.footer-section h4 {
    color: var(--bg-white);
    margin-bottom: var(--spacing-md);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: var(--spacing-sm);
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    transition: var(--transition-fast);
}

.footer-links a:hover {
    color: var(--bg-white);
}

.footer-bottom {
    text-align: center;
    padding-top: var(--spacing-md);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
}

/* === Badge === */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    background-color: var(--accent-color);
    color: var(--bg-white);
}

.badge-primary {
    background-color: var(--primary-color);
}

.badge-success {
    background-color: var(--success-color);
}

/* === Accordion (FAQ) === */
.accordion {
    margin-top: var(--spacing-md);
}

.accordion-item {
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-sm);
    overflow: hidden;
}

.accordion-header {
    width: 100%;
    padding: var(--spacing-md);
    background: none;
    border: none;
    text-align: left;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition-fast);
}

.accordion-header:hover {
    background-color: var(--bg-light);
}

.accordion-icon {
    transition: var(--transition-fast);
}

.accordion-item.active .accordion-icon {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding: 0 var(--spacing-lg);
}

.accordion-item.active .accordion-content {
    max-height: 500px;
    padding: var(--spacing-md) var(--spacing-lg) var(--spacing-lg);
}

.accordion-body {
    padding: 0 var(--spacing-md) var(--spacing-md);
    color: var(--text-medium);
}

/* === Highlight Box === */
.highlight-box {
    background-color: var(--bg-light);
    border-left: 4px solid var(--primary-color);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin: var(--spacing-md) 0;
}

.highlight-box.success {
    border-left-color: var(--success-color);
    background-color: rgba(40, 167, 69, 0.05);
}

.highlight-box.accent {
    border-left-color: var(--accent-color);
    background-color: rgba(0, 204, 136, 0.05);
}

/* === Utilities === */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: var(--spacing-xs); }
.mt-2 { margin-top: var(--spacing-sm); }
.mt-3 { margin-top: var(--spacing-md); }
.mt-4 { margin-top: var(--spacing-lg); }

.mb-1 { margin-bottom: var(--spacing-xs); }
.mb-2 { margin-bottom: var(--spacing-sm); }
.mb-3 { margin-bottom: var(--spacing-md); }
.mb-4 { margin-bottom: var(--spacing-lg); }

.pt-4 { padding-top: var(--spacing-lg); }
.pb-4 { padding-bottom: var(--spacing-lg); }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }

.text-primary { color: var(--primary-color); }
.text-secondary { color: var(--secondary-color); }
.text-light { color: var(--text-light); }

.bg-light { background-color: var(--bg-light); }
.bg-white { background-color: var(--bg-white); }
