/* --- Header & Footer --- */

header {
    position: sticky;
    z-index: 100;
    left: 0;
    right: 0;
    top: 0;
    font-weight: 500;
    height: var(--header-height);
    color: var(--text-dim);
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

nav {
    display: flex;
    align-items: center;
    max-width: 1200px;
    height: 100%;
    margin: 0 auto;
    color: var(--text-dim);
    padding: 0 var(--gap-small);
    gap: var(--gap-small);
}

nav .logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 28px;
    font-weight: 700;
}

nav .nav-links {
    display: flex;
    margin-left: auto;
    gap: var(--gap-small);
}

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

nav .nav-actions {
    display: flex;
    align-items: center;
    margin-left: auto;
    gap: var(--gap-tiny);
}

footer {
    font-size: 14px;
    color: #94a3b8;
    background: #273d72;
}

.footer-inner {
    display: grid;
    grid-template-columns: 1.2fr 2fr;
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--gap-large);
    gap: var(--gap-large);
}

.footer-brand {
    display: flex;
    flex-direction: column;
}

.footer-brand .logo {
    display: flex;
    align-items: center;
    width: fit-content;
    gap: 8px;
    margin-bottom: var(--gap-tiny);
    font-size: 28px;
    font-weight: 700;
    opacity: 0.5;
}

.footer-brand .logo-icon {
    display: inline-block;
    width: 32px;
    height: 32px;
    background-color: currentColor;
    mask: url(/assets/logo.svg) no-repeat center / contain;
    -webkit-mask: url(/assets/logo.svg) no-repeat center / contain;
    flex-shrink: 0;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    justify-self: end;
    gap: var(--gap-regular);
}

.footer-col h4 {
    text-transform: uppercase;
    margin-bottom: var(--gap-tiny);
    opacity: 0.5;
}

.footer-col a {
    display: block;
    padding: 3px 0;
}

.footer-col a:hover {
    color: #fff;
}

.copyright {
    text-align: center;
    padding: 0 var(--gap-small) var(--gap-small);
    opacity: 0.5;
}

/* --- Sections --- */

section {
    background: var(--white);
    padding: var(--gap-huge) calc(50% - 576px);
    scroll-margin-top: var(--header-height);
}

section.hero {
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--background);
    min-height: calc(100vh - var(--gap-large));
    gap: var(--gap-large);
}

section.hero h1 {
    font-size: 56px;
    font-weight: 700;
    line-height: 1.1;
}

.hero-slogan {
    display: flex;
    flex-direction: column;
    gap: var(--gap-small);
}

.hero-desc {
    font-size: 18px;
    color: var(--text-dim);
    margin-bottom: var(--gap-tiny);
}

.hero-values {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--gap-small);
    width: fit-content;
    margin: 0 auto;
}

.value-card {
    display: flex;
    align-items: center;
    gap: var(--gap-tiny);
}

.value-icon {
    flex-shrink: 0;
    background: var(--white);
    border: 1px solid var(--th-primary);
    color: var(--th-primary);
}

.value-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.value-type {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-dim);
}

.value-desc {
    font-size: 14px;
    font-weight: 600;
}

.hero-comparator {
    border-radius: var(--radius-regular);
    overflow: hidden;
}

.comparator-label {
    position: absolute;
    bottom: 16px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: var(--radius-small);
    pointer-events: none;
    -webkit-user-select: none;
    user-select: none;
}

.left-label {
    left: 16px;
    background: rgba(0, 0, 0, 0.5);
    color: var(--white);
}

.right-label {
    right: 16px;
    background: rgba(255, 255, 255, 0.8);
    color: var(--text-color);
}

.section-alt {
    background: var(--background);
}

.section-header {
    text-align: center;
    margin-bottom: var(--gap-large);
}

.section-header h2 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: var(--gap-tiny);
    line-height: 1.2;
}

.section-header p {
    font-size: 18px;
    color: var(--text-dim);
}

/* --- Features Styles --- */

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--gap-small);
}

.feature-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-large);
    padding: var(--gap-regular);
    transition:
        box-shadow 0.3s,
        transform 0.3s;
}

.feature-card:hover {
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
    border-color: #cbd5e1;
}

.feature-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.feature-card p {
    color: var(--text-dim);
}

.feature-icon {
    margin-bottom: var(--gap-small);
    background: linear-gradient(135deg, var(--th-primary), #7c3aed);
    color: #fff;
}

/* --- Pricing Styles --- */

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--gap-medium);
}

.pricing-card {
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-large);
    border: 1px solid var(--border);
    background: var(--white);
    padding: var(--gap-regular);
}

.pricing-card.popular {
    border-color: var(--th-primary);
    box-shadow:
        0 0 0 1px var(--th-primary),
        0 8px 30px rgba(37, 99, 235, 0.1);
    transform: scale(1.05);
}

.pricing-header h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: var(--gap-tiny);
}

.pricing-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--th-primary);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 16px;
    border-radius: var(--radius-large);
    text-transform: uppercase;
    white-space: nowrap;
}

.price {
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.price .amount {
    font-size: 36px;
    font-weight: 700;
}

.price .period {
    color: var(--text-dim);
    font-weight: 500;
}

.price-desc {
    color: var(--text-dim);
}

.pricing-features {
    list-style: none;
    flex: 1;
    margin: var(--gap-regular) 0;
}

.pricing-features li {
    display: flex;
    align-items: center;
    color: var(--text-dim);
    padding: 4px 0;
    gap: var(--gap-tiny);
}

.pricing-features li svg {
    flex-shrink: 0;
    color: var(--green);
}

.pricing-card > .plan-btn {
    align-self: center;
}

/* --- FAQ Styles --- */

.faq-list {
    max-width: 720px;
    margin: 0 auto;
}

.faq-item {
    border-bottom: 1px solid var(--border);
}

.faq-item summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    font-weight: 500;
    cursor: pointer;
    list-style: none;
    transition: color 0.2s;
}

