/* NewsVid Studio — Auth Pages (Dark + Light) */

html[data-theme="light"] {
    --auth-bg: #ffffff;
    --auth-panel: #fdf2f4;
    --auth-card: #ffffff;
    --auth-card-soft: #fafafa;
    --auth-border: #e5e7eb;
    --auth-text: #111827;
    --auth-muted: #6b7280;
    --auth-feature-bg: #fff5f7;
    --auth-feature-border: #fecdd3;
    --auth-error-bg: #fef2f2;
    --auth-error-border: #fecaca;
    --auth-error-text: #b91c1c;
    --auth-brand-pattern: %23000000;
}

html[data-theme="dark"] {
    --auth-bg: #0b0f1a;
    --auth-panel: #111827;
    --auth-card: #151c2c;
    --auth-card-soft: #1b2337;
    --auth-border: #253049;
    --auth-text: #eef2ff;
    --auth-muted: #9aa5c0;
    --auth-feature-bg: rgba(225, 29, 72, 0.12);
    --auth-feature-border: rgba(225, 29, 72, 0.28);
    --auth-error-bg: rgba(239, 68, 68, 0.12);
    --auth-error-border: rgba(239, 68, 68, 0.35);
    --auth-error-text: #fca5a5;
    --auth-brand-pattern: %23ffffff;
}

:root {
    --auth-accent: #e11d48;
    --auth-accent-hover: #be123c;
    --auth-accent-glow: rgba(225, 29, 72, 0.2);
    --auth-success: #16a34a;
    --auth-fail: #dc2626;
    --auth-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --auth-radius: 14px;
}

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

html, body {
    height: 100%;
    font-family: var(--auth-font);
    background: var(--auth-bg);
    color: var(--auth-text);
}

.auth-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr auto;
}

.auth-page .footer {
    grid-column: 1 / -1;
    text-align: center;
    padding: 18px 16px 22px;
    color: var(--auth-muted, #6b7280);
    font-size: 0.82rem;
    border-top: 1px solid var(--auth-border);
    background: var(--auth-bg);
}

.auth-page .footer p {
    margin: 0;
}

/* ---------- Left branding panel ---------- */
.auth-brand {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(32px, 5vw, 72px);
    background:
        radial-gradient(ellipse 80% 60% at 20% 40%, rgba(225, 29, 72, 0.08), transparent 60%),
        radial-gradient(ellipse 60% 50% at 80% 80%, rgba(99, 102, 241, 0.06), transparent 55%),
        var(--auth-panel);
    border-right: 1px solid var(--auth-border);
    overflow: hidden;
}

.auth-brand::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23000000' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.auth-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 48px;
    position: relative;
    z-index: 1;
}

.auth-logo-mark {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--auth-accent), #7c3aed);
    display: grid;
    place-items: center;
    font-size: 1.1rem;
    color: #fff;
    box-shadow: 0 8px 24px var(--auth-accent-glow);
}

.auth-logo-text {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.auth-logo-text em {
    font-style: normal;
    color: var(--auth-accent);
}

.auth-headline {
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}

.auth-subline {
    font-size: 1.05rem;
    color: var(--auth-muted);
    line-height: 1.6;
    max-width: 420px;
    margin-bottom: 40px;
    position: relative;
    z-index: 1;
}

.auth-features {
    display: flex;
    flex-direction: column;
    gap: 18px;
    position: relative;
    z-index: 1;
}

.auth-feature {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--auth-muted);
    font-size: 0.95rem;
}

.auth-feature-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--auth-feature-bg);
    border: 1px solid var(--auth-feature-border);
    display: grid;
    place-items: center;
    color: var(--auth-accent);
    font-size: 0.95rem;
    flex-shrink: 0;
}

.auth-stats {
    display: flex;
    gap: 32px;
    margin-top: 48px;
    position: relative;
    z-index: 1;
}

.auth-stat strong {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--auth-accent);
}

.auth-stat span {
    font-size: 0.8rem;
    color: var(--auth-muted);
}

/* ---------- Right form panel ---------- */
.auth-form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(24px, 4vw, 48px);
    background: var(--auth-bg);
}

.auth-form-wrap {
    width: 100%;
    max-width: 420px;
}

.auth-form-title {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.auth-form-sub {
    color: var(--auth-muted);
    font-size: 0.92rem;
    margin-bottom: 32px;
}

.auth-field {
    margin-bottom: 20px;
}

.auth-field label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--auth-text);
}

.auth-forgot-link {
    display: inline-block;
    margin-top: 10px;
    color: var(--auth-accent);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.82rem;
}

.auth-forgot-link:hover { text-decoration: underline; }

.auth-input-wrap {
    position: relative;
}

.auth-input-wrap i.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--auth-muted);
    font-size: 0.9rem;
    pointer-events: none;
}

