:root {
    --primary: #0056b3;
    --primary-dark: #003d80;
    --primary-light: #1a73d1;
    --accent: #ff8c00;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --bg-soft: #f8fafc;
    --danger: #dc2626;
    --success: #16a34a;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

* { box-sizing: border-box; }

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    color: var(--text-dark);
    background: var(--bg-soft);
    -webkit-font-smoothing: antialiased;
}

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

.auth-brand {
    flex: 1;
    position: relative;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
    color: #fff;
    padding: 48px 56px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}

.auth-brand::before,
.auth-brand::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    pointer-events: none;
}

.auth-brand::before { width: 520px; height: 520px; top: -180px; right: -180px; }
.auth-brand::after  { width: 360px; height: 360px; bottom: -120px; left: -120px; background: rgba(255, 255, 255, 0.04); }

.auth-brand-orb {
    position: absolute;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 140, 0, 0.35) 0%, transparent 70%);
    top: 30%; left: 60%;
    filter: blur(20px);
    pointer-events: none;
}

.auth-brand-content { position: relative; z-index: 2; }

.auth-brand-logo {
    max-width: 200px;
    max-height: 64px;
    object-fit: contain;
}

.auth-brand-hero { position: relative; z-index: 2; }

.auth-brand-hero h1 {
    font-size: 2.4rem;
    font-weight: 600;
    line-height: 1.2;
    margin: 0 0 16px;
    letter-spacing: -0.02em;
}

.auth-brand-hero p {
    font-size: 1rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.85);
    margin: 0 0 32px;
    max-width: 460px;
}

.auth-brand-features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-brand-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.92);
}

.auth-brand-features i {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

.auth-brand-footer {
    position: relative; z-index: 2;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

.auth-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 32px;
    background: #fff;
}

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

.auth-form-mobile-logo {
    display: none;
    text-align: center;
    margin-bottom: 24px;
}

.auth-form-mobile-logo img {
    max-width: 160px;
    max-height: 48px;
    object-fit: contain;
}

.auth-form h2 {
    font-size: 1.75rem;
    font-weight: 600;
    margin: 0 0 8px;
    color: var(--text-dark);
    letter-spacing: -0.01em;
}

.auth-form .subtitle {
    color: var(--text-muted);
    margin: 0 0 32px;
    font-size: 0.95rem;
}

.form-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 6px;
    display: block;
}

.input-wrapper { position: relative; margin-bottom: 18px; }

.input-wrapper .input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
    pointer-events: none;
    z-index: 2;
}

.input-wrapper input.form-control,
.input-wrapper select.form-select {
    height: 48px;
    padding: 0 14px 0 42px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text-dark);
    background-color: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    width: 100%;
}

.input-wrapper select.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px 12px;
    padding-right: 40px;
    -webkit-appearance: none;
    appearance: none;
}

.input-wrapper input.form-control:focus,
.input-wrapper select.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.12);
}

.input-wrapper input.form-control.is-invalid,
.input-wrapper select.form-select.is-invalid,
.input-wrapper .has-error {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.input-wrapper .toggle-password {
    position: absolute;
    right: 12px; top: 50%;
    transform: translateY(-50%);
    background: transparent; border: 0;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    font-size: 0.9rem;
    z-index: 2;
}

.input-wrapper .toggle-password:hover { color: var(--primary); }

.field-error {
    color: var(--danger);
    font-size: 0.8rem;
    margin: -10px 0 14px;
    display: block;
}

.form-utility {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 12px;
}

.form-utility a {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
}

.form-utility a:hover { text-decoration: underline; }

.btn-signin {
    width: 100%;
    height: 48px;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    font-family: inherit;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
    box-shadow: 0 4px 12px rgba(0, 86, 179, 0.25);
}

.btn-signin:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0, 86, 179, 0.32); }
.btn-signin:active { transform: translateY(0); }
.btn-signin:disabled { opacity: 0.7; cursor: not-allowed; }

.auth-form-footer {
    text-align: center;
    margin-top: 28px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.auth-alert {
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 0.875rem;
    margin-bottom: 18px;
    border: 1px solid transparent;
}

.auth-alert.alert-success { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.auth-alert.alert-danger  { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.auth-alert.alert-info    { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }
.auth-alert ul { margin: 0; padding-left: 18px; }

.loader {
    position: fixed; inset: 0;
    background: #fff;
    display: flex; align-items: center; justify-content: center;
    z-index: 9999;
    color: var(--primary);
    font-size: 2rem;
}

@media (max-width: 991px) {
    .auth-brand { display: none; }
    .auth-form-mobile-logo { display: block; }
    .auth-form-panel { padding: 32px 20px; }
}

@media (max-width: 480px) {
    .auth-form h2 { font-size: 1.45rem; }
}
