/* ============================================
   PIXNUBE — Auth & Public Pages
   Glass dark theme
   ============================================ */

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

:root {
    --ink:        #0d1117;
    --card:       rgba(255,255,255,0.05);
    --border:     rgba(255,255,255,0.09);
    --label:      #f0f4ff;
    --muted:      rgba(255,255,255,0.50);
    --muted2:     rgba(255,255,255,0.25);
    --accent:     #a78bfa;
    --accent-2:   #7c3aed;
    --accent-bg:  rgba(167,139,250,0.15);
    --input-bg:   rgba(255,255,255,0.06);
    --err-bg:     rgba(248,113,113,0.12);
    --err-border: rgba(248,113,113,0.25);
    --err-text:   #fca5a5;
    --ok-bg:      rgba(52,211,153,0.12);
    --ok-border:  rgba(52,211,153,0.25);
    --ok-text:    #6ee7b7;
    --r: 12px;
}

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
    min-height: 100vh;
    background: var(--ink);
    background-image:
        radial-gradient(ellipse 80% 60% at 20% 0%,  rgba(167,139,250,0.16) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 80% 100%, rgba(109,40,217,0.12) 0%, transparent 55%);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
    color: var(--label);
    padding: 24px 16px;
}

/* ── Page layouts ── */
.auth-page {
    min-height: calc(100vh - 48px);
    display: flex;
    align-items: center;
    justify-content: center;
}
.legal-page { max-width: 760px; margin: 0 auto; padding-bottom: 60px; }

/* ── Card ── */
.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 40px 36px;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

/* ── Logo ── */
.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 28px;
}
.auth-logo img { max-height: 48px; max-width: 160px; object-fit: contain; }
.auth-logo-text { font-size: 22px; font-weight: 800; color: var(--label); letter-spacing: -0.5px; }
.auth-logo-text span { color: var(--accent); }

/* ── Headings ── */
.auth-title {
    font-size: 22px; font-weight: 700;
    text-align: center; color: var(--label);
    margin-bottom: 6px;
}
.auth-sub {
    font-size: 14px; text-align: center;
    color: var(--muted); margin-bottom: 28px;
    line-height: 1.5;
}

/* ── Fields ── */
.field { margin-bottom: 16px; }
.field label {
    display: block; font-size: 11px; font-weight: 600;
    color: var(--muted); text-transform: uppercase;
    letter-spacing: .5px; margin-bottom: 7px;
}
.field input, .field textarea, .field select {
    width: 100%;
    padding: 11px 14px;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: var(--r);
    font-size: 14px;
    color: var(--label);
    font-family: inherit;
    transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field textarea:focus, .field select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(167,139,250,0.18);
}
.field input::placeholder, .field textarea::placeholder { color: var(--muted2); }
.field small { display: block; font-size: 11px; color: var(--muted); margin-top: 5px; }
.field textarea { resize: vertical; min-height: 90px; }

/* ── Buttons ── */
.auth-btn {
    display: block; width: 100%; padding: 13px;
    background: linear-gradient(135deg, var(--accent-2), var(--accent));
    color: #fff; border: none; border-radius: var(--r);
    font-size: 15px; font-weight: 600; cursor: pointer;
    transition: opacity .15s, transform .1s;
    text-align: center; text-decoration: none;
    margin-top: 4px;
}
.auth-btn:hover { opacity: .88; }
.auth-btn:active { transform: scale(.98); }

.auth-btn-ghost {
    display: block; width: 100%; padding: 11px;
    background: rgba(255,255,255,0.06);
    color: var(--label); border: 1px solid var(--border);
    border-radius: var(--r); font-size: 14px; font-weight: 500;
    cursor: pointer; text-align: center; text-decoration: none;
    transition: background .15s;
}
.auth-btn-ghost:hover { background: rgba(255,255,255,0.10); }

