/*
  Shared chrome for public/*.html (issue #244).

  Legal pages (privacy, terms, support, delete-account):
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link href="https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600&family=DM+Serif+Display&display=swap" rel="stylesheet">
    <link rel="stylesheet" href="/site.css">
    <body class="legal">
    Canonical header:
      <nav class="nav" aria-label="Site">
        <span class="brand">Conflux</span>
        <a href="/privacy">Privacy Policy</a>
        <a href="/terms">Terms of Service</a>
        <a href="/support">Support</a>
      </nav>
    delete-account.html swaps the Support link for Delete Account.

  Status pages (extension-auth, calendar-callback, checkout-complete):
    <link rel="stylesheet" href="/site.css">
    <body class="status extension-auth|calendar-callback|checkout-complete">
    Page-specific layout stays in the HTML; this file only shares tokens and chrome.
    extension-auth.html script behaviour is unchanged.
*/

:root {
    --bg: #0a0a0f;
    --surface: #12121a;
    --border: #1e1e2e;
    --text: #e0e0e8;
    --text-muted: #8888a0;
    --accent: #6C63FF;
    --accent-hover: #7b73ff;
    --accent-dim: rgba(108, 99, 255, 0.15);
    --danger: #ff4757;
    --danger-dim: rgba(255, 71, 87, 0.12);
    --success: #4ade80;
    --success-dim: rgba(74, 222, 128, 0.15);
    --error: #f87171;
    --input-bg: #0e0e16;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ── Legal pages ── */

body.legal {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

body.legal .container {
    max-width: 720px;
    margin: 0 auto;
    padding: 60px 24px 80px;
}

body.legal .nav {
    display: flex;
    gap: 24px;
    margin-bottom: 48px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

body.legal .nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
}

body.legal .nav a:hover,
body.legal .nav a.active {
    color: var(--accent);
}

body.legal .nav .brand {
    color: var(--text);
    font-family: 'DM Serif Display', serif;
    font-size: 18px;
    margin-right: auto;
}

body.legal h1 {
    font-family: 'DM Serif Display', serif;
    font-size: 36px;
    font-weight: 400;
    margin-bottom: 8px;
    color: #fff;
}

body.legal .effective-date,
body.legal .subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 48px;
}

body.legal .subtitle {
    font-size: 15px;
    margin-bottom: 40px;
}

body.legal h2 {
    font-family: 'DM Serif Display', serif;
    font-size: 22px;
    font-weight: 400;
    color: #fff;
    margin-top: 40px;
    margin-bottom: 16px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

body.legal h2:first-of-type {
    border-top: none;
    padding-top: 0;
}

body.legal p {
    margin-bottom: 16px;
    color: var(--text);
    font-size: 15px;
}

body.legal ul,
body.legal ol {
    margin-bottom: 16px;
    padding-left: 24px;
}

body.legal li {
    margin-bottom: 8px;
    font-size: 15px;
    color: var(--text);
}

body.legal .highlight-box,
body.legal .info-box {
    background: var(--accent-dim);
    border-left: 3px solid var(--accent);
    padding: 16px 20px;
    border-radius: 0 8px 8px 0;
    margin: 24px 0;
}

body.legal .highlight-box p,
body.legal .info-box p,
body.legal .warning-box p {
    margin-bottom: 0;
    font-size: 14px;
}

body.legal .warning-box {
    background: var(--danger-dim);
    border-left: 3px solid var(--danger);
    padding: 16px 20px;
    border-radius: 0 8px 8px 0;
    margin: 24px 0;
}

body.legal .footer {
    margin-top: 60px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
}

body.legal .steps {
    margin: 24px 0;
}

body.legal .step {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

body.legal .step-number {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: var(--accent-dim);
    color: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

body.legal .step-content {
    padding-top: 4px;
}

body.legal .step-content strong {
    color: #fff;
}

body.legal .email-link {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: 14px 28px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    margin: 24px 0;
    transition: opacity 0.2s;
}

body.legal .email-link:hover {
    opacity: 0.9;
    text-decoration: none;
}

body.delete-account h2 {
    padding-top: 0;
    border-top: none;
}

@media (max-width: 600px) {
    body.legal .container { padding: 40px 20px 60px; }
    body.legal h1 { font-size: 28px; }
}

/* ── Status / card pages ── */

body.status {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-font-smoothing: antialiased;
}

body.status .card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 48px;
    max-width: 420px;
    width: 90%;
    text-align: center;
}

body.status .icon {
    font-size: 48px;
    margin-bottom: 16px;
}

body.status h1 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
}

body.status p {
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.6;
}

body.status .success .icon,
body.status .success h1 {
    color: var(--success);
}

body.status a {
    font-weight: 500;
}

body.status .btn {
    display: inline-block;
    margin-top: 24px;
    padding: 12px 28px;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
}

/* extension-auth: error chrome uses accent, not the error red */
body.extension-auth .error .icon {
    color: var(--accent);
}

body.calendar-callback .error .icon,
body.calendar-callback .error h1 {
    color: var(--error);
}

body.extension-auth .spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

body.extension-auth .login-form {
    text-align: left;
    margin-top: 24px;
}

body.extension-auth .login-form label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 6px;
}

body.extension-auth .login-form input {
    width: 100%;
    padding: 12px 14px;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-size: 15px;
    outline: none;
    margin-bottom: 16px;
    font-family: inherit;
}

body.extension-auth .login-form input:focus {
    border-color: var(--accent);
}

body.extension-auth .login-form input::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

body.extension-auth .login-btn {
    width: 100%;
    padding: 12px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}

body.extension-auth .login-btn:hover {
    background: var(--accent-hover);
}

body.extension-auth .login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

body.extension-auth .error-msg {
    color: var(--error);
    font-size: 13px;
    margin-bottom: 12px;
    display: none;
    text-align: center;
}

body.extension-auth .signup-link {
    margin-top: 20px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

body.extension-auth #loading { display: block; }
body.extension-auth #success { display: none; }
body.extension-auth #login-section { display: none; }
body.extension-auth #connect-section { display: none; }
body.extension-auth #no-extension { display: none; }
body.extension-auth #rejected { display: none; }

body.checkout-complete .icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-size: 28px;
    background: rgba(74, 222, 128, 0.12);
    color: var(--success);
}

body.checkout-complete .icon.error {
    background: rgba(248, 113, 113, 0.12);
    color: var(--error);
}

body.checkout-complete h1 {
    font-size: 22px;
    margin-bottom: 8px;
}

body.checkout-complete p {
    line-height: 1.5;
}

body.checkout-complete .plan {
    color: var(--text);
    font-weight: 600;
}

body.checkout-complete .actions {
    margin-top: 28px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

body.checkout-complete a.btn {
    display: block;
    margin-top: 0;
    padding: 12px 18px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
}

body.checkout-complete a.primary {
    background: var(--accent);
    color: #fff;
}

body.checkout-complete a.secondary {
    border: 1px solid var(--border);
    color: var(--text);
    background: transparent;
}

body.checkout-complete .note {
    margin-top: 18px;
    font-size: 12px;
    color: var(--text-muted);
}
