:root {
    --sapphire:       #1e3a8a;
    --sapphire-light: #3b82f6;
    --electric:       #06b6d4;
    --electric-light: #22d3ee;
    --sunset:         #f97316;
    --sunset-light:   #fb923c;

    --dark-bg:        #0f172a;
    --dark-surface:   rgba(15,23,42,0.6);
    --dark-surface-focus: rgba(15,23,42,0.8);
    --dark-border:    rgba(51,65,85,0.6);

    --text-body:      #f1f5f9;
    --text-label:     #cbd5e1;
    --text-muted:     #94a3b8;
    --text-dim:       #475569;
    --text-icon:      #475569;

    --radius-input:   0.75rem;
    --radius-card:    1.25rem;

    --ease:           0.2s cubic-bezier(0.4,0,0.2,1);

    --font-body:      'Inter', system-ui, sans-serif;
    --font-display:   'Poppins', system-ui, sans-serif;
}

html, body { height: 100%; margin: 0; }
body {
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    background: var(--dark-bg);
    color: var(--text-body);
}

/* ============================================
   Login Layout
   ============================================ */
.login-grid {
    display: grid;
    min-height: 100vh;
}
.panel-left {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--dark-bg);
}
.panel-right {
    display: none;
    position: relative;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(160deg, #0f172a 0%, #0c1e34 50%, #0a1628 100%);
}
@media (min-width: 768px) {
    .login-grid { grid-template-columns: 35% 65%; }
    .panel-right { display: flex; }
    .panel-left { padding: 2.5rem; }
}
.form-container {
    width: 100%;
    max-width: 25rem;
}

/* ============================================
   Right Panel — Background
   ============================================ */
.panel-right::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(900px circle at 20% 25%, rgba(6,182,212,0.08) 0%, transparent 50%),
        radial-gradient(700px circle at 80% 75%, rgba(249,115,22,0.05) 0%, transparent 50%);
    z-index: 0;
}

/* ============================================
   Login-Specific Classes
   ============================================ */
.login-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-body);
    margin-top: 1.5rem;
}
.login-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}
.login-form {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.login-field { }
.login-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-label);
    margin-bottom: 0.375rem;
}
.login-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-label);
}
.login-submit {
    width: 100%;
    justify-content: center;
    margin-top: 0.5rem;
}
.login-back {
    margin-top: 0.5rem;
}
.login-back-link {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--ease);
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}
.login-back-link:hover { color: var(--text-label); }
.login-copyright {
    position: absolute;
    bottom: 2rem;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-dim);
    line-height: 1.8;
}
.login-error {
    margin-top: 2rem;
}
.login-error i {
    margin-right: 0.625rem;
    color: #f87171;
}

/* ============================================
   Form Components
   ============================================ */
.input-wrap {
    position: relative;
}
.input-wrap .icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-icon);
    font-size: 0.875rem;
    pointer-events: none;
    transition: color var(--ease);
}
.input-wrap:focus-within .icon {
    color: var(--sunset);
}
.input-wrap .toggle-pass {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-icon);
    font-size: 0.875rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    transition: color var(--ease);
}
.input-wrap .toggle-pass:hover {
    color: var(--text-label);
}
.input-wrap .toggle-pass:focus-visible {
    outline: 2px solid var(--sunset);
    outline-offset: 2px;
    border-radius: 2px;
}
.form-input.has-icon-both {
    padding-left: 2.75rem;
    padding-right: 2.75rem;
}
.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-input);
    border: 1px solid var(--dark-border);
    background: var(--dark-surface);
    color: var(--text-body);
    font-size: 0.875rem;
    transition: border-color var(--ease), box-shadow var(--ease), background var(--ease);
}
.form-input:focus {
    border-color: var(--sunset);
    box-shadow: 0 0 0 3px rgba(249,115,22,0.12);
    outline: none;
    background: var(--dark-surface-focus);
}
.form-input::placeholder { color: var(--text-dim); }
.form-input.has-icon { padding-left: 2.75rem; }

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 2rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: white;
    background: var(--sapphire);
    box-shadow: 0 4px 14px rgba(30,58,138,0.25);
    transition: box-shadow var(--ease), background var(--ease);
    text-decoration: none;
    border: none;
    cursor: pointer;
}
.btn-primary:hover {
    background: var(--sapphire-light);
    box-shadow: 0 6px 20px rgba(30,58,138,0.35);
}
.btn-primary:focus-visible {
    outline: 2px solid var(--sapphire-light);
    outline-offset: 2px;
}

.form-checkbox {
    width: 1rem;
    height: 1rem;
    border-radius: 0.375rem;
    border: 1px solid var(--dark-border);
    background: var(--dark-surface);
    accent-color: var(--electric);
    cursor: pointer;
}

.alert-error {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-input);
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.2);
    color: #fca5a5;
}

/* ============================================
   Brand Components (Right Panel)
   ============================================ */
.brand-icon {
    width: 5rem;
    height: 5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    border-radius: var(--radius-card);
    background: none;
    box-shadow: none;
}
.brand-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
}
.brand-heading {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.1;
    background: linear-gradient(135deg, var(--electric-light) 0%, var(--sunset-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.brand-divider {
    width: 80px;
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--electric), var(--sunset));
}
.brand-tagline {
    font-size: 0.9375rem;
    font-weight: 500;
    color: rgba(255,255,255,0.55);
    letter-spacing: 0.12em;
}
.brand-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 12vh 4rem;
}
.brand-glow {
    position: relative;
}
.brand-glow::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 320px;
    height: 320px;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(6,182,212,0.06) 0%, transparent 70%);
    pointer-events: none;
}
.brand-description {
    margin-top: 4rem;
    max-width: 320px;
}
.brand-description p {
    color: rgba(255,255,255,0.55);
    font-size: 1rem;
    line-height: 1.9;
}

/* ============================================
   Error Pages
   ============================================ */
.error-page {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.bg-atmosphere {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(900px circle at 25% 30%, rgba(6,182,212,0.06) 0%, transparent 50%),
        radial-gradient(700px circle at 75% 70%, rgba(249,115,22,0.04) 0%, transparent 50%);
    pointer-events: none;
}
.content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 2rem;
}
.error-code {
    font-family: var(--font-display);
    font-size: 120px;
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(135deg, var(--electric-light) 0%, var(--sunset-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}
.anim-fade   { animation: fadeUp 0.6s ease-out both; }
.anim-fade-d1 { animation-delay: 0.1s; }
.anim-fade-d2 { animation-delay: 0.2s; }
.anim-fade-d3 { animation-delay: 0.3s; }
.anim-fade-d4 { animation-delay: 0.4s; }
.anim-shake  { animation: shake 0.4s ease-out; }

.text-center { text-align: center; }
.block { display: block; }
.relative { position: relative; }
.absolute { position: absolute; }
.font-medium { font-weight: 500; }
.font-bold { font-weight: 700; }
.font-display { font-family: var(--font-display); }
.text-muted { color: var(--text-muted); }
.text-dim { color: var(--text-dim); }
.text-label { color: var(--text-label); }
.text-white { color: white; }
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-2xl { font-size: 1.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.gap-2 { gap: 0.5rem; }
.gap-5 { gap: 1.25rem; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.cursor-pointer { cursor: pointer; }
