/* ============================================================
   Vibrancy Music — Auth page CSS
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #0a0a0a;
    --bg-2: #101010;
    --bg-3: #161616;
    --text: #e8e8e8;
    --text-dim: #a0a0a0;
    --muted: #6a6a6a;
    --accent: #ff2e2e;
    --accent-hover: #ff4d4d;
    --border: #242424;
    --border-strong: #3a3a3a;
    --font-display: 'Oswald', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

html, body { height: 100%; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.035;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* ---------- LAYOUT ---------- */
.auth-layout {
    display: grid;
    grid-template-columns: 1fr;
    min-height: 100vh;
}
@media (min-width: 1024px) {
    .auth-layout { grid-template-columns: 55fr 45fr; }
}

/* ---------- POSTER ---------- */
.poster {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 32px;
    padding: clamp(24px, 4vw, 56px);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    overflow: hidden;
    min-height: 220px;
}
@media (min-width: 1024px) {
    .poster { border-bottom: none; border-right: 1px solid var(--border); min-height: auto; }
}

.poster::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--border) 1px, transparent 1px),
        linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 80px 80px;
    opacity: 0.35;
    mask-image: radial-gradient(ellipse at 40% 50%, black 10%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at 40% 50%, black 10%, transparent 70%);
    pointer-events: none;
}
.poster > * { position: relative; z-index: 1; }

.poster-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.poster-logo img {
    height: 44px;
    width: auto;
    filter: brightness(0) invert(1);
}
.poster-tag {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--muted);
    letter-spacing: 0.25em;
    text-transform: uppercase;
    white-space: nowrap;
}

.poster-main h1 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.4rem, 6vw, 5.5rem);
    line-height: 0.92;
    text-transform: uppercase;
    letter-spacing: -0.01em;
    margin-bottom: 20px;
}
.poster-main h1 .accent { color: var(--accent); display: block; }
.poster-main p {
    font-size: clamp(0.9rem, 1.2vw, 1rem);
    color: var(--text-dim);
    max-width: 480px;
}

.poster-foot {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--muted);
    letter-spacing: 0.15em;
    text-transform: uppercase;
}
.poster-foot strong { color: var(--text); font-weight: 600; }

/* ---------- FORM PANE ---------- */
.form-pane {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(24px, 4vw, 56px);
    background: var(--bg-2);
}
.form-wrap { width: 100%; max-width: 420px; }

.form-head { margin-bottom: 32px; }
.form-head-label {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--accent);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 12px;
}
.form-head h2 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.75rem;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* Tabs */
.auth-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    margin-bottom: 28px;
}
.auth-tab {
    flex: 1;
    padding: 14px 8px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.2s, border-color 0.2s;
}
.auth-tab.active { color: var(--text); border-bottom-color: var(--accent); }
.auth-tab:hover:not(.active) { color: var(--text-dim); }

/* Forms */
.auth-form { display: none; flex-direction: column; gap: 18px; }
.auth-form.active { display: flex; }

.form-field { display: flex; flex-direction: column; gap: 8px; }
.form-field label,
.form-field .form-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--muted);
    letter-spacing: 0.18em;
    text-transform: uppercase;
}
.form-field input {
    width: 100%;
    padding: 13px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: border-color 0.2s, background 0.2s;
}
.form-field input:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--bg-3);
}
.form-field input::placeholder { color: var(--muted); }

/* ---------- Plan picker ---------- */
.plan-picker {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    background: var(--bg);
}

.plan-option {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.plan-option:last-child { border-bottom: none; }
.plan-option:hover { background: var(--bg-3); }
.plan-option.is-selected { background: var(--bg-3); }

.plan-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.plan-radio {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    border: 1px solid var(--border-strong);
    border-radius: 50%;
    display: grid;
    place-items: center;
    transition: border-color 0.15s;
}
.plan-radio::after {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    transform: scale(0);
    transition: transform 0.15s;
}
.plan-option.is-selected .plan-radio { border-color: var(--accent); }
.plan-option.is-selected .plan-radio::after { transform: scale(1); }

.plan-body {
    flex: 1;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
}
.plan-name {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.92rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-dim);
    transition: color 0.15s;
}
.plan-option.is-selected .plan-name { color: var(--text); }

.plan-tag {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 2px 6px;
    background: var(--accent);
    color: #0a0a0a;
    font-weight: 700;
    line-height: 1.4;
}
.plan-option.is-selected .plan-tag { opacity: 1; }
.plan-option:not(.is-selected) .plan-tag { opacity: 0.5; }

.plan-price {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--muted);
    white-space: nowrap;
    transition: color 0.15s;
}
.plan-price small {
    font-size: 0.68rem;
    color: var(--muted);
    margin-left: 2px;
}
.plan-option.is-selected .plan-price { color: var(--text); }
.plan-option.is-selected .plan-price small { color: var(--accent); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    border: 1px solid transparent;
    transition: all 0.2s;
}
.btn-primary {
    background: var(--accent);
    color: #0a0a0a;
    border-color: var(--accent);
}
.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    transform: translate(-2px, -2px);
    box-shadow: 4px 4px 0 rgba(255, 46, 46, 0.25);
}
.btn-block { width: 100%; }

/* ---------- Errors ---------- */
.errors {
    padding: 14px 16px;
    margin-bottom: 4px;
    background: rgba(255, 46, 46, 0.08);
    border: 1px solid rgba(255, 46, 46, 0.4);
    color: #ff8f8f;
    font-size: 0.88rem;
    line-height: 1.5;
}
.errors ul { padding-left: 18px; }
.errors li { margin: 2px 0; }

/* ---------- Extra links ---------- */
.form-extra {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--muted);
    letter-spacing: 0.05em;
}
.form-extra a { color: var(--text-dim); transition: color 0.2s; }
.form-extra a:hover { color: var(--accent); }
/* ---------- Consent checkbox ---------- */
.form-consent { margin-top: 4px; }

.consent-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--text-dim);
}

.consent-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.consent-checkbox {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 2px;
    border: 1px solid var(--border-strong);
    background: var(--bg);
    position: relative;
    transition: border-color 0.15s, background 0.15s;
}

.consent-label input[type="checkbox"]:checked + .consent-checkbox {
    border-color: var(--accent);
    background: var(--accent);
}

.consent-label input[type="checkbox"]:checked + .consent-checkbox::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 1px;
    width: 5px;
    height: 10px;
    border: solid #0a0a0a;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.consent-label input[type="checkbox"]:focus-visible + .consent-checkbox {
    outline: 1px solid var(--accent);
    outline-offset: 2px;
}

.consent-text a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.consent-text a:hover { color: var(--accent-hover); }