/*
 * Public pages: landing, sign-in link, OAuth consent and sign-out, platform notices and error pages.
 * Same brand system as the panels (resources/css/filament/admin/theme.css) and the Bahari SMS app:
 *   navy #292562 (hover #1e1b4b, deep #141238), orange accent #f79521 with navy text, slate neutrals,
 *   Inter (self-hosted, /fonts/filament/filament/inter), solid colours only, light and dark.
 */
:root {
    color-scheme: light;
    --navy: #292562;
    --navy-hover: #1e1b4b;
    --navy-deep: #141238;
    --navy-tint: #f2f3fa;
    --navy-line: #c7cded;
    --accent: #f79521;
    --accent-hover: #e67e0a;
    --on-accent: #141238;
    --canvas: #f8fafc;
    --surface: #ffffff;
    --ink: #0f172a;
    --muted: #475569;
    --line: #e2e8f0;
    --line-strong: #cbd5e1;
    --link: #292562;
    --focus: #292562;
    --danger: #be123c;
    --danger-bg: #fff1f2;
    --warning: #b45309;
    --success: #047857;
    --btn: #292562;
    --btn-hover: #1e1b4b;
    --radius: 0.75rem;
    --font: 'Inter Variable', Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
        --navy-tint: #1a1840;
        --navy-line: #3a3f7a;
        --canvas: #020617;
        --surface: #0f172a;
        --ink: #f1f5f9;
        --muted: #94a3b8;
        --line: #1e293b;
        --line-strong: #334155;
        --link: #c7cded;
        --focus: #f79521;
        --danger: #fda4af;
        --danger-bg: #4c0519;
        --warning: #fbbf24;
        --success: #6ee7b7;
        --btn: #4e5fb9;
        --btn-hover: #5b6bc4;
    }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
    margin: 0;
    min-height: 100dvh;
    background: var(--canvas);
    color: var(--ink);
    font: 400 1rem/1.6 var(--font);
    font-feature-settings: 'cv11', 'ss01';
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; }
a { color: var(--link); text-underline-offset: 3px; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 10; padding: 0.625rem 1rem; border-radius: 0.5rem; background: var(--navy); color: #fff; font-weight: 600; }
.skip-link:focus { top: 1rem; }

.wrap { width: 100%; max-width: 80rem; margin-inline: auto; padding-inline: clamp(1rem, 4vw, 3rem); }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    min-height: 2.75rem; padding: 0.625rem 1.125rem; border: 1px solid transparent; border-radius: 0.625rem;
    font-size: 0.9375rem; font-weight: 600; line-height: 1.25; text-decoration: none; white-space: nowrap; cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn svg { width: 1.125rem; height: 1.125rem; flex-shrink: 0; }
.btn-primary { background: var(--btn); color: #fff; }
.btn-primary:hover { background: var(--btn-hover); }
.btn-secondary { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn-secondary:hover { border-color: var(--muted); }
.btn-accent { background: var(--accent); color: var(--on-accent); }
.btn-accent:hover { background: var(--accent-hover); }
.btn-ghost-light { border-color: rgb(255 255 255 / 0.4); color: #fff; }
.btn-ghost-light:hover { border-color: #fff; }
.btn-block { width: 100%; }
.btn-sm { min-height: 2.5rem; padding: 0.5rem 0.875rem; font-size: 0.875rem; }

/* Brand mark */
.brand { display: inline-flex; align-items: center; gap: 0.625rem; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1.125rem; letter-spacing: -0.01em; }
.brand img { width: auto; max-width: 13rem; object-fit: contain; }
.brand-symbol { display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 0.625rem; background: var(--navy); color: #fff; }
.brand-symbol svg { width: 1.5rem; }
.brand-logo-dark { display: none; }
@media (prefers-color-scheme: dark) {
    .brand-logo-light { display: none; }
    .brand-logo-dark { display: block; }
    .brand-symbol { background: var(--accent); color: var(--on-accent); }
}

/* Header */
.site-header { border-bottom: 1px solid var(--line); background: var(--surface); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.5rem; }
.site-nav { display: none; gap: 2rem; font-size: 0.9375rem; font-weight: 500; }
.site-nav a { color: var(--muted); text-decoration: none; }
.site-nav a:hover { color: var(--ink); }
.site-actions { display: flex; align-items: center; gap: 0.5rem; }
.site-actions .btn-signin { display: none; }
@media (min-width: 480px) { .site-actions .btn-signin { display: inline-flex; } }
@media (min-width: 900px) { .site-nav { display: flex; } }

/* Hero */
.hero { padding-block: clamp(2.5rem, 7vw, 6rem) clamp(3rem, 8vw, 6.5rem); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
@media (min-width: 960px) { .hero .wrap { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); } }
.hero h1 {
    max-width: 16ch; font-size: clamp(2.25rem, 1.35rem + 3.9vw, 4.25rem); line-height: 1.04; font-weight: 700; letter-spacing: -0.035em; text-wrap: balance;
}
.hero-lead { max-width: 36rem; margin-top: 1.25rem; font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem); line-height: 1.6; color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }
.hero-note { margin-top: 1rem; font-size: 0.875rem; color: var(--muted); }

/* The one bold element: a solid navy account card listing the apps the account opens. */
.account-card {
    position: relative; overflow: hidden; padding: clamp(1.5rem, 3vw, 2.25rem); border-radius: 1.25rem;
    background: var(--navy-deep); color: #fff;
}
.account-card::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 6px; background: var(--accent); }
.account-card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.account-card-title { font-size: 1.125rem; font-weight: 600; letter-spacing: -0.01em; }
.account-card-badge { flex-shrink: 0; padding: 0.25rem 0.625rem; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 0.8125rem; font-weight: 700; }
.account-card-sub { margin-top: 0.375rem; font-size: 0.9375rem; color: #c7cded; }
.account-apps { list-style: none; margin-top: 1.5rem; border-top: 1px solid rgb(255 255 255 / 0.14); }
.account-apps li { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.875rem 0; border-bottom: 1px solid rgb(255 255 255 / 0.14); font-weight: 500; }
.account-apps li span:last-child { font-size: 0.875rem; font-weight: 400; color: #c7cded; white-space: nowrap; }
.account-app-name { display: inline-flex; align-items: center; gap: 0.75rem; min-width: 0; }
.account-app-name i { flex-shrink: 0; display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 0.5rem; background: rgb(255 255 255 / 0.1); font-style: normal; font-size: 0.875rem; font-weight: 700; }
.account-card-foot { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.5rem; list-style: none; }
.account-card-foot li { padding: 0.375rem 0.75rem; border-radius: 999px; border: 1px solid rgb(255 255 255 / 0.22); font-size: 0.875rem; color: #fff; }

/* Sections */
.section { padding-block: clamp(3rem, 8vw, 6rem); border-top: 1px solid var(--line); }
.section-alt { background: var(--surface); }
.section-head { display: grid; gap: 0.75rem; max-width: 44rem; margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.section h2 { font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.75rem); line-height: 1.12; font-weight: 700; letter-spacing: -0.03em; text-wrap: balance; }
.section-head p { font-size: 1.0625rem; color: var(--muted); }

.features { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; list-style: none; }
@media (min-width: 720px) { .features { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1.5rem, 3vw, 3rem); } }
.features li { padding-top: 1.25rem; border-top: 3px solid var(--navy); }
@media (prefers-color-scheme: dark) { .features li { border-top-color: var(--accent); } }
.feature-icon { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; margin-bottom: 1rem; border-radius: 0.75rem; background: var(--navy-tint); color: var(--navy); }
@media (prefers-color-scheme: dark) { .feature-icon { color: #c7cded; } }
.feature-icon svg { width: 1.375rem; height: 1.375rem; }
.features h3 { font-size: 1.1875rem; font-weight: 650; letter-spacing: -0.015em; }
.features p { margin-top: 0.5rem; color: var(--muted); }

.steps { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; list-style: none; counter-reset: step; }
@media (min-width: 720px) { .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; } }
.steps li { counter-increment: step; display: grid; gap: 0.5rem; align-content: start; padding: 1.5rem; border: 1px solid var(--line); border-radius: 1rem; background: var(--canvas); }
.steps li::before {
    content: counter(step); display: grid; place-items: center; width: 2.25rem; height: 2.25rem; margin-bottom: 0.5rem;
    border-radius: 999px; background: var(--accent); color: var(--on-accent); font-weight: 700;
}
.steps h3 { font-size: 1.125rem; font-weight: 650; }
.steps p { color: var(--muted); }

.apps { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.75rem; list-style: none; }
@media (min-width: 560px) { .apps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 960px) { .apps { grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); } }
.apps li { display: flex; align-items: center; gap: 0.875rem; min-width: 0; padding: 1rem 1.125rem; border: 1px solid var(--line); border-radius: 0.875rem; background: var(--surface); }
.app-mark { flex-shrink: 0; display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 0.625rem; background: var(--navy-tint); color: var(--navy); font-weight: 700; overflow: hidden; }
@media (prefers-color-scheme: dark) { .app-mark { color: #c7cded; } }
.app-mark img { width: 100%; height: 100%; object-fit: contain; }
.apps strong { display: block; font-weight: 600; overflow-wrap: anywhere; }
.apps a, .apps small { font-size: 0.875rem; }
.apps small { color: var(--muted); }

.cta-band { padding-block: clamp(3rem, 8vw, 5.5rem); background: var(--navy); color: #fff; }
.cta-band .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem 3rem; }
.cta-band h2 { max-width: 24ch; font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.75rem); line-height: 1.12; font-weight: 700; letter-spacing: -0.03em; }
.cta-band p { margin-top: 0.75rem; color: #e2e5f5; }
.cta-band .actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
@media (prefers-color-scheme: dark) { .cta-band { background: var(--navy-deep); border-block: 1px solid #2d3691; } }

.site-footer { padding-block: 2rem; border-top: 1px solid var(--line); font-size: 0.9375rem; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; }

/* Simple pages: sign-in link, consent, sign-out, notices, errors */
.simple { display: flex; flex-direction: column; min-height: 100dvh; }
.simple-header { padding-block: 1.25rem; border-bottom: 1px solid var(--line); background: var(--surface); }
.simple-main { flex: 1; display: grid; place-items: center; padding: clamp(1.5rem, 5vw, 4rem) 1rem; }
.card {
    width: 100%; max-width: 30rem; padding: clamp(1.5rem, 4vw, 2.25rem); border: 1px solid var(--line); border-radius: 1rem;
    background: var(--surface);
}
.card-wide { max-width: 34rem; }
.card h1 { font-size: clamp(1.5rem, 1.25rem + 1vw, 1.875rem); line-height: 1.2; font-weight: 700; letter-spacing: -0.02em; text-wrap: balance; }
.card > p, .card form > p, .card .lead { margin-top: 0.75rem; color: var(--muted); }
.card .eyebrow-code { display: inline-flex; margin-bottom: 1rem; padding: 0.25rem 0.625rem; border-radius: 999px; background: var(--navy-tint); color: var(--link); font: 700 0.875rem/1.4 var(--mono); }
.status-chip { display: inline-flex; align-items: center; gap: 0.375rem; margin-bottom: 0.75rem; font-size: 0.875rem; font-weight: 600; }
.status-chip::before { content: ''; width: 0.5rem; height: 0.5rem; border-radius: 999px; background: currentColor; }
.status-chip[data-tone='warning'] { color: var(--warning); }
.status-chip[data-tone='danger'] { color: var(--danger); }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }
.actions form { margin: 0; }
.field { display: grid; gap: 0.375rem; margin-top: 1.25rem; }
.field label { font-size: 0.9375rem; font-weight: 500; }
.field .hint { font-size: 0.875rem; color: var(--muted); }
.input {
    width: 100%; min-height: 2.75rem; padding: 0.625rem 0.875rem; border: 1px solid var(--line-strong); border-radius: 0.5rem;
    background: var(--surface); color: var(--ink); font-size: 1rem;
}
.input:hover { border-color: var(--muted); }
.input:focus { outline: 2px solid var(--focus); outline-offset: -1px; border-color: transparent; }
.input-code { font-family: var(--mono); letter-spacing: 0.3em; }
.alert { margin-top: 1rem; padding: 0.75rem 1rem; border-radius: 0.5rem; background: var(--danger-bg); color: var(--danger); font-size: 0.9375rem; }
.scope-list { display: grid; gap: 0.625rem; margin-top: 1.25rem; padding: 1rem 1.125rem; list-style: none; border-radius: 0.75rem; background: var(--canvas); border: 1px solid var(--line); }
.scope-list li { display: flex; gap: 0.625rem; align-items: flex-start; }
.scope-list svg { width: 1.25rem; height: 1.25rem; flex-shrink: 0; margin-top: 0.125rem; color: var(--success); }
.app-identity { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.5rem; }
.app-chip { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 0.625rem; background: var(--brand, var(--navy)); color: #fff; font-weight: 700; }
.app-identity img { height: 2rem; max-width: 10rem; object-fit: contain; }
.meta { margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--line); font-size: 0.9375rem; color: var(--muted); }
.simple-footer { padding: 1.5rem 1rem; text-align: center; font-size: 0.875rem; color: var(--muted); }
