/* ComplyApp — Shared UI primitives
   Used by /signup, /payment, /privacy-policy and (transitively) the
   marketing site, so every public-facing page shares the same design
   tokens, typography, header, footer, buttons, forms and card system. */

:root {
    --ink-900: #0b1220;
    --ink-800: #0f172a;
    --ink-700: #1e293b;
    --ink-500: #475569;
    --ink-400: #64748b;
    --ink-300: #94a3b8;
    --ink-200: #cbd5e1;
    --ink-100: #e2e8f0;
    --ink-50:  #f1f5f9;

    --bg:      #ffffff;
    --bg-alt:  #f8fafc;

    --brand-500: #2563eb;
    --brand-600: #1d4ed8;
    --brand-700: #1e40af;
    --brand-50:  #eff6ff;

    --accent:  #10b981;
    --accent-50: #ecfdf5;
    --danger:  #dc2626;
    --danger-50: #fef2f2;
    --warn:    #d97706;

    --radius-sm: 8px;
    --radius:    14px;
    --radius-lg: 22px;

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
    --shadow:    0 10px 30px -12px rgba(15, 23, 42, .18);
    --shadow-lg: 0 30px 60px -24px rgba(15, 23, 42, .25);

    --maxw: 1160px;
    --maxw-narrow: 820px;
    --maxw-form: 520px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: var(--ink-800);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; display: block; }

a {
    color: var(--brand-600);
    text-decoration: none;
    transition: color .15s ease;
}
a:hover { color: var(--brand-700); }

h1, h2, h3, h4 {
    font-weight: 700;
    color: var(--ink-900);
    line-height: 1.25;
    letter-spacing: -0.01em;
    margin: 0 0 .5em;
}
h1 { font-size: clamp(1.75rem, 3.5vw, 2.4rem); font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.3rem, 2.3vw, 1.6rem); }
h3 { font-size: 1.1rem; }
h4 { font-size: .95rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-700); }

p { margin: 0 0 1em; color: var(--ink-500); }

:focus-visible {
    outline: 3px solid rgba(37, 99, 235, .45);
    outline-offset: 2px;
    border-radius: 6px;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--ink-900);
    color: #fff;
    padding: .75rem 1rem;
    border-radius: 0 0 var(--radius-sm) 0;
    z-index: 999;
}
.skip-link:focus { left: 0; }

.container {
    max-width: var(--maxw);
    margin: 0 auto;
    padding-inline: 1.25rem;
}
.container-narrow { max-width: var(--maxw-narrow); margin: 0 auto; padding-inline: 1.25rem; }

/* ── Brand ── */
.brand {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    color: var(--ink-900);
    font-weight: 700;
    letter-spacing: -0.01em;
}
.brand:hover { color: var(--ink-900); }
.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 36px; height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--brand-500), #6366f1);
    color: #fff;
    flex: 0 0 auto;
}
.brand-text { font-size: 1.05rem; }
.brand-text strong { font-weight: 800; }

/* ── Site header (public pages) ── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(255, 255, 255, .88);
    backdrop-filter: saturate(180%) blur(10px);
    -webkit-backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--ink-100);
}
.nav-wrap {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding-block: .85rem;
}
.nav-wrap .nav-spacer { margin-left: auto; }
.nav-back {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    color: var(--ink-500);
    font-weight: 500;
    font-size: .92rem;
}
.nav-back:hover { color: var(--ink-900); }
.nav-back svg { width: 16px; height: 16px; }

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .72rem 1.15rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: .95rem;
    font-family: inherit;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform .08s ease, background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
    white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.btn-lg { padding: .9rem 1.4rem; font-size: 1rem; }
.btn-block { width: 100%; }

.btn-primary {
    background: var(--brand-600);
    color: #fff;
    box-shadow: 0 6px 20px -8px rgba(37, 99, 235, .55);
}
.btn-primary:hover:not(:disabled) { background: var(--brand-700); color: #fff; }

.btn-ghost {
    background: transparent;
    color: var(--ink-800);
    border-color: var(--ink-200);
}
.btn-ghost:hover:not(:disabled) { background: var(--ink-50); color: var(--ink-900); }

/* ── Cards ── */
.card {
    background: #fff;
    border: 1px solid var(--ink-100);
    border-radius: var(--radius);
    padding: 1.75rem;
    box-shadow: var(--shadow-sm);
}
.card-lg { padding: 2.25rem; border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.card h2:first-child { margin-top: 0; }

/* ── Forms ── */
.field { margin-bottom: 1rem; }
.field label {
    display: block;
    font-size: .85rem;
    font-weight: 600;
    color: var(--ink-700);
    margin-bottom: .35rem;
}
.field .required::after { content: " *"; color: var(--danger); }
.field input,
.field select,
.field textarea {
    width: 100%;
    padding: .65rem .85rem;
    border: 1px solid var(--ink-200);
    border-radius: 10px;
    font-size: .95rem;
    font-family: inherit;
    color: var(--ink-900);
    background: #fff;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.field input::placeholder { color: var(--ink-300); }
.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--brand-500);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}
.field .hint {
    font-size: .78rem;
    color: var(--ink-400);
    margin-top: .35rem;
}
.field-inline {
    display: flex;
    gap: .75rem;
}

