/* ============================================================
   Auth – Professional Modern Login
   Font: Plus Jakarta Sans | Base: 14px
   ============================================================ */

:root {
    --font: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #eef2ff;
    --primary-glow: rgba(79, 70, 229, 0.25);
    --accent: #06b6d4;
    --surface: #ffffff;
    --bg: #f8fafc;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --border-hover: #cbd5e1;
    --danger: #ef4444;
    --danger-bg: #fef2f2;
    --success: #10b981;
    --success-bg: #ecfdf5;
    --info-bg: #f0f9ff;
    --info-border: #bae6fd;
    --info-text: #0c4a6e;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg: 0 20px 50px -12px rgba(0,0,0,0.15);
    --shadow-xl: 0 25px 60px -15px rgba(0,0,0,0.2);
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

body.auth-page,
body.login-page {
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg);
    min-height: 100vh;
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   Wrapper & Background
   ============================================================ */
.auth-wrapper {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

.auth-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.auth-bg-circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
}
.auth-bg-circle--1 {
    width: 600px; height: 600px;
    top: -200px; left: -150px;
    background: linear-gradient(135deg, #818cf8, #c084fc);
}
.auth-bg-circle--2 {
    width: 500px; height: 500px;
    bottom: -200px; right: -100px;
    background: linear-gradient(135deg, #06b6d4, #3b82f6);
}
.auth-bg-circle--3 {
    width: 300px; height: 300px;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #f472b6, #fb923c);
    opacity: 0.25;
}

/* ============================================================
   Container – split layout
   ============================================================ */
.auth-container {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    min-height: 100vh;
    width: 100%;
}

/* ============================================================
   Hero (left)
   ============================================================ */
.auth-hero {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 48px;
    background: linear-gradient(160deg, #312e81 0%, #4f46e5 50%, #7c3aed 100%);
    color: #fff;
    position: relative;
    overflow: hidden;
}
.auth-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(6, 182, 212, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(244, 114, 182, 0.15) 0%, transparent 50%);
}

.auth-hero-content {
    position: relative;
    z-index: 2;
    max-width: 440px;
}

.auth-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(8px);
    padding: 8px 16px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    margin-bottom: 24px;
}
.auth-hero-badge i { color: #fbbf24; }

.auth-hero-title {
    font-size: 36px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
}

.auth-hero-desc {
    font-size: 15px;
    line-height: 1.7;
    color: rgba(255,255,255,0.85);
    margin-bottom: 32px;
}

.auth-hero-stats {
    display: flex;
    gap: 32px;
    margin-bottom: 32px;
}
.auth-stat { text-align: center; }
.auth-stat-num {
    display: block;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.01em;
}
.auth-stat-label {
    display: block;
    font-size: 12px;
    color: rgba(255,255,255,0.7);
    margin-top: 2px;
}

.auth-hero-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #fff !important;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 100px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    transition: background var(--transition), transform var(--transition);
}
.auth-hero-link:hover {
    background: rgba(255,255,255,0.18);
    transform: translateY(-1px);
    text-decoration: none;
    color: #fff;
}
.auth-hero-link i { color: #fbbf24; }

/* ============================================================
   Panel (right)
   ============================================================ */
.auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 32px;
    background: rgba(255,255,255,0.6);
    backdrop-filter: blur(20px);
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 36px 32px 28px;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.4s ease both;
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.auth-card-logo {
    text-align: center;
    margin-bottom: 20px;
}
.auth-card-logo img {
    height: 48px;
    width: auto;
}

.auth-card-header {
    text-align: center;
    margin-bottom: 24px;
}
.auth-card-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 6px;
}
.auth-card-header p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

/* Alert / message */
.auth-alert:empty { display: none; }
.auth-alert { margin-bottom: 16px; }

/* ============================================================
   Form
   ============================================================ */
.auth-form { text-align: left; }

.field-group { margin-bottom: 16px; }
.field-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.field-input {
    position: relative;
    display: flex;
    align-items: center;
}

.field-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
    pointer-events: none;
    transition: color var(--transition);
}

.field-input .form-control,
#login .form-control {
    width: 100%;
    height: 44px;
    padding: 0 44px 0 42px;
    font-size: 14px;
    font-family: var(--font);
    font-weight: 400;
    color: var(--text-primary);
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
    outline: none;
}
.field-input .form-control::placeholder { color: var(--text-muted); }
.field-input .form-control:hover {
    border-color: var(--border-hover);
    background: #fff;
}
.field-input .form-control:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px var(--primary-glow);
}
.field-input:focus-within .field-icon { color: var(--primary); }

/* Validation */
.has-error .field-input .form-control {
    border-color: var(--danger);
    background: var(--danger-bg);
}
.has-error .field-input .form-control:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}
.has-error .field-icon { color: var(--danger); }

.field-error {
    display: block;
    min-height: 16px;
    margin-top: 4px;
    font-size: 12px;
    color: var(--danger);
    font-weight: 500;
}

/* Toggle password */
.field-toggle-pass {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: 0;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: color var(--transition), background var(--transition);
}
.field-toggle-pass:hover { color: var(--primary); background: var(--primary-light); }

/* Options row */
.auth-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 4px 0 16px;
    flex-wrap: wrap;
    gap: 8px;
}

.auth-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
    position: relative;
}
.auth-check input { position: absolute; opacity: 0; width: 0; height: 0; }
.auth-check-box {
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--border-hover);
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    flex-shrink: 0;
}
.auth-check-box::after {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 2px;
    background: var(--primary);
    transform: scale(0);
    transition: transform var(--transition);
}
.auth-check input:checked ~ .auth-check-box {
    border-color: var(--primary);
    background: var(--primary-light);
}
.auth-check input:checked ~ .auth-check-box::after { transform: scale(1); }

.auth-link {
    font-size: 13px;
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    transition: color var(--transition);
}
.auth-link:hover { color: var(--primary-hover); }

/* Info box */
.auth-info-box {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: var(--info-bg);
    border: 1px solid var(--info-border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--info-text);
    margin-bottom: 20px;
}
.auth-info-box i { margin-top: 2px; color: #0284c7; flex-shrink: 0; }

/* Submit button */
.btn-submit {
    width: 100%;
    height: 46px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font);
    color: #fff;
    background: var(--primary);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
    transition: background var(--transition), transform 0.1s ease, box-shadow var(--transition);
    box-shadow: 0 4px 12px -4px var(--primary-glow);
}
.btn-submit::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(255,255,255,0.1) 50%, transparent 100%);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}
.btn-submit:hover:not(:disabled)::before { transform: translateX(100%); }
.btn-submit:hover:not(:disabled) {
    background: var(--primary-hover);
    box-shadow: 0 8px 20px -6px var(--primary-glow);
}
.btn-submit:active:not(:disabled) { transform: scale(0.98); }
.btn-submit:disabled { opacity: 0.6; cursor: not-allowed; }

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0 16px;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}
.auth-divider span {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Outline button */
.btn-outline {
    width: 100%;
    height: 44px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font);
    color: var(--text-primary) !important;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition);
}
.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary) !important;
    background: var(--primary-light);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}
.btn-outline i { font-size: 13px; }

/* Footer */
.auth-footer {
    text-align: center;
    margin: 20px 0 0;
    font-size: 11px;
    color: var(--text-muted);
}

/* ============================================================
   Legacy compatibility (other auth pages)
   ============================================================ */
.login-box { width: 100%; max-width: 420px; margin: 40px auto; }
.login-card-body,
.login-box-body {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    padding: 36px 32px 28px;
    color: var(--text-primary);
}
.login-logo { text-align: center; margin-bottom: 16px; }
.login-logo img { max-height: 48px; }

