:root {
    --brand-navy-dark: #060a1f;
    --brand-navy: #10173d;
    --brand-navy-mid: #1b2768;
    --brand-blue: #2c3ea3;
    --brand-blue-light: #4256c9;
    --brand-gold: #f0a830;
    --brand-gold-light: #f7c869;
    --brand-gray: #9a9a9a;
    --text-muted: #7a7ea3;
    --border-color: rgba(255,255,255,0.1);
    --bg-page: #0a0c1c;
    --bg-card: #12142c;
    --bg-input: #1a1d3f;
    --text-primary: #eef0fa;
    --label-color: #c9cbe6;
    --footer-color: #5f6288;
    --icon-muted: #6d7096;
    --alert-error-text: #f87171;
    --alert-success-text: #4ade80;
    --remember-color: #9295bf;
    --link-color: #9db4ff;
    --auth-card-shadow:
        0 1px 0 rgba(255,255,255,0.04) inset,
        0 24px 50px -12px rgba(91,110,248,0.18),
        0 10px 24px -8px rgba(0,0,0,0.5),
        0 2px 6px rgba(0,0,0,0.4);
    --auth-card-border: rgba(255,255,255,0.08);
}

body[data-theme="light"] {
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --bg-page: #f5f5f5;
    --bg-card: #ffffff;
    --bg-input: #ffffff;
    --text-primary: #1a1a1a;
    --label-color: #222;
    --footer-color: #9a9a9a;
    --icon-muted: #9a9a9a;
    --alert-error-text: #c0392b;
    --alert-success-text: #1e8449;
    --remember-color: #444;
    --link-color: var(--brand-blue);
    --auth-card-shadow:
        0 1px 0 rgba(255,255,255,0.6) inset,
        0 -6px 14px rgba(0,0,0,0.04) inset,
        0 24px 45px -12px rgba(16,23,61,0.28),
        0 10px 20px -8px rgba(16,23,61,0.18),
        0 2px 4px rgba(16,23,61,0.1);
    --auth-card-border: rgba(255,255,255,0.6);
}

html {
    font-size: 18px;
}

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

.theme-toggle-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 20;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--icon-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.theme-toggle-btn svg { width: 18px; height: 18px; }

body {
    font-family: 'Inter', 'Segoe UI', Roboto, -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-page);
    color: var(--text-primary);
}

.auth-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ---------- Left brand panel ---------- */
.auth-brand {
    position: relative;
    flex: 1 1 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px 64px;
    color: #fff;
    background: linear-gradient(135deg, var(--brand-navy-dark) 0%, var(--brand-navy) 45%, var(--brand-navy-mid) 75%, var(--brand-blue) 100%);
    overflow: hidden;
}

.auth-brand::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url('../images/building.jpg');
    background-repeat: no-repeat;
    background-position: right bottom;
    background-size: auto 100%;
    -webkit-mask-image: linear-gradient(100deg, transparent 0%, transparent 8%, rgba(0,0,0,0.5) 30%, black 55%, black 100%);
    mask-image: linear-gradient(100deg, transparent 0%, transparent 8%, rgba(0,0,0,0.5) 30%, black 55%, black 100%);
    pointer-events: none;
}

.auth-brand::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, rgba(6,10,31,0.55) 0%, rgba(6,10,31,0.35) 35%, rgba(6,10,31,0.05) 60%, rgba(6,10,31,0.2) 100%);
    pointer-events: none;
}

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

.brand-logo img {
    height: 100px;
    width: auto;
    border-radius: 14px;
    background: #f5f5f5;
    padding: 6px;
}

.brand-tagline h1 {
    position: relative;
    z-index: 1;
    font-size: 2.4rem;
    line-height: 1.25;
    font-weight: 600;
    margin-bottom: 18px;
}

.brand-tagline h1 span {
    color: var(--brand-gold);
}

