/* ==========================================================================
   COTERIE - PUBLIC PAGES
   Loaded by the landing page and the legal pages. It only holds what is specific
   to them: page layout, header, hero, sections, footer and legal content.

   The design system is shared with the application:
     tokens (--ds-*, fonts)            base.css
     buttons, alerts, modals, OTP      components.css   (.surface-brand inverts the primary button)
     inputs and form sections          forms.css
     toasts                            toast.css
     login and onboarding flows        onboarding.css

   1. Base
   2. Layout primitives
   3. Page sections: header, hero, comparison, features, CTA, footer
   4. Legal content
   5. Responsive
   6. Reduced motion
   ========================================================================== */

/* ==========================================================================
   1. BASE
   ========================================================================== */
body.landing-body {
    display: block; /* Override flex from app layout */
    overflow: auto; /* Allow scrolling */
    height: auto;
}

/* ==========================================================================
   2. LAYOUT PRIMITIVES
   ========================================================================== */
section {
    padding: 4rem 1.5rem;
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 2rem;
}

.section-title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.01em;
}

.section-subtitle {
    color: var(--ds-muted);
    font-size: 1.05rem;
    line-height: 1.6;
    max-width: 32rem;
    margin-top: -1rem;
}

/* ==========================================================================
   3. PAGE SECTIONS
   ========================================================================== */

/* ---------- 3.1 Header ---------- */
.landing-header {
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 0.75rem 1rem;
    background-color: var(--ds-surface);
    border-bottom: 1px solid var(--ds-border);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-weight: 800;
    font-size: 1rem;
    color: var(--ds-text);
}

.brand-name {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.375rem;
    letter-spacing: -0.02em;
}

.alpha-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.5rem;
    border-radius: var(--ds-radius-pill);
    background-color: var(--ds-brand-soft);
    color: var(--ds-text);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* Header login button: icon on mobile, label on desktop */
.landing-body .btn-login-desktop {
    display: none;
}

.landing-body .btn-login-mobile {
    display: inline-flex;
}

/* ---------- 3.2 Hero ---------- */
.hero-section {
    width: 100%;
    max-width: 100%;
    padding-top: 3.5rem;
    padding-bottom: 3.5rem;
}

.hero-title {
    font-size: clamp(2.125rem, 1.1rem + 4.9vw, 4.5rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.025em;
}

/* Highlighted word: white pill behind the text */
.highlight-yellow {
    position: relative;
    display: inline-block;
    z-index: 0;
}

.highlight-yellow::after {
    content: '';
    position: absolute;
    left: -0.14em;
    right: -0.14em;
    top: 0.1em;
    bottom: 0.04em;
    background-color: var(--ds-surface);
    border-radius: 0.3em;
    z-index: -1;
}

/* In the hero the highlighted word always sits on its own, centred line */
.hero-title .highlight-yellow {
    display: block;
    width: fit-content;
    margin: 0.06em auto 0;
}

.hero-description {
    font-size: 1.125rem;
    color: var(--ds-text);
    line-height: 1.6;
    max-width: 36rem;
}

.hero-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
    max-width: 22rem;
}

/* Reassurance line for residents: its own centred row under the buttons */
.hero-resident-hint {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: center;
    gap: 0.25rem 0.5rem;
    margin-top: -1rem;
    font-size: 0.95rem;
    color: var(--ds-text);
}

.hero-resident-hint-links {
    display: inline-flex;
    align-items: baseline;
    gap: 0.5rem;
    white-space: nowrap;
}

.hero-resident-hint a {
    display: inline-block;
    padding: 0.25rem 0.125rem;
    color: var(--ds-text);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.hero-resident-hint a:hover {
    text-decoration-thickness: 2px;
}

/* ---------- 3.3 Problem / solution ---------- */
.comparison-section-container {
    width: 100%;
    max-width: 100%;
    background-color: var(--ds-surface-alt);
    border-top: 1px solid var(--ds-border);
    border-bottom: 1px solid var(--ds-border);
}

.comparison-cards-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    width: 100%;
}

.comparison-card {
    width: 100%;
    padding: 1.75rem;
    background-color: var(--ds-surface);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-lg);
    text-align: left;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.icon-box {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--ds-radius-sm);
    color: var(--ds-text);
}

.icon-box svg {
    width: 22px;
    height: 22px;
}

.comparison-card.problem .icon-box {
    background-color: var(--ds-danger-soft);
}

.comparison-card.solution .icon-box {
    background-color: var(--ds-brand);
}

.comparison-card h3 {
    font-size: 1.375rem;
    font-weight: 700;
}

.comparison-card ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.comparison-card li {
    position: relative;
    padding-left: 1.25rem;
    line-height: 1.5;
}

