@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=DM+Mono:wght@400;500&display=swap');

/* ── CSS Variables ──────────────────────────────────────────── */
:root {
    --ink:          hsl(220, 25%, 4%);
    --ink-soft:     hsl(225, 17%, 12%);
    --ink-muted:    hsl(224, 16%, 22%);

    --grape:        hsl(268, 45%, 44%);
    --violet:       hsl(280, 38%, 51%);
    --fuchsia:      hsl(336, 46%, 54%);
    --ember:        hsl(18, 70%, 56%);
    --amber:        hsl(30, 85%, 56%);

    --text-primary:   #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.6);
    --text-muted:     rgba(255, 255, 255, 0.45);
    --text-faint:     rgba(255, 255, 255, 0.35);

    --border:       rgba(255, 255, 255, 0.08);
    --border-input: rgba(255, 255, 255, 0.15);

    --brand-gradient: linear-gradient(135deg,
        #6B3FA0,
        hsl(280 38% 51%),
        #C0568A,
        #E07040,
        #F09030
    );

    --pill-gradient: linear-gradient(135deg, #6B3FA0, #C0568A);

    --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ── Animations ─────────────────────────────────────────────── */
@keyframes drift {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25%       { transform: translate(30px, -20px) scale(1.05); }
    50%       { transform: translate(-20px, 20px) scale(0.95); }
    75%       { transform: translate(10px, -10px) scale(1.02); }
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── Page Shell ─────────────────────────────────────────────── */
html, body {
    min-height: 100%;
}

body {
    font-family: 'DM Sans', sans-serif;
    background-color: var(--ink);
    min-height: 100vh;
    color: var(--text-secondary);
    position: relative;
    overflow-x: hidden;
}

/* ── Background: Grid overlay ───────────────────────────────── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 60px 60px;
    opacity: 0.03;
    pointer-events: none;
    z-index: 0;
}

/* Upper-right radial glow */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse 600px 600px at 80% 20%, hsl(268 45% 44% / 0.12), transparent);
    pointer-events: none;
    z-index: 0;
}

/* ── Gradient Orbs ──────────────────────────────────────────── */
.orb {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.orb-grape {
    width: 500px;
    height: 500px;
    background: hsl(268 45% 44% / 0.2);
    filter: blur(120px);
    top: -100px;
    left: -120px;
    animation: drift 12s ease-in-out infinite;
}

.orb-ember {
    width: 400px;
    height: 400px;
    background: hsl(18 70% 56% / 0.15);
    filter: blur(100px);
    bottom: -80px;
    right: -80px;
    animation: drift 18s ease-in-out infinite reverse;
}

.orb-fuchsia {
    width: 300px;
    height: 300px;
    background: hsl(336 46% 54% / 0.1);
    filter: blur(80px);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: drift 15s ease-in-out infinite 3s;
}

/* ── Gradient text utility ──────────────────────────────────── */
.gradient-text {
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ══════════════════════════════════════════════════════════════
   SIGNUP PAGE — TWO-COLUMN LAYOUT
   ══════════════════════════════════════════════════════════════ */

.signup-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    animation: fadeIn 0.4s ease both;
}

/* Left column — hero */
.hero-col {
    display: flex;
    flex-direction: column;
    padding: 72px 56px 72px 72px;
    position: relative;
}

.hero-col .brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: auto;
}

.hero-col .brand-wordmark {
    font-family: 'Syne', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.2px;
    line-height: 1;
}

.hero-headline {
    margin-top: 80px;
    margin-bottom: 20px;
}

.hero-headline h1 {
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    font-size: clamp(52px, 6vw, 80px);
    line-height: 1.0;
    letter-spacing: -2px;
    color: var(--text-primary);
}

.hero-tagline {
    font-family: 'DM Sans', sans-serif;
    font-weight: 300;
    font-size: 17px;
    color: rgba(255, 255, 255, 0.45);
    line-height: 1.65;
    max-width: 340px;
}

/* Ambient constellation watermark */
.hero-watermark {
    position: absolute;
    bottom: 48px;
    left: 40px;
    opacity: 0.06;
    pointer-events: none;
}

/* Right column — form */
.form-col {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 120px 72px 72px 56px;
    animation: fadeUp 0.55s var(--ease-spring) 0.1s both;
}

/* ══════════════════════════════════════════════════════════════
   SINGLE-COLUMN PAGES (preferences, unsubscribe)
   ══════════════════════════════════════════════════════════════ */

.single-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 72px 24px 80px;
    animation: fadeIn 0.4s ease both;
}

.single-card {
    width: 100%;
    max-width: 520px;
    animation: fadeUp 0.5s var(--ease-spring) both;
}

.single-card .brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}

.single-card .brand-wordmark {
    font-family: 'Syne', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.2px;
}

/* ── Page heading (preferences, unsubscribe) ────────────────── */
.page-heading {
    font-family: 'Syne', sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}

.page-subtext {
    font-family: 'DM Sans', sans-serif;
    font-weight: 300;
    font-size: 15px;
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: 32px;
    line-height: 1.6;
}

/* ── Email chip (preferences) ───────────────────────────────── */
.email-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 9999px;
    font-family: 'DM Mono', monospace;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 36px;
    letter-spacing: 0.02em;
}

/* ── Section Labels ─────────────────────────────────────────── */
.section-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: hsl(268 45% 64%);
}

.section-label::before {
    content: '';
    display: block;
    width: 24px;
    height: 1px;
    background: hsl(268 45% 44% / 0.4);
    flex-shrink: 0;
}

/* ── Categories header row ──────────────────────────────────── */
.categories-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.categories-header .section-label {
    margin-bottom: 0;
}

/* ── Field Labels (name/email inputs) ───────────────────────── */
label.field-label {
    display: block;
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.35);
    margin-bottom: 10px;
}

/* ── Form group spacing ─────────────────────────────────────── */
.field-group {
    margin-bottom: 32px;
}

/* ── Inputs ─────────────────────────────────────────────────── */
input[type="text"],
input[type="email"] {
    width: 100%;
    padding: 10px 0;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 0;
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    color: var(--text-primary);
    background: transparent;
    outline: none;
    transition: border-color 300ms var(--ease-spring), box-shadow 300ms var(--ease-spring);
}

input[type="text"]::placeholder,
input[type="email"]::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

input[type="text"]:focus,
input[type="email"]:focus {
    border-bottom-color: hsl(268 45% 44%);
    box-shadow: 0 1px 0 0 hsl(268 45% 44%), 0 4px 12px hsl(268 45% 44% / 0.15);
}

/* ── Pill chip chips ────────────────────────────────────────── */
.chip-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 32px;
}

.chip {
    display: inline-flex;
    align-items: center;
    padding: 7px 16px;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    user-select: none;
    transition: border-color 200ms ease, background 200ms ease, color 200ms ease;
    position: relative;
    background: transparent;
}

.chip input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.chip:hover {
    border-color: rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.85);
}

.chip.selected {
    background: var(--pill-gradient);
    border-color: transparent;
    color: #ffffff;
}

/* ── Select all toggle ──────────────────────────────────────── */
.select-toggle {
    background: none;
    border: none;
    padding: 0;
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: color 200ms ease;
    text-decoration: none;
}

.select-toggle:hover {
    color: rgba(255, 255, 255, 0.7);
}

/* ── Submit Button (gradient pill — "Start a Conversation" match) */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: #ffffff;
    background: var(--brand-gradient);
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    box-shadow: 0 4px 20px hsl(268 45% 44% / 0.3);
    transition: all 300ms var(--ease-spring);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 6px 28px hsl(268 45% 44% / 0.45);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 4px 20px hsl(268 45% 44% / 0.3);
}

/* ── Outlined pill — destructive actions ────────────────────── */
.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 28px;
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 9999px;
    cursor: pointer;
    transition: all 300ms var(--ease-spring);
    text-decoration: none;
    white-space: nowrap;
}

.btn-outline:hover {
    color: rgba(255, 255, 255, 0.85);
    border-color: rgba(255, 255, 255, 0.85);
}

.btn-sm {
    padding: 10px 22px;
    font-size: 14px;
}

/* ── Button row ─────────────────────────────────────────────── */
.btn-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

/* ── Messages ───────────────────────────────────────────────── */
.message {
    padding: 14px 18px;
    border-radius: 4px;
    margin-bottom: 28px;
    font-size: 14px;
    line-height: 1.6;
}

.message-success {
    background: rgba(34, 197, 94, 0.08);
    border-left: 2px solid rgba(34, 197, 94, 0.7);
    color: rgba(255, 255, 255, 0.8);
}

.message-error {
    background: rgba(239, 68, 68, 0.08);
    border-left: 2px solid rgba(239, 68, 68, 0.7);
    color: rgba(255, 255, 255, 0.8);
}

.message-info {
    background: rgba(107, 63, 160, 0.08);
    border-left: 2px solid hsl(268 45% 44% / 0.7);
    color: rgba(255, 255, 255, 0.8);
}

.message strong {
    color: var(--text-primary);
    font-weight: 600;
}

.message a {
    color: hsl(268 45% 70%);
    text-decoration: none;
}

.message a:hover {
    text-decoration: underline;
}

/* ── Footer ─────────────────────────────────────────────────── */
.footer {
    margin-top: 48px;
    text-align: center;
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.3);
}

.footer a {
    color: rgba(255, 255, 255, 0.3);
    text-decoration: none;
    transition: color 150ms ease;
}

.footer a:hover {
    color: rgba(255, 255, 255, 0.7);
}

.footer-sep {
    margin: 0 8px;
    opacity: 0.4;
}

/* ── Unsubscribe confirm ────────────────────────────────────── */
.unsub-confirm {
    text-align: center;
    padding: 24px 0;
}

.unsub-confirm p {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    line-height: 1.65;
}

.unsub-confirm .email-highlight {
    font-family: 'DM Mono', monospace;
    font-size: 14px;
    color: var(--text-primary);
}

.unsub-confirm .fine-print {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.35);
    margin-bottom: 28px;
}

.resubscribe-link {
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    color: hsl(268 45% 64%);
    text-decoration: none;
    transition: color 150ms ease;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.resubscribe-link:hover {
    color: hsl(268 45% 80%);
}

/* ── Unsubscribe footer links ───────────────────────────────── */
.unsub-footer-links {
    margin-top: 20px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.3);
}

.unsub-footer-links a {
    color: rgba(255, 255, 255, 0.3);
    text-decoration: none;
    transition: color 150ms ease;
}

.unsub-footer-links a:hover {
    color: rgba(255, 255, 255, 0.65);
}

/* ── Responsive: collapse two-column on narrow viewports ────── */
@media (max-width: 900px) {
    .signup-shell {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .hero-col {
        padding: 48px 32px 40px;
        flex-direction: column;
    }

    .hero-col .brand {
        margin-bottom: 0;
    }

    .hero-headline {
        margin-top: 48px;
    }

    .hero-watermark {
        display: none;
    }

    .form-col {
        padding: 40px 32px 64px;
    }
}

@media (max-width: 480px) {
    .hero-col {
        padding: 36px 24px 28px;
    }

    .form-col {
        padding: 32px 24px 56px;
    }

    .single-shell {
        padding: 48px 20px 64px;
    }

    .hero-headline h1 {
        font-size: 46px;
    }
}
