/* Reset and Base Styles */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --color-primary: #1a56db;
    --color-primary-dark: #1444a3;
    --color-secondary: #0f172a;
    --color-accent: #10b981;
    --color-text: #1e293b;
    --color-text-light: #475569;
    --color-text-muted: #64748b;
    --color-background: #ffffff;
    --color-surface: #f8fafc;
    --color-border: #e2e8f0;
    --color-gold: #fbbf24;
    --color-silver: #9ca3af;
    --color-bronze: #d97706;
    --color-success: #10b981;
    --color-error: #ef4444;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-background);
}

.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--color-primary);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 1000;
    border-radius: 0 0 var(--radius-sm) 0;
}

.skip-link:focus {
    top: 0;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Global focus styles */
a:focus-visible,
button:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: 2px;
}

/* Typography */
h1, h2, h3, h4 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--color-secondary);
}

h1 {
    font-size: clamp(2rem, 5vw, 3rem);
}

h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    margin-bottom: 16px;
}

h3 {
    font-size: 1.25rem;
}

p {
    margin-bottom: 16px;
}

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

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

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

.btn-primary:hover:not(:disabled) {
    background-color: var(--color-primary-dark);
    color: white;
}

.btn-secondary {
    background-color: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}

.btn-secondary:hover:not(:disabled) {
    background-color: var(--color-primary);
    color: white;
}

.btn-full {
    width: 100%;
}

/* Header */
.header {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--color-border);
    z-index: 100;
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--color-secondary);
}

.logo:hover {
    color: var(--color-secondary);
}

.logo-icon {
    font-size: 1.5rem;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 32px;
}

.nav-links a {
    color: var(--color-text);
    font-weight: 500;
    font-size: 0.95rem;
}

.nav-links a:hover {
    color: var(--color-primary);
}

/* Mobile menu toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
}

.hamburger {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-text);
    position: relative;
    transition: background 0.2s;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background: var(--color-text);
    left: 0;
    transition: transform 0.2s;
}

.hamburger::before {
    top: -7px;
}

.hamburger::after {
    bottom: -7px;
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger {
    background: transparent;
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger::before {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger::after {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Hero Section */
.hero {
    padding: 80px 0 100px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 50%, #f0fdf4 100%);
    text-align: center;
}

.hero h1 {
    max-width: 700px;
    margin: 0 auto 24px;
}

.hero-subtitle {
    max-width: 600px;
    margin: 0 auto 16px;
    font-size: 1.2rem;
    color: var(--color-text-light);
}

.hero-stats {
    color: var(--color-text-muted);
    margin-bottom: 32px;
    font-size: 1rem;
}

.hero-stats strong {
    color: var(--color-primary);
    font-weight: 600;
}

.hero-cta {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Why Section */
.why-section {
    padding: 80px 0;
    background: var(--color-secondary);
    color: white;
}

.why-content {
    max-width: 700px;
    margin: 0 auto;
}

.why-content h2 {
    color: white;
    margin-bottom: 24px;
}

.why-content p {
    color: #e2e8f0;
    font-size: 1.1rem;
}

/* Rankings Section */
.rankings-section {
    padding: 80px 0;
}

.section-intro {
    color: var(--color-text-light);
    margin-bottom: 40px;
    max-width: 700px;
}

.rankings-table {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    border: 1px solid var(--color-border);
}

.ranking-header,
.ranking-row {
    display: grid;
    grid-template-columns: 80px 1fr 100px 100px 60px;
    align-items: center;
    padding: 16px 24px;
}

.ranking-header {
    background: var(--color-surface);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
}

.ranking-row {
    border-top: 1px solid var(--color-border);
}

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-weight: 600;
    background: var(--color-surface);
    color: var(--color-text);
}

.ranking-row.gold .rank-badge {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
}

.ranking-row.silver .rank-badge {
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    color: #475569;
}

.ranking-row.bronze .rank-badge {
    background: linear-gradient(135deg, #fef3c7, #fed7aa);
    color: #9a3412;
}

.brand-col {
    font-weight: 500;
}

.score {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--color-secondary);
}

.votes-col {
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

.trend-up {
    color: var(--color-accent);
    font-weight: 600;
}

.trend-down {
    color: var(--color-error);
    font-weight: 600;
}

.trend-same {
    color: var(--color-text-muted);
}

.rankings-note {
    margin-top: 24px;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

/* Vote Section */
.vote-section {
    padding: 80px 0;
    background: var(--color-surface);
}

.vote-form {
    max-width: 500px;
    margin: 0 auto;
    background: white;
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
}

.form-group select,
.form-group input[type="text"],
.form-group input[type="email"],
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    font-family: inherit;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: border-color 0.2s;
    background-color: white;
}

.form-group select:focus,
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
}

/* Form validation */
.form-group input.error,
.form-group select.error,
.form-group textarea.error {
    border-color: var(--color-error);
}

.error-message {
    display: block;
    color: var(--color-error);
    font-size: 0.85rem;
    margin-top: 6px;
}

/* Star Rating */
.star-rating {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 4px;
}

.star-rating input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.star-rating label {
    font-size: 2rem;
    color: var(--color-border);
    cursor: pointer;
    transition: color 0.1s, transform 0.1s;
    padding: 4px;
}