.callout {
    border-radius: var(--radius-sm);
    margin: 0 0 14px;
    padding: 12px 14px;
    border-left: 4px solid var(--border);
    font-size: 13px;
    line-height: 1.5;
}
.callout-info    { background: var(--info-bg); color: var(--info-text) !important; border-color: #0284c7; }
.callout-success { background: var(--success-bg); color: #065f46 !important; border-color: var(--success); }
.callout-danger  { background: var(--danger-bg); color: #991b1b !important; border-color: var(--danger); }

.text-center { text-align: center; }
.text-red { color: var(--danger) !important; }
.text-green { color: var(--success) !important; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1024px) {
    .auth-container { grid-template-columns: 1fr; }
    .auth-hero { display: none; }
    .auth-panel {
        min-height: 100vh;
        padding: 32px 20px;
        background: transparent;
        backdrop-filter: none;
    }
    .auth-card {
        max-width: 440px;
        border-radius: 20px;
    }
}

@media (max-width: 480px) {
    .auth-panel { padding: 20px 16px; }
    .auth-card {
        padding: 28px 20px 22px;
        border-radius: 16px;
        box-shadow: var(--shadow-md);
    }
    .auth-card-header h2 { font-size: 18px; }
    .auth-card-header p { font-size: 12px; }
    .field-input .form-control,
    #login .form-control { height: 42px; font-size: 14px; }
    .btn-submit { height: 44px; }
    .btn-outline { height: 42px; }
    .auth-options { flex-direction: column; align-items: flex-start; gap: 10px; }
    .auth-bg-circle--1 { width: 300px; height: 300px; top: -100px; left: -80px; }
    .auth-bg-circle--2 { width: 250px; height: 250px; bottom: -100px; right: -60px; }
    .auth-bg-circle--3 { display: none; }
}

@media (max-width: 360px) {
    .auth-card { padding: 24px 16px 20px; }
    .auth-card-logo img { height: 40px; }
}

/* ============================================================
   Dark mode support (prefers-color-scheme)
   ============================================================ */
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f172a;
        --surface: #1e293b;
        --text-primary: #f1f5f9;
        --text-secondary: #94a3b8;
        --text-muted: #64748b;
        --border: #334155;
        --border-hover: #475569;
        --primary-light: rgba(79, 70, 229, 0.15);
        --primary-glow: rgba(79, 70, 229, 0.35);
        --info-bg: rgba(14, 165, 233, 0.1);
        --info-border: rgba(14, 165, 233, 0.2);
        --info-text: #7dd3fc;
        --danger-bg: rgba(239, 68, 68, 0.1);
        --success-bg: rgba(16, 185, 129, 0.1);
        --shadow-lg: 0 20px 50px -12px rgba(0,0,0,0.5);
    }
    .auth-panel { background: rgba(15, 23, 42, 0.6); }
    .field-input .form-control,
    #login .form-control { background: #0f172a; }
    .field-input .form-control:hover,
    .field-input .form-control:focus { background: #0f172a; }
    .auth-bg-circle { opacity: 0.3; }
}


/* ============================================================
   Centered layout (forgot password, register)
   ============================================================ */
.auth-center {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 40px 20px;
}

/* Wide card for register forms */
.auth-card--wide {
    max-width: 580px;
}

/* Section titles inside forms */
.auth-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 24px 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.auth-section-title i { font-size: 14px; }

/* Two-column field row */
.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

/* Field hint text */
.field-hint {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-muted);
}

/* Required asterisk */
.req { color: var(--danger); font-weight: 700; }

/* Textarea */
textarea.form-control {
    height: auto !important;
    min-height: 60px;
    padding: 10px 14px !important;
    resize: vertical;
    font-family: var(--font);
    font-size: 14px;
}

/* Select styling */
select.form-control {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px !important;
}

/* Action buttons row (register) */
.auth-actions {
    display: flex;
    gap: 12px;
    margin-top: 28px;
}
.auth-actions .btn-outline {
    flex: 0 0 auto;
    width: auto;
    padding: 0 20px;
}
.auth-actions .btn-submit {
    flex: 1;
}

/* Alert styles for forgot password */
.alert-success,
.alert-warning {
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-size: 13px;
    margin-bottom: 16px;
}

/* ============================================================
   Responsive additions for register/forgot
   ============================================================ */
@media (max-width: 640px) {
    .field-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    .auth-card--wide { max-width: 100%; }
    .auth-actions {
        flex-direction: column-reverse;
    }
    .auth-actions .btn-outline {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .auth-center { padding: 20px 12px; }
    .auth-card--wide { padding: 28px 18px 22px; }
    .auth-section-title { font-size: 12px; margin: 20px 0 12px; }
}
