/**
 * Cookie consent: A2 theme.
 * Banner = compact card, bottom-left on desktop, bottom sheet on phones. No page blur.
 * Settings = centred dialog over a dimmed page.
 * Self-contained: the client-form pages that still use public/styles.css load this too,
 * so every value has its own fallback instead of relying on the A2 tokens.
 */

#cookie-consent-banner,
#cookie-settings-modal {
    --cc-ink: #0B1027;
    --cc-muted: #5B6283;
    --cc-line: #E3E6F2;
    --cc-panel: #F1F3FA;
    --cc-accent: #3346D3;
    --cc-font: 'Outfit Variable', 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --cc-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
    font-family: var(--cc-font);
    color: var(--cc-ink);
    -webkit-font-smoothing: antialiased;
}

/* ---------- Banner ---------- */
#cookie-consent-banner {
    position: fixed;
    left: 24px;
    bottom: 24px;
    z-index: 999999;
    width: min(400px, calc(100vw - 48px));
    animation: cc-rise .35s cubic-bezier(.2, .8, .2, 1);
}

#cookie-consent-banner .cookie-consent-modal {
    background: #FFFFFF;
    border: 1px solid var(--cc-line);
    border-radius: 20px;
    padding: 22px 22px 16px;
    box-shadow: 0 1px 2px rgba(13, 27, 74, .06), 0 24px 48px -16px rgba(13, 27, 74, .28);
}

.cc-eyebrow {
    margin: 0 0 8px;
    font-family: var(--cc-mono);
    font-size: 11px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--cc-accent);
}

#cookie-consent-banner h3,
#cookie-settings-modal h3 {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.25;
    color: var(--cc-ink);
}

#cookie-consent-banner p,
#cookie-settings-modal .cookie-settings-content > p {
    margin: 0;
    font-size: 14px;
    line-height: 1.55;
    color: var(--cc-muted);
}

#cookie-consent-banner p a {
    color: var(--cc-ink);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Accept and Reject get equal size and weight: rejecting must be as easy as accepting */
.cookie-consent-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 18px;
}

.cookie-btn {
    font-family: var(--cc-font);
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    border-radius: 999px;
    padding: 13px 16px;
    cursor: pointer;
    transition: background .2s ease, border-color .2s ease, color .2s ease;
}

.cookie-btn-primary {
    background: var(--cc-ink);
    color: #FFFFFF;
    border: 1px solid var(--cc-ink);
}
.cookie-btn-primary:hover { background: #1B2350; border-color: #1B2350; }

.cookie-btn-secondary {
    background: #FFFFFF;
    color: var(--cc-ink);
    border: 1px solid var(--cc-line);
}
.cookie-btn-secondary:hover { border-color: #C5CAE0; background: var(--cc-panel); }

.cookie-btn-link {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 10px 0 4px;
    background: none;
    border: 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--cc-muted);
}
.cookie-btn-link:hover { color: var(--cc-ink); }

.cookie-btn:focus-visible {
    outline: 2px solid var(--cc-accent);
    outline-offset: 2px;
}

/* ---------- Settings dialog ---------- */
#cookie-settings-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: cc-fade .25s ease-out;
}

#cookie-settings-modal .cookie-consent-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 15, 42, .45);
}

.cookie-settings-content {
    position: relative;
    width: min(480px, 100%);
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    background: #FFFFFF;
    border-radius: 24px;
    padding: 28px;
    box-shadow: 0 30px 70px -20px rgba(8, 14, 40, .45);
}

#cookie-settings-modal h3 { font-size: 22px; }

.cookie-category {
    margin-top: 16px;
    padding: 16px 18px;
    background: var(--cc-panel);
    border-radius: 16px;
}
.cookie-category + .cookie-category { margin-top: 10px; }

.cookie-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.cookie-category-header label { cursor: pointer; }
.cookie-category-header strong {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--cc-ink);
}
.cookie-category-desc {
    display: block;
    margin-top: 3px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--cc-muted);
}

/* Checkbox drawn as a switch; still a real checkbox for keyboard and screen readers */
.cc-switch {
    -webkit-appearance: none;
    appearance: none;
    flex-shrink: 0;
    position: relative;
    width: 42px;
    height: 24px;
    margin: 0;
    border-radius: 999px;
    background: #C5CAE0;
    cursor: pointer;
    transition: background .2s ease;
}
.cc-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #FFFFFF;
    box-shadow: 0 1px 2px rgba(13, 27, 74, .25);
    transition: transform .2s ease;
}
.cc-switch:checked { background: var(--cc-accent); }
.cc-switch:checked::after { transform: translateX(18px); }
.cc-switch:disabled { cursor: not-allowed; opacity: .55; }
.cc-switch:focus-visible { outline: 2px solid var(--cc-accent); outline-offset: 2px; }

.cookie-policy-link {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 16px 0 0;
    font-size: 13px;
}
.cookie-policy-link a { color: var(--cc-muted); text-decoration: underline; text-underline-offset: 2px; }
.cookie-policy-link a:hover { color: var(--cc-ink); }

/* ---------- Phones: banner becomes a bottom sheet ---------- */
@media (max-width: 600px) {
    #cookie-consent-banner {
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
    }
    #cookie-consent-banner .cookie-consent-modal {
        border-radius: 20px 20px 0 0;
        border-bottom: 0;
        padding: 20px 16px calc(12px + env(safe-area-inset-bottom));
    }
    .cookie-settings-content { padding: 22px 18px; border-radius: 20px; }
}

@keyframes cc-rise {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: none; }
}
@keyframes cc-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    #cookie-consent-banner, #cookie-settings-modal { animation: none; }
    .cc-switch, .cc-switch::after { transition: none; }
}

@media print {
    #cookie-consent-banner, #cookie-settings-modal { display: none !important; }
}

/* Home video end card corner fix (14 Oct 2026). Lives here as well as home.css because the
   host scanner blocks re-uploading index.html, where home.css is inlined. Remove once the
   host whitelists index.html and a fresh home page has deployed. */
.home-video .video-end-overlay { inset: -2px; }
.home-video { isolation: isolate; transition: background-color .4s ease; }
.home-video:has(.video-end-overlay.visible) { background: #F7F8FC; }
.home-video:has(.video-end-overlay.visible) video { visibility: hidden; }

/* Phones: video fills its 16:9 box, no dark strip underneath (14 Oct 2026). Overrides the inlined
   home.css copy still on the server; same removal condition as the block above. */
@media (max-width: 600px) {
  .home-founder .home-video { aspect-ratio: 16 / 9; }
  .home-founder .home-video video { height: 100%; aspect-ratio: auto; object-fit: cover; object-position: center; }
}