/* ── Alerts ── */
.alert {
    padding: .85rem 1rem;
    border-radius: 10px;
    font-size: .92rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    display: none;
}
.alert-error {
    background: var(--danger-50);
    color: var(--danger);
    border-color: #fecaca;
    display: block;
}
.alert-success {
    background: var(--accent-50);
    color: #047857;
    border-color: #a7f3d0;
    display: block;
}

/* ── Page shells ── */
.page-public {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.page-public main { flex: 1; }

.form-page {
    padding-block: clamp(2rem, 5vw, 4rem);
    background:
        radial-gradient(900px 400px at 85% -10%, rgba(37, 99, 235, .08), transparent 60%),
        radial-gradient(700px 350px at -10% 20%, rgba(99, 102, 241, .07), transparent 60%),
        linear-gradient(180deg, #ffffff, var(--bg-alt));
}
.form-page .form-shell {
    max-width: var(--maxw-form);
    margin: 0 auto;
    padding-inline: 1.25rem;
}
.form-page .form-intro {
    text-align: center;
    margin-bottom: 1.75rem;
}
.form-page .form-intro p { margin: 0; }
.eyebrow {
    display: inline-block;
    font-size: .78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--brand-600);
    background: var(--brand-50);
    padding: .3rem .65rem;
    border-radius: 999px;
    margin-bottom: .85rem;
}

/* Success state */
.state-success { text-align: center; padding: 1rem; }
.state-success .emoji { font-size: 2.75rem; margin-bottom: .75rem; }
.state-success h2 { margin-bottom: .35rem; }
.state-success .muted { color: var(--ink-400); font-size: .9rem; }

.secure-line {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    margin-top: 1rem;
    font-size: .82rem;
    color: var(--ink-400);
}
.secure-line svg { width: 14px; height: 14px; }

/* ── Doc page (privacy policy etc.) ── */
.doc-page {
    padding-block: clamp(2rem, 4vw, 3.5rem);
}
.doc-content { max-width: var(--maxw-narrow); margin: 0 auto; padding-inline: 1.25rem; }
.doc-content h1 {
    padding-bottom: .65rem;
    border-bottom: 2px solid var(--ink-100);
    margin-bottom: .5rem;
}
.doc-content h2 { margin-top: 2.25rem; }
.doc-content h3 { margin-top: 1.25rem; }
.doc-content p, .doc-content li { color: var(--ink-700); }
.doc-content ul { padding-left: 1.25rem; margin-bottom: 1em; }
.doc-content li { margin-bottom: .35em; }
.doc-content table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 1.25rem 0;
    border: 1px solid var(--ink-100);
    border-radius: var(--radius);
    overflow: hidden;
    font-size: .95rem;
}
.doc-content th, .doc-content td {
    padding: .7rem .9rem;
    text-align: left;
    border-bottom: 1px solid var(--ink-100);
    vertical-align: top;
}
.doc-content th {
    background: var(--bg-alt);
    font-weight: 600;
    color: var(--ink-800);
    font-size: .88rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.doc-content tr:last-child td { border-bottom: 0; }
.doc-content .effective-date {
    color: var(--ink-400);
    font-style: normal;
    font-size: .92rem;
    margin-bottom: 2rem;
}
.legal-entity-note {
    background: var(--brand-50);
    border: 1px solid #bfdbfe;
    border-radius: var(--radius-sm);
    color: var(--ink-800);
    padding: 1rem 1.1rem;
    margin: 1.25rem 0 2rem;
}
.legal-entity-note strong { color: var(--ink-900); }
.company-facts td:first-child {
    width: 36%;
    font-weight: 600;
    color: var(--ink-800);
}
.contact-list {
    display: grid;
    gap: .75rem;
    margin: 1.25rem 0;
}
.contact-list p {
    margin: 0;
    padding: .85rem 1rem;
    border: 1px solid var(--ink-100);
    border-radius: var(--radius-sm);
    background: var(--bg-alt);
}
.contact-list strong {
    display: block;
    color: var(--ink-900);
    margin-bottom: .15rem;
}

/* ── Site footer ── */
.site-footer {
    background: var(--ink-900);
    color: var(--ink-200);
    padding-top: 2.5rem;
    margin-top: auto;
}
.site-footer a { color: var(--ink-200); }
.site-footer a:hover { color: #fff; }
.site-footer .footer-simple {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: .88rem;
    color: var(--ink-300);
    border-top: 1px solid rgba(255, 255, 255, .08);
    padding-top: 1.25rem;
    margin-top: 1.25rem;
}
.site-footer .footer-legal {
    max-width: var(--maxw);
    margin: 1.25rem auto 0;
    padding: 0 1.25rem;
    color: var(--ink-200);
    font-size: .9rem;
    line-height: 1.6;
}
.site-footer .footer-links {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
}
.site-footer .footer-brand {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.site-footer .brand { color: #fff; }

/* ── Responsive ── */
@media (max-width: 720px) {
    .site-footer .footer-simple { flex-direction: column; text-align: center; }
    .nav-wrap { padding-block: .7rem; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