.brand-tagline p {
    position: relative;
    z-index: 1;
    color: #d4d4d4;
    font-size: 1rem;
    max-width: 420px;
    margin-bottom: 42px;
}

.feature-list {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 40px;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.feature-icon {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(240,168,48,0.12);
    border: 1px solid rgba(240,168,48,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.feature-text strong {
    display: block;
    font-size: 0.98rem;
    margin-bottom: 2px;
}

.feature-text span {
    color: #b8b8b8;
    font-size: 0.86rem;
}

.secure-badge {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(240,168,48,0.35);
    border-radius: 12px;
    padding: 16px 18px;
    max-width: 460px;
}

.secure-badge .icon {
    color: var(--brand-gold);
    font-size: 22px;
}

.secure-badge strong {
    display: block;
    font-size: 0.92rem;
    margin-bottom: 2px;
}

.secure-badge span {
    color: #b8b8b8;
    font-size: 0.82rem;
}

/* ---------- Right form panel ---------- */
.auth-form-panel {
    flex: 1 1 50%;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    padding: 48px 10%;
    overflow-y: auto;
}

.auth-wrapper-centered {
    background: var(--bg-page);
}

.auth-wrapper-centered .auth-form-panel {
    background: var(--bg-page);
    flex: 1 1 100%;
    justify-content: center;
}

.auth-form-inner {
    margin: auto;
    width: 100%;
    max-width: 420px;
}

.brand-logo-centered {
    justify-content: center;
    margin-bottom: 28px;
}

.brand-logo-centered img {
    height: 140px;
}

.auth-card {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 36px 40px 32px;
    box-shadow: var(--auth-card-shadow);
    border: 1px solid var(--auth-card-border);
}

.auth-card-title {
    text-align: center;
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    margin-bottom: 24px;
    text-shadow: 0 6px 20px rgba(91,110,248,0.25);
}

.auth-form-inner h2 {
    font-size: 1.9rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.auth-form-inner > p.subtitle {
    color: var(--text-muted);
    margin-bottom: 32px;
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.alert-error {
    background: rgba(239,68,68,0.12);
    color: var(--alert-error-text);
    border: 1px solid rgba(239,68,68,0.3);
}

.alert-success {
    background: rgba(34,197,94,0.12);
    color: var(--alert-success-text);
    border: 1px solid rgba(34,197,94,0.3);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.88rem;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--label-color);
}

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

.input-wrap .input-icon {
    position: absolute;
    left: 14px;
    color: var(--icon-muted);
    font-size: 1rem;
    pointer-events: none;
}

.input-wrap input {
    width: 100%;
    padding: 13px 16px 13px 42px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.95rem;
    color: var(--text-primary);
    outline: none;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}

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

.input-wrap input:focus {
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 3px rgba(44,62,163,0.25);
}

.toggle-password {
    position: absolute;
    right: 14px;
    cursor: pointer;
    color: var(--icon-muted);
    background: none;
    border: none;
    font-size: 1rem;
    padding: 0;
}

.form-row-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    font-size: 0.88rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--remember-color);
    cursor: pointer;
}

.remember-me input {
    width: 16px;
    height: 16px;
    accent-color: var(--brand-blue);
}

.forgot-link, .signup-link {
    color: var(--link-color);
    text-decoration: none;
    font-weight: 500;
}

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

.btn-signin {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--brand-blue) 0%, var(--brand-blue-light) 100%);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 10px 24px -6px rgba(44,62,163,0.55);
    transition: opacity 0.15s, transform 0.15s;
}

.btn-signin:hover {
    opacity: 0.92;
    transform: translateY(-1px);
}

.auth-footer {
    text-align: center;
    font-size: 0.78rem;
    color: var(--footer-color);
    padding-top: 24px;
}

@media (max-width: 900px) {
    .auth-brand { display: none; }
    .auth-form-panel { flex: 1 1 100%; padding: 32px 6%; }
}