.star-rating label:hover,
.star-rating label:hover ~ label,
.star-rating input:checked ~ label {
    color: var(--color-gold);
}

/* Star rating focus states */
.star-rating label:focus,
.star-rating input:focus + label {
    outline: 3px solid var(--color-primary);
    outline-offset: 4px;
    border-radius: 4px;
}

.star-rating input:focus-visible + label {
    transform: scale(1.1);
}

.rating-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-top: 8px;
}

/* How Section */
.how-section {
    padding: 80px 0;
}

.how-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 32px;
    margin-top: 40px;
}

.how-card {
    text-align: center;
    padding: 32px;
}

.how-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--color-primary);
    color: white;
    font-weight: 600;
    font-size: 1.25rem;
    border-radius: 50%;
    margin-bottom: 16px;
}

.how-card h3 {
    margin-bottom: 12px;
}

.how-card p {
    color: var(--color-text-light);
    margin-bottom: 0;
}

/* Newsletter Section */
.newsletter-section {
    padding: 80px 0;
    background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
    color: white;
}

.newsletter-content {
    max-width: 550px;
    margin: 0 auto;
    text-align: center;
}

.newsletter-content h2 {
    color: white;
}

.newsletter-content > p {
    color: #bfdbfe;
    margin-bottom: 32px;
}

.newsletter-form {
    text-align: left;
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-row input[type="email"] {
    flex: 1;
    padding: 14px 16px;
    font-size: 1rem;
    border: none;
    border-radius: var(--radius-md);
}

.form-row .btn {
    white-space: nowrap;
}

/* GDPR Consent Checkbox */
.gdpr-consent {
    margin-top: 16px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #bfdbfe;
}

.checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkmark {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border: 2px solid #93c5fd;
    border-radius: 4px;
    margin-top: 2px;
    position: relative;
    transition: all 0.2s;
}

.checkbox-label input:focus-visible + .checkmark {
    outline: 3px solid white;
    outline-offset: 2px;
}

.checkbox-label input:checked + .checkmark {
    background: var(--color-accent);
    border-color: var(--color-accent);
}

.checkbox-label input:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.consent-text a {
    color: white;
    text-decoration: underline;
}

/* About Section */
.about-section {
    padding: 80px 0;
}

.about-content {
    max-width: 700px;
}

.about-content p {
    color: var(--color-text-light);
    font-size: 1.1rem;
}

.about-principles {
    margin-top: 40px;
    padding: 32px;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
}

.about-principles h3 {
    margin-bottom: 16px;
}

.about-principles ul {
    list-style: none;
}

.about-principles li {
    padding: 8px 0;
    padding-left: 28px;
    position: relative;
}

.about-principles li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--color-accent);
    font-weight: bold;
}

/* Trust Signals */
.trust-signals {
    display: grid;
    gap: 20px;
    margin-top: 40px;
}

.trust-signal {
    padding: 24px;
    border-left: 4px solid var(--color-accent);
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.trust-signal h4 {
    font-size: 1rem;
    margin-bottom: 8px;
    color: var(--color-secondary);
}

.trust-signal p {
    margin-bottom: 0;
    color: var(--color-text-light);
    font-size: 0.95rem;
}

/* Success States */
.form-success {
    text-align: center;
    padding: 40px;
}

.success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: var(--color-accent);
    color: white;
    font-size: 2rem;
    border-radius: 50%;
    margin-bottom: 16px;
}

.vote-section .form-success {
    background: white;
    border-radius: var(--radius-lg);
    max-width: 500px;
    margin: 0 auto;
    box-shadow: var(--shadow-md);
}

.success-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
    flex-wrap: wrap;
}

.newsletter-section .form-success {
    margin-top: 24px;
}

.newsletter-section .form-success p {
    color: white;
    margin-bottom: 0;
}

/* Footer */
.footer {
    padding: 48px 0 32px;
    background: var(--color-secondary);
    color: #94a3b8;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-weight: 600;
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-links a {
    color: #94a3b8;
}

.footer-links a:hover {
    color: white;
}

.footer-note {
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.copyright {
    font-size: 0.85rem;
    margin-bottom: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }

    .nav-links {
        position: absolute;
        top: 72px;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        gap: 0;
        padding: 0;
        box-shadow: var(--shadow-md);
        border-bottom: 1px solid var(--color-border);
        display: none;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links li {
        border-top: 1px solid var(--color-border);
    }

    .nav-links a {
        display: block;
        padding: 16px 24px;
    }

    .ranking-header,
    .ranking-row {
        grid-template-columns: 50px 1fr 70px 60px;
        padding: 12px 16px;
        font-size: 0.9rem;
    }

    .votes-col {
        display: none;
    }

    .hero {
        padding: 60px 0 80px;
    }

    .hero-cta {
        flex-direction: column;
        align-items: center;
    }

    .hero-cta .btn {
        width: 100%;
        max-width: 280px;
    }

    .vote-form {
        padding: 24px;
    }

    .form-row {
        flex-direction: column;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .ranking-header,
    .ranking-row {
        grid-template-columns: 40px 1fr 60px;
    }

    .trend-col {
        display: none;
    }

    .success-actions {
        flex-direction: column;
    }

    .success-actions .btn {
        width: 100%;
    }
}