.comparison-card li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--ds-text);
}

/* ---------- 3.4 Features: minimal list, no identical cards ---------- */
.features-section {
    max-width: 960px;
    gap: 2.5rem;
    align-items: stretch;
    text-align: left;
}

.features-section > .section-title {
    text-align: center;
}

.features-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr;
    border-top: 1px solid var(--ds-border);
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--ds-border);
}

.feature-item-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    margin-top: 0.125rem;
    color: var(--ds-text);
}

.feature-item-icon svg {
    display: block;
    width: 24px;
    height: 24px;
    stroke-width: 2;
}

.feature-item-body {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.feature-item h3 {
    font-family: var(--font-body);
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--ds-text);
}

.feature-item p {
    font-size: 0.975rem;
    line-height: 1.5;
    color: var(--ds-muted);
}

/* ---------- 3.5 CTA ---------- */
.cta-section {
    width: 100%;
    max-width: 100%;
    padding: 4.5rem 1.5rem;
    border-top: 1px solid var(--ds-border);
}

.cta-section h2 {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.cta-section p {
    font-size: 1.125rem;
    color: var(--ds-text);
}

/* ---------- 3.6 Footer ---------- */
.landing-footer {
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
    background-color: var(--ds-surface);
    border-top: 1px solid var(--ds-border);
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-display);
    font-weight: 800;
}

.footer-legal-links {
    font-size: 0.875rem;
    color: var(--ds-muted);
}

.footer-legal-links a {
    color: var(--ds-muted);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.15s ease;
}

.footer-legal-links a:hover {
    color: var(--ds-text);
}

.copyright {
    font-size: 0.875rem;
    color: var(--ds-muted);
}

/* ==========================================================================
   4. LEGAL CONTENT
   ========================================================================== */
.legal-content {
    line-height: 1.7;
    color: var(--ds-text);
}

.legal-content h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.legal-content h2 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.25rem;
    border-bottom: 2px solid var(--ds-brand);
}

.legal-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}

.legal-content p {
    margin-bottom: 0.75rem;
}

.legal-content ul {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.legal-content ul li {
    margin-bottom: 0.4rem;
}

.legal-content a {
    color: var(--ds-text);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: var(--ds-brand);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

.legal-content a:hover {
    text-decoration-color: var(--ds-text);
}

.legal-updated {
    margin-bottom: 1.5rem;
    color: var(--ds-muted);
    font-size: 0.9rem;
    font-style: italic;
}

/* Legal modal (landing footer links): wider panel, the content is already framed by it */
#legal-modal .modal-panel {
    max-width: 800px;
}

.legal-modal-content {
    border: none;
    padding: 1.5rem;
    max-width: none;
    box-shadow: none;
}

/* ==========================================================================
   5. RESPONSIVE
   ========================================================================== */
@media (max-width: 767px) {
    .hero-section {
        padding-top: 2.5rem;
        padding-bottom: 2.5rem;
    }

    .hero-description {
        font-size: 1.1rem;
    }

    section {
        padding: 2.5rem 1rem;
        gap: 1.5rem;
    }

    .comparison-card {
        padding: 1.5rem;
    }

    .comparison-card h3 {
        font-size: 1.25rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .cta-section h2 {
        font-size: 1.75rem;
    }
}

@media (min-width: 768px) {
    .landing-body .btn-login-desktop {
        display: inline-flex;
    }

    .landing-body .btn-login-mobile {
        display: none;
    }

    .hero-actions {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        max-width: none;
    }

    .hero-actions > a {
        white-space: nowrap;
    }

    .features-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 3rem;
    }
}

@media (min-width: 1024px) {
    .header-content {
        padding: 0 2rem;
    }

    section {
        padding: 5rem 3rem;
        max-width: 1200px;
    }

    .hero-section {
        padding-top: 4.5rem;
        padding-bottom: 4.5rem;
    }

    .hero-description {
        font-size: 1.25rem;
        max-width: 40rem;
    }

    .comparison-cards-wrapper {
        flex-direction: row;
        align-items: stretch;
        gap: 2rem;
        max-width: 1200px;
        margin: 0 auto;
    }

    .section-title,
    .section-subtitle {
        width: 100%;
    }

    .comparison-card {
        flex: 1;
    }

    .cta-section {
        padding: 5rem 3rem;
    }

    .cta-section h2 {
        font-size: 3rem;
    }

    .landing-footer {
        flex-direction: row;
        justify-content: space-between;
        padding: 2rem 4rem;
    }
}

/* ==========================================================================
   6. REDUCED MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    .footer-legal-links a {
        transition: none;
    }
}
