/* ==========================================================================
   Ugenix Connect — Auth Pages (Login / Signup)
   Split layout: branded gradient panel + clean form card
   Mobile-first · No frameworks · Reuses landing tokens
   ========================================================================== */

/* ── Tokens (shared with landing) ───────────────────────────────────────── */
:root {
    --au-primary: #2563eb;
    --au-primary-hover: #1d4ed8;
    --au-accent: #10b981;
    --au-accent-hover: #059669;
    --au-dark: #0f172a;
    --au-text: #1e293b;
    --au-text-muted: #64748b;
    --au-border: #e2e8f0;
    --au-bg: #ffffff;
    --au-bg-alt: #f8fafc;
    --au-error: #ef4444;
    --au-success: #166534;
    --au-radius: 8px;
    --au-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--au-font);
    color: var(--au-text);
    background: var(--au-bg-alt);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--au-primary); text-decoration: none; }
a:hover { color: var(--au-primary-hover); }

/* ==========================================================================
   SPLIT LAYOUT
   Left: branded dark gradient panel (hidden on mobile)
   Right: form card
   ========================================================================== */
.auth-split {
    display: flex;
    min-height: 100vh;
}

/* ── Brand Panel (left) ─────────────────────────────────────────────────── */
.auth-brand-panel {
    flex: 0 0 44%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 48px 40px;
    position: relative;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(ellipse 80% 50% at 50% 0%, rgba(99,102,241,0.18) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 80% 100%, rgba(139,92,246,0.12) 0%, transparent 55%),
        linear-gradient(168deg, #080520 0%, #0e0b2e 18%, #191347 40%, #1e1652 58%, #16133d 78%, #0a0820 100%);
}
/* Ambient glow */
.auth-brand-panel::before {
    content: '';
    position: absolute;
    top: -20%;
    right: -15%;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99,102,241,0.15) 0%, transparent 70%);
    pointer-events: none;
}
.auth-brand-panel::after {
    content: '';
    position: absolute;
    bottom: -10%;
    left: -10%;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(139,92,246,0.10) 0%, transparent 70%);
    pointer-events: none;
}

.auth-brand-logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 32px;
    position: relative;
    z-index: 1;
    color: #fff;
}
.auth-brand-logo:hover { color: #fff; }

.auth-brand-headline {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
    max-width: 340px;
    position: relative;
    z-index: 1;
    margin-bottom: 16px;
}
.auth-brand-headline .green {
    background: linear-gradient(135deg, #34d399, #6ee7b7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-brand-sub {
    font-size: 0.9375rem;
    opacity: 0.65;
    text-align: center;
    max-width: 320px;
    line-height: 1.5;
    position: relative;
    z-index: 1;
}

/* ── Form Panel (right) ─────────────────────────────────────────────────── */
.auth-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    background: var(--au-bg-alt);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--au-bg);
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.06);
    padding: 40px 36px;
}

/* ── Card header ────────────────────────────────────────────────────────── */
.auth-mobile-brand {
    display: none; /* shown on mobile only */
    text-align: center;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--au-dark);
    margin-bottom: 24px;
}
.auth-mobile-brand:hover { color: var(--au-dark); }

.auth-card h1 {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--au-dark);
    margin-bottom: 6px;
}
.auth-card .subtitle {
    color: var(--au-text-muted);
    font-size: 0.875rem;
    margin-bottom: 28px;
}

/* ── Form elements ──────────────────────────────────────────────────────── */
.form-group {
    margin-bottom: 18px;
}
.form-group label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--au-text);
    margin-bottom: 5px;
}
.form-input {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.9375rem;
    font-family: inherit;
    border: 1px solid var(--au-border);
    border-radius: var(--au-radius);
    background: var(--au-bg);
    color: var(--au-text);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input:focus {
    outline: none;
    border-color: var(--au-primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.10);
}
.form-input.error {
    border-color: var(--au-error);
}
.form-input::placeholder {
    color: var(--au-text-muted);
    opacity: 0.6;
}

.form-error {
    font-size: 0.75rem;
    color: var(--au-error);
    margin-top: 4px;
    display: none;
}
.form-error.visible { display: block; }

/* ── Password field with toggle ─────────────────────────────────────────── */
.password-wrap {
    position: relative;
}
.password-wrap .form-input {
    padding-right: 44px;
}
.password-toggle {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--au-text-muted);
    transition: color 0.2s;
}
.password-toggle:hover {
    color: var(--au-text);
}
.password-toggle svg {
    width: 18px;
    height: 18px;
    display: block;
}
/* Hide / show the correct icon */
.password-toggle .icon-hide { display: none; }
.password-wrap.is-visible .password-toggle .icon-show { display: none; }
.password-wrap.is-visible .password-toggle .icon-hide { display: block; }

/* ── Forgot password link ───────────────────────────────────────────────── */
.form-row-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 5px;
}
.forgot-link {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--au-primary);
}
.forgot-link:hover {
    color: var(--au-primary-hover);
    text-decoration: underline;
}

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 24px;
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: inherit;
    border-radius: var(--au-radius);
    border: 2px solid transparent;
    cursor: pointer;
    text-align: center;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
    line-height: 1.4;
}
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.btn-primary {
    background: var(--au-primary);
    color: #fff;
    border-color: var(--au-primary);
}
.btn-primary:hover {
    background: var(--au-primary-hover);
    border-color: var(--au-primary-hover);
}
.btn-block {
    display: flex;
    width: 100%;
}

/* Submit button wrapper (some spacing) */
.form-submit {
    margin-top: 24px;
}

/* ── Alerts ─────────────────────────────────────────────────────────────── */
.alert {
    padding: 10px 14px;
    border-radius: var(--au-radius);
    font-size: 0.8125rem;
    margin-bottom: 18px;
    display: none;
}
.alert.visible { display: block; }
.alert-error {
    background: #fef2f2;
    color: var(--au-error);
    border: 1px solid #fee2e2;
}
.alert-success {
    background: #f0fdf4;
    color: var(--au-success);
    border: 1px solid #dcfce7;
}

/* ── Auth footer ────────────────────────────────────────────────────────── */
.auth-footer {
    text-align: center;
    margin-top: 22px;
    font-size: 0.8125rem;
    color: var(--au-text-muted);
}
.auth-footer a {
    font-weight: 600;
    color: var(--au-primary);
}
.auth-footer a:hover {
    color: var(--au-primary-hover);
    text-decoration: underline;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

/* Tablet ≤ 900px — shrink brand panel */
@media (max-width: 900px) {
    .auth-brand-panel {
        flex: 0 0 38%;
        padding: 40px 28px;
    }
    .auth-brand-headline {
        font-size: 1.5rem;
    }
}

/* Mobile ≤ 640px — hide brand panel, show mobile brand in card */
@media (max-width: 640px) {
    .auth-split {
        flex-direction: column;
    }
    .auth-brand-panel {
        display: none;
    }
    .auth-form-panel {
        padding: 24px 16px;
        min-height: 100vh;
    }
    .auth-mobile-brand {
        display: block;
    }
    .auth-card {
        padding: 32px 24px;
        box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    }
}
/* ── Button spinner ──────────────────────────────────────────────────── */
.btn-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: uc-spin 0.5s linear infinite;
    margin-right: 6px;
    vertical-align: middle;
}
@keyframes uc-spin { to { transform: rotate(360deg); } }
.btn.is-loading { pointer-events: none; }
/* ── Accessibility ──────────────────────────────────────────────────────── */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; }
}