.auth-input-wrap input {
    width: 100%;
    padding: 14px 44px 14px 42px;
    border-radius: var(--auth-radius);
    border: 1px solid var(--auth-border);
    background: var(--auth-card);
    color: var(--auth-text);
    font-family: var(--auth-font);
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-input-wrap input::placeholder { color: var(--auth-muted); }

.auth-input-wrap input:focus {
    outline: none;
    border-color: var(--auth-accent);
    box-shadow: 0 0 0 3px var(--auth-accent-glow);
}

.auth-toggle-pw {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--auth-muted);
    cursor: pointer;
    padding: 4px;
    font-size: 0.9rem;
}

.auth-toggle-pw:hover { color: var(--auth-text); }

/* Password rules */
.auth-pw-rules {
    margin-top: 12px;
    padding: 14px 16px;
    border-radius: var(--auth-radius);
    background: var(--auth-card-soft);
    border: 1px solid var(--auth-border);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.auth-pw-rules.is-hidden {
    display: none;
}

.auth-pw-rules-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.86rem;
    font-weight: 600;
}

.auth-pw-rules-head.pass { color: var(--auth-success); }
.auth-pw-rules-head.fail { color: var(--auth-fail); }

.auth-pw-rule {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.84rem;
    transition: color 0.2s;
}

.auth-pw-rule-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.auth-pw-hint {
    font-size: 0.78rem;
    color: var(--auth-muted);
    line-height: 1.4;
}

.auth-pw-rule i {
    width: 16px;
    margin-top: 2px;
    text-align: center;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.auth-pw-rule.pass { color: var(--auth-success); }
.auth-pw-rule.fail { color: var(--auth-fail); }

.auth-confirm-hint {
    margin-top: 8px;
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-confirm-hint.pass { color: var(--auth-success); }
.auth-confirm-hint.fail { color: var(--auth-fail); }

.auth-checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 24px;
    font-size: 0.86rem;
    color: var(--auth-muted);
    line-height: 1.5;
}

.auth-checkbox-row input {
    margin-top: 3px;
    accent-color: var(--auth-accent);
}

.auth-checkbox-row a {
    color: var(--auth-accent);
    text-decoration: none;
}

.auth-checkbox-row a:hover { text-decoration: underline; }

.auth-btn {
    width: 100%;
    padding: 15px 24px;
    border: none;
    border-radius: var(--auth-radius);
    background: var(--auth-accent);
    color: #fff;
    font-family: var(--auth-font);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 8px 28px var(--auth-accent-glow);
}

.auth-btn:hover:not(:disabled) {
    background: var(--auth-accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 12px 32px var(--auth-accent-glow);
}

.auth-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-switch {
    text-align: center;
    margin-top: 28px;
    font-size: 0.9rem;
    color: var(--auth-muted);
}

.auth-switch a {
    color: var(--auth-accent);
    font-weight: 600;
    text-decoration: none;
}

.auth-switch a:hover { text-decoration: underline; }

.auth-legal {
    text-align: center;
    margin-top: 24px;
    font-size: 0.78rem;
    color: var(--auth-muted);
    line-height: 1.5;
}

.auth-error {
    padding: 12px 16px;
    border-radius: var(--auth-radius);
    background: var(--auth-error-bg);
    border: 1px solid var(--auth-error-border);
    color: var(--auth-error-text);
    font-size: 0.88rem;
    margin-bottom: 20px;
    display: none;
}

.auth-error.show { display: block; }

.auth-success {
    padding: 12px 16px;
    border-radius: var(--auth-radius);
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #15803d;
    font-size: 0.88rem;
    margin-bottom: 20px;
    display: none;
}

.auth-success.show { display: block; }

html[data-theme="dark"] .auth-success {
    background: rgba(22, 163, 74, 0.14);
    border-color: rgba(22, 163, 74, 0.35);
    color: #86efac;
}

.auth-theme-toggle {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 100;
}

.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--auth-border);
    background: var(--auth-card);
    color: var(--auth-text);
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: 1rem;
    transition: border-color 0.2s, transform 0.2s;
}

.theme-toggle:hover {
    border-color: var(--auth-accent);
    color: var(--auth-accent);
    transform: rotate(15deg);
}

html[data-theme="dark"] .theme-icon-dark { display: none; }
html[data-theme="light"] .theme-icon-light { display: none; }

html[data-theme="dark"] .auth-brand::before {
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

html, body {
    transition: background 0.3s ease, color 0.3s ease;
}

.auth-loading {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .auth-page { grid-template-columns: 1fr; }
    .auth-brand {
        border-right: none;
        border-bottom: 1px solid var(--auth-border);
        padding: 32px 24px;
    }
    .auth-headline { font-size: 1.75rem; }
    .auth-features, .auth-stats { display: none; }
    .auth-brand { min-height: auto; }
}
