/* VideoLab Auth — Auth Pages (Login, Register, Consent, Verify)
   Shares design tokens with admin.css */

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

:root {
    --bg: #09090b;
    --surface: #111113;
    --surface-2: #18181b;
    --border: #27272a;
    --border-hover: #3f3f46;
    --text: #fafafa;
    --text-muted: #a1a1aa;
    --text-dim: #71717a;
    --primary: #6366f1;
    --primary-hover: #818cf8;
    --danger: #ef4444;
    --danger-bg: rgba(239,68,68,.08);
    --success: #22c55e;
    --success-bg: rgba(34,197,94,.08);
    --radius: 8px;
    --radius-sm: 4px;
    --ease: cubic-bezier(.4,0,.2,1);
    --duration: 150ms;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

main {
    width: 100%;
    padding: 1rem;
}

/* === AUTH LAYOUT === */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80dvh;
}

.auth-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
}

.auth-card h1 {
    font-size: 1.375rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    text-align: center;
    letter-spacing: -.01em;
}

/* === FORM FIELDS === */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: .8125rem;
    color: var(--text-muted);
    margin-bottom: .25rem;
    font-weight: 500;
}

.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="text"] {
    width: 100%;
    padding: .5rem .75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: .875rem;
    font-family: inherit;
    min-height: 40px;
    transition: border-color var(--duration) var(--ease);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group input:disabled {
    opacity: .5;
    cursor: not-allowed;
}

/* === CUSTOM CHECKBOX === */
.auth-checkbox {
    display: flex;
    align-items: center;
    gap: .625rem;
    cursor: pointer;
    color: var(--text);
    font-size: .8125rem;
    margin-bottom: .75rem;
    -webkit-user-select: none;
    user-select: none;
}
.auth-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}
.auth-checkbox .check {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--duration) var(--ease);
    background: transparent;
}
.auth-checkbox input:checked + .check {
    background: var(--primary);
    border-color: var(--primary);
}
.auth-checkbox .check svg {
    width: 12px;
    height: 12px;
    stroke: #fff;
    stroke-width: 3;
    fill: none;
    opacity: 0;
    transition: opacity var(--duration) var(--ease);
}
.auth-checkbox input:checked + .check svg { opacity: 1; }

/* === FORM ROWS === */
.form-row {
    display: flex;
    gap: .75rem;
}
.form-row .form-group { flex: 1; }

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .5rem 1.25rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: .875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    text-decoration: none;
    min-height: 40px;
}
.btn:active { transform: scale(.97); }

.btn-primary {
    background: var(--primary);
    color: white;
    width: 100%;
    margin-top: .5rem;
}
.btn-primary:hover { background: var(--primary-hover); }

.btn-external {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    width: 100%;
    margin-bottom: .5rem;
    min-height: 40px;
}
.btn-external:hover { border-color: var(--border-hover); background: var(--surface-2); }

/* === DIVIDER === */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
}
.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid var(--border);
}
.auth-divider span {
    padding: 0 1rem;
    color: var(--text-dim);
    font-size: .75rem;
}

/* === LINKS === */
.auth-links {
    text-align: center;
    margin-top: 1.25rem;
}
.auth-links a {
    color: var(--primary);
    text-decoration: none;
    font-size: .8125rem;
    transition: color var(--duration) var(--ease);
}
.auth-links a:hover { color: var(--primary-hover); }

/* === ALERTS === */
.alert {
    padding: .75rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: .8125rem;
    font-weight: 500;
}
.alert-error {
    background: var(--danger-bg);
    border: 1px solid rgba(239,68,68,.15);
    color: var(--danger);
}
.alert-success {
    background: var(--success-bg);
    border: 1px solid rgba(34,197,94,.15);
    color: var(--success);
}

/* === MISC === */
.external-providers form { margin: 0; }

/* === RESPONSIVE === */
@media (max-width: 480px) {
    .auth-card {
        padding: 1.5rem;
        margin: 0 .5rem;
        border-radius: var(--radius);
    }
    .auth-card h1 { font-size: 1.125rem; }
    .form-row { flex-direction: column; gap: 0; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: 0s !important;
        animation-duration: 0s !important;
    }
}