/* ── Alerts ── */
.auth-alert {
    padding: 11px 14px; border-radius: 10px;
    font-size: 13px; margin-bottom: 18px; text-align: center;
    line-height: 1.5;
}
.auth-alert.error   { background: var(--err-bg); border: 1px solid var(--err-border); color: var(--err-text); }
.auth-alert.success { background: var(--ok-bg);  border: 1px solid var(--ok-border);  color: var(--ok-text); }
.auth-alert.info    { background: var(--accent-bg); border: 1px solid rgba(167,139,250,.30); color: var(--accent); }

/* ── Links / dividers ── */
.auth-divider { font-size: 13px; color: var(--muted); text-align: center; margin: 16px 0; }
.auth-divider a { color: var(--accent); text-decoration: none; font-weight: 600; }
.auth-divider a:hover { text-decoration: underline; }

.auth-link-row {
    display: flex; justify-content: space-between;
    align-items: center; font-size: 13px;
    color: var(--muted); margin-bottom: 18px;
    flex-wrap: wrap; gap: 6px;
}
.auth-link-row a { color: var(--accent); text-decoration: none; font-weight: 600; }

.auth-sep { height: 1px; background: var(--border); margin: 20px 0; }

/* ── Terms row ── */
.terms-row {
    display: flex; gap: 10px; align-items: flex-start;
    font-size: 13px; color: var(--muted); margin-bottom: 20px;
}
.terms-row input[type="checkbox"] { accent-color: var(--accent); margin-top: 2px; flex-shrink: 0; }
.terms-row a { color: var(--accent); }

/* ── Plan pill (register) ── */
.plan-pill {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--accent-bg); border: 1px solid rgba(167,139,250,.30);
    color: var(--accent); border-radius: 999px;
    padding: 6px 14px; font-size: 13px; font-weight: 600;
    margin-bottom: 22px;
}

/* ── Legal page ── */
.legal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 24px 0 20px; border-bottom: 1px solid var(--border);
    margin-bottom: 36px; flex-wrap: wrap; gap: 12px;
}
.legal-header .back {
    font-size: 13px; color: var(--muted); text-decoration: none;
    transition: color .15s;
}
.legal-header .back:hover { color: var(--label); }

.legal-body h1 { font-size: 28px; font-weight: 700; margin-bottom: 8px; }
.legal-body .updated { font-size: 13px; color: var(--muted); margin-bottom: 32px; }
.legal-body h2 { font-size: 16px; font-weight: 600; margin: 28px 0 10px; color: var(--label); }
.legal-body p  { font-size: 14px; line-height: 1.7; color: var(--muted); margin-bottom: 14px; }
.legal-body ul { padding-left: 20px; margin-bottom: 14px; }
.legal-body li { font-size: 14px; line-height: 1.7; color: var(--muted); margin-bottom: 6px; }
.legal-body strong { color: var(--label); }
.legal-body a { color: var(--accent); }

/* ── Guest upload card ── */
.upload-status {
    text-align: center; padding: 12px 16px; border-radius: 10px;
    font-size: 14px; margin-bottom: 18px;
    background: var(--accent-bg); border: 1px solid rgba(167,139,250,.25);
    color: var(--accent);
}

/* ── Legal body: force visible colors even with inline styles from DB ── */
.legal-body,
.legal-body p,
.legal-body li,
.legal-body span,
.legal-body div { color: rgba(255,255,255,0.70) !important; }
.legal-body h1,
.legal-body h2,
.legal-body h3,
.legal-body strong,
.legal-body b { color: rgba(255,255,255,0.92) !important; }
.legal-body a { color: var(--accent) !important; }
.legal-body .highlight,
.legal-body blockquote { background: rgba(167,139,250,0.08) !important; border-color: rgba(167,139,250,0.30) !important; }
.legal-body .section-box { background: rgba(255,255,255,0.04) !important; border-color: rgba(255,255,255,0.10) !important; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }
