:root {
    --brand: #1d6fd8;
    --brand-hover: #1558b3;
    --brand-border: #175db8;
    --brand-soft: #e8f1fc;
    --brand-rgb: 29, 111, 216;
    --teal: var(--brand);
    --teal-hover: var(--brand-hover);
    --teal-border: var(--brand-border);
    --teal-2: #3b8dff;
    --ink: #0a2540;
    --amber: #f59e0b;
    --paper: #f4f6fa;
}

:root,
[data-bs-theme="light"] {
    --bs-primary: var(--brand);
    --bs-primary-rgb: var(--brand-rgb);
    --bs-link-color: var(--brand);
    --bs-link-hover-color: var(--brand-hover);
}

* { box-sizing: border-box; }

html, body {
    height: 100%;
    overflow-x: hidden;
    -webkit-font-smoothing: auto;
    -moz-osx-font-smoothing: auto;
    text-rendering: geometricPrecision;
}

body {
    margin: 0;
    font-family: "Plus Jakarta Sans", "Noto Sans Ethiopic", "Abyssinica SIL", "Nyala", sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    background: var(--paper);
    color: var(--ink);
}
html[data-typeface="jakarta"] body {
    font-family: "Plus Jakarta Sans", "Noto Sans Ethiopic", "Abyssinica SIL", sans-serif;
}
html[data-typeface="inter"] body {
    font-family: Inter, system-ui, "Segoe UI", "Noto Sans Ethiopic", sans-serif;
}
html[data-typeface="noto"] body {
    font-family: "Noto Sans", "Noto Sans Ethiopic", "Abyssinica SIL", sans-serif;
}
html[data-typeface="serif"] body {
    font-family: "Noto Serif", "Noto Serif Ethiopic", "Abyssinica SIL", serif;
}
html[data-typeface="abyssinica"] body {
    font-family: "Noto Sans", "Abyssinica SIL", "Noto Sans Ethiopic", sans-serif;
}

.auth-shell {
    min-height: 100%;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    overflow: hidden;
}

.auth-brand {
    background:
        radial-gradient(1200px 500px at -10% 110%, rgba(59, 141, 255, 0.18), transparent 50%),
        radial-gradient(900px 400px at 110% -10%, rgba(29, 111, 216, 0.28), transparent 45%),
        linear-gradient(165deg, #041226 0%, #0a2540 55%, #0a3d8f 100%);
    color: #fff;
    padding: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.auth-brand::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: radial-gradient(circle at 30% 40%, #000 20%, transparent 75%);
}

.auth-brand-inner { position: relative; max-width: 460px; }

.brand-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.brand-logo {
    height: 72px;
    width: auto;
    max-width: 280px;
    object-fit: contain;
    background: #fff;
    border-radius: 14px;
    padding: 8px 12px;
}

.brand-logo-auth {
    height: 148px;
    width: auto;
    max-width: 440px;
    object-fit: contain;
    background: #fff;
    border-radius: 20px;
    padding: 14px 20px;
}

.auth-brand h1 {
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.auth-brand p { color: rgba(255,255,255,0.9); font-size: 16px; }

.brand-points {
    list-style: none;
    padding: 0;
    margin: 2rem 0 0;
}

.brand-points li {
    display: flex;
    gap: 0.7rem;
    margin-bottom: 0.85rem;
    color: rgba(255,255,255,0.9);
}

.brand-points i { color: var(--teal-2); }

.auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
}

.auth-card {
    width: 100%;
    max-width: 480px;
    background: #fff;
    border: 1px solid #e6eaf2;
    border-radius: 16px;
    padding: 1.75rem 1.75rem 1.5rem;
    box-shadow: 0 1px 2px rgba(10, 37, 64, 0.05), 0 6px 18px rgba(10, 37, 64, 0.07);
}

.auth-card h2 { font-weight: 700; font-size: 24px; line-height: 1.2; margin-bottom: 0.35rem; }

.auth-lead { color: #1c334d; margin-bottom: 1.5rem; }

.auth-mobile-brand {
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
}
.auth-mobile-brand .brand-logo-auth {
    height: 96px;
    max-width: 280px;
}

.form-label { font-weight: 500; font-size: 14px; }

.form-control {
    border: 1px solid #d9deea;
    border-radius: 12px;
    padding: 0.7rem 0.85rem;
    min-height: 48px;
    font-size: 16px;
}

.form-control:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 4px rgba(29, 111, 216, 0.14);
}

.password-field {
    position: relative;
}
.password-field .form-control {
    padding-right: 44px;
}
.password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #3d4f66;
    cursor: pointer;
    line-height: 1;
}
.password-toggle .ph {
    font-size: 18px;
}
.password-toggle:hover,
.password-toggle:focus {
    color: #b91c1c;
    outline: none;
}

.btn-auth {
    background: var(--brand);
    color: #fff;
    border: 1px solid var(--brand-border);
    border-radius: 6px;
    min-height: 50px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: none;
    filter: none;
    position: relative;
    overflow: hidden;
}
.btn-auth::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 55%;
    background: linear-gradient(
        105deg,
        transparent 0%,
        rgba(255, 255, 255, 0.08) 35%,
        rgba(255, 255, 255, 0.5) 50%,
        rgba(255, 255, 255, 0.08) 65%,
        transparent 100%
    );
    transform: translateX(-140%) skewX(-18deg);
    pointer-events: none;
}
.btn-auth:hover::after {
    animation: btn-glance 0.7s ease;
}
@keyframes btn-glance {
    to { transform: translateX(240%) skewX(-18deg); }
}
@media (prefers-reduced-motion: reduce) {
    .btn-auth::after { content: none; }
}

.btn-auth:hover {
    color: #fff;
    background: var(--brand-hover);
    border-color: var(--brand-hover);
    filter: none;
}

.auth-switch { margin-top: 1.25rem; color: #1c334d; }

.auth-switch a { color: var(--brand); font-weight: 600; text-decoration: none; }

.auth-forgot {
    display: inline-block;
    margin-top: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--brand);
    text-decoration: none;
    white-space: nowrap;
}
.auth-forgot:hover { color: var(--text); }

@media (max-width: 991px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-brand { display: none; }
}

.field-help {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin: 0 0 0 4px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #3d4f66;
    vertical-align: middle;
    cursor: help;
    line-height: 1;
}
.field-help:hover,
.field-help:focus { z-index: 80; color: #0a2540; }
.field-help-icon { font-size: 13px; line-height: 1; }
.field-help-tip {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    bottom: auto;
    left: 0;
    transform: none;
    z-index: 80;
    width: max-content;
    max-width: min(22rem, calc(100vw - 3rem));
    padding: 10px 12px;
    border-radius: 6px;
    background: var(--ink);
    color: #fff;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.45;
    text-align: left;
    pointer-events: none;
    white-space: normal;
}
.field-help-tip::before {
    content: "";
    position: absolute;
    left: 6px;
    bottom: 100%;
    border: 6px solid transparent;
    border-bottom-color: var(--ink);
}
.field-help:hover .field-help-tip,
.field-help:focus .field-help-tip { display: block; }

.alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid #fed7aa;
    border-radius: 6px;
    border-left: 4px solid #c2410c;
    background: #fff7ed;
    color: #7c2d12;
    font-size: 14px;
    line-height: 1.5;
    box-shadow: 0 1px 2px rgba(10, 37, 64, 0.04);
}
.alert-success {
    background: #f0fdf4;
    border-color: #bbf7d0;
    border-left-color: #15803d;
    color: #14532d;
}
.alert-danger {
    background: #fef2f2;
    border-color: #fecaca;
    border-left-color: #b91c1c;
    color: #7f1d1d;
}
.msg-box-icon {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.72);
    font-size: 20px;
    line-height: 1;
}
.msg-box-main { min-width: 0; flex: 1; }

.auth-back-wrap {
    max-width: 1120px;
    margin: 0 auto;
    padding: 1rem 1.25rem 0;
}
.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--ink);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}
.auth-back:hover,
.auth-back:focus-visible {
    color: var(--teal);
}