.faq-item summary:hover {
    color: var(--th-primary);
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-chevron {
    transition: transform 0.3s;
    color: var(--text-dim);
}

.faq-item[open] .faq-chevron {
    transform: rotate(180deg);
}

.faq-item p {
    padding: 0 0 20px;
    color: var(--text-dim);
}

/* --- Contact Styles --- */

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1px 1fr 1px 1fr;
    max-width: 800px;
    margin: 0 auto;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-large);
    padding: var(--gap-regular);
}

.contact-info {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--gap-tiny);
}

.contact-icon {
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--th-primary), #7c3aed);
    color: #fff;
}

.contact-label {
    display: block;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
}

.contact-divider {
    height: 100%;
    background: var(--border);
}

/* --- Policy Styles --- */

.policy-page {
    max-width: 800px;
    margin: 0 auto;
    padding: var(--gap-large) var(--gap-small);
}

.policy-page h1 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: var(--gap-tiny);
    line-height: 1.2;
}

.policy-page .last-updated {
    color: var(--gray);
    margin-bottom: var(--gap-regular);
}

.policy-page h2 {
    font-size: 22px;
    font-weight: 600;
    margin: var(--gap-small) 0 var(--gap-tiny);
}

.policy-page h3 {
    font-size: 18px;
    font-weight: 600;
    margin: var(--gap-small) 0 var(--gap-tiny);
}

.policy-page p {
    margin-bottom: var(--gap-tiny);
    line-height: 1.8;
}

.policy-page ul,
.policy-page ol {
    padding-left: 24px;
    margin-bottom: var(--gap-tiny);
}

.policy-page ul li,
.policy-page ol li {
    margin-bottom: 6px;
}

.policy-page table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--gap-regular) 0;
}

.policy-page th,
.policy-page td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    line-height: 1.4;
}

.policy-page th {
    font-weight: 600;
    background: rgba(0, 0, 0, 0.02);
}

/* --- Cookie Banner --- */

.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.06);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.cookie-banner.visible {
    transform: translateY(0);
}

.cookie-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px var(--gap-small);
    gap: 16px;
}

.cookie-text {
    font-size: 14px;
    color: var(--text-dim);
}

.cookie-actions {
    display: flex;
    gap: var(--gap-tiny);
    flex-shrink: 0;
}

/* --- Auth Pages --- */

.auth-page {
    display: flex;
    justify-content: center;
    padding: var(--gap-medium) var(--gap-small);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: var(--gap-small);
    width: 100%;
}

.auth-form th-button {
    margin-top: var(--gap-tiny);
}

.auth-form th-button::part(button) {
    width: 100%;
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field-group label {
    font-size: 14px;
    font-weight: 500;
}

.auth-options {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

.forgot-link {
    font-size: 14px;
    color: var(--text-dim);
}

.auth-footer {
    text-align: center;
    font-size: 14px;
    color: var(--text-dim);
}

.auth-footer a {
    font-weight: 500;
}

.agree-text {
    font-size: 14px;
}

.agree-text a {
    font-weight: 500;
}

/* --- Central Card --- */

.central-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 420px;
    background: var(--white);
    border-radius: var(--radius-large);
    border: 1px solid var(--border);
    padding: var(--gap-regular);
}

.central-card h1 {
    font-size: 28px;
    font-weight: 600;
}

.central-card > th-button {
    align-self: center;
}

.central-card .subtitle {
    color: var(--text-dim);
    margin: var(--gap-tiny) 0 var(--gap-regular) 0;
}

/* --- Responsive --- */

@media (max-width: 1200px) {
    section {
        padding: var(--gap-huge) var(--gap-small);
    }
}

@media (max-width: 960px) {
    section {
        padding: var(--gap-small);
    }

    section.hero {
        flex-direction: column;
        min-height: auto;
        gap: var(--gap-small);
    }

    section.hero > * {
        width: 100% !important;
    }

    .section-header {
        margin-bottom: var(--gap-regular);
    }

    .features-grid,
    .pricing-grid {
        grid-template-columns: 1fr;
        gap: var(--gap-small);
    }

    .pricing-card.popular {
        transform: none;
    }

    .contact-content {
        grid-template-columns: 1fr;
        padding: var(--gap-small);
    }

    .contact-info {
        justify-content: unset;
        justify-self: center;
        width: 100%;
        max-width: 200px;
    }

    .contact-divider {
        width: 100%;
        height: 1px;
        margin: 18px 0;
    }

    .footer-inner {
        grid-template-columns: 1fr;
        padding: var(--gap-regular);
        gap: var(--gap-regular);
    }

    .footer-brand {
        align-items: center;
    }

    .footer-links {
        justify-self: center;
    }
}

@media (max-width: 640px) {
    nav {
        gap: var(--gap-small);
    }

    nav .nav-links {
        display: none;
    }

    nav .nav-actions {
        margin-left: auto;
    }

    .app-name {
        display: none;
    }

    .section-header h2,
    .policy-page h1 {
        font-size: 28px;
    }

    .policy-page {
        padding: var(--gap-regular) var(--gap-small);
    }

    .cookie-content {
        flex-direction: column;
    }
}
