:root {
    color-scheme: light;
    --auth-primary: #263492;
    --auth-primary-hover: #1d2879;
    --auth-ink: #202b43;
    --auth-muted: #66728a;
    --auth-border: #dce2ed;
    --auth-error: #ae2838;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: #f5f7fb; color: var(--auth-ink); font-family: 'Tajawal', sans-serif; font-size: 16px; line-height: 1.6; }
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
a { color: var(--auth-primary); text-decoration: none; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .6; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid #8895dd; outline-offset: 4px; }
.auth-page { min-height: 100vh; min-height: 100svh; padding: 30px 40px 22px; display: flex; flex-direction: column; justify-content: center; }
.auth-header, .auth-footer { width: 100%; max-width: 1100px; margin-inline: auto; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.auth-header { margin-bottom: 26px; }
.auth-identity { display: inline-flex; gap: 13px; align-items: center; color: var(--auth-ink); }
.auth-identity img { object-fit: contain; }
.auth-identity strong, .auth-identity small { display: block; }
.auth-identity strong { font-size: 22px; font-weight: 800; line-height: 1.35; }
.auth-identity small { color: var(--auth-muted); font-size: 12px; margin-top: 3px; }
.home-link { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; color: #53617b; min-height: 44px; }
.home-link:hover { color: var(--auth-primary); }
.auth-shell { width: 100%; max-width: 1100px; margin-inline: auto; display: grid; grid-template-columns: .94fr 1.06fr; background: white; border: 1px solid #e2e7f0; border-radius: 26px; box-shadow: 0 14px 50px -30px #25356240; overflow: hidden; }
.auth-story { background: #eff2fb; padding: 52px 43px 32px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; position: relative; }
.story-eyebrow { display: inline-flex; align-items: center; gap: 9px; font-size: 13px; color: #53638b; font-weight: 500; }
.story-eyebrow > span { height: 6px; width: 6px; background: #596bc1; border-radius: 50%; }
.story-heading h2 { font-size: clamp(36px, 3.1vw, 46px); line-height: 1.4; margin: 24px 0 15px; color: #23336e; font-weight: 800; letter-spacing: -.6px; }
.story-heading p { font-size: 16px; line-height: 1.9; margin: 0; color: #637195; }
.energy-map { position: relative; width: 100%; max-width: 360px; margin: 14px auto 5px; aspect-ratio: 3 / 2; }
.energy-map svg { width: 100%; height: 100%; display: block; }
.energy-flow { opacity: 0; pointer-events: none; }
.map-label { position: absolute; background: #ffffffed; border: 1px solid #e1e6f3; border-radius: 10px; padding: 8px 12px; color: #53618a; font-size: 12px; display: flex; gap: 8px; align-items: center; box-shadow: 0 7px 16px -12px #24357355; }
.map-label i { font-size: 15px; color: #5264ac; }
.map-operations { top: 10%; right: 1%; }
.map-subscribers { bottom: 15%; left: 1%; }
.map-reports { bottom: 5%; right: 1%; }
.story-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.story-note { font-size: 13px; color: #5e6d8b; display: flex; align-items: center; gap: 10px; }
.note-line { display: block; width: 25px; height: 1px; background: #a7b4d6; }
.auth-form-area { min-width: 0; min-height: 620px; padding: 52px 55px; display: flex; flex-direction: column; justify-content: center; }
.auth-panel { width: 100%; max-width: 410px; margin-inline: auto; }
.form-eyebrow { font-size: 12px; font-weight: 700; color: #66728a; letter-spacing: .2px; margin: 0 0 7px; }
.auth-panel h1 { font-size: 30px; font-weight: 800; line-height: 1.5; margin: 0 0 8px; letter-spacing: -.4px; }
.form-description { color: var(--auth-muted); font-size: 15px; line-height: 1.8; margin: 0 0 30px; }
.field { margin-bottom: 20px; }
.field-label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 8px; color: #36435d; }
.input-box { position: relative; }
.input-box input, .otp-input { width: 100%; height: 53px; border: 1px solid var(--auth-border); border-radius: 10px; padding: 12px 43px 12px 14px; color: var(--auth-ink); background: #fff; transition: border-color .15s, box-shadow .15s; font-size: 15px; }
.input-box input::placeholder { color: #66728a; font-size: 14px; }
.input-box input:focus, .otp-input:focus { border-color: #6577c7; box-shadow: 0 0 0 3px #2634920d; outline: none; }
.input-box input:disabled { background: #f7f8fb; }
.input-box > .icon { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-size: 18px; color: #94a0b6; pointer-events: none; }
.has-toggle input { padding-left: 52px; }
.toggle-pw { position: absolute; left: 5px; top: 4px; height: 45px; width: 43px; display: grid; place-items: center; color: #7d8aa3; border: 0; border-radius: 7px; background: transparent; font-size: 18px; }
.toggle-pw:hover { background: #f2f4fa; color: var(--auth-primary); }
.meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 0 25px; font-size: 14px; }
.remember { display: inline-flex; align-items: center; gap: 8px; color: #5c6881; cursor: pointer; min-height: 32px; }
.remember input { margin: 0; width: 16px; height: 16px; accent-color: var(--auth-primary); }
.forgot { font-weight: 700; padding-block: 6px; }
.forgot:hover, .back-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.btn-primary, .btn-secondary { min-height: 52px; width: 100%; border-radius: 10px; display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 16px; font-weight: 700; transition: background .15s, box-shadow .15s; }
.btn-primary { background: var(--auth-primary); color: white; border: 1px solid var(--auth-primary); box-shadow: 0 5px 12px -7px #26349280; }
.btn-primary:hover:not(:disabled) { background: var(--auth-primary-hover); box-shadow: 0 7px 16px -8px #26349280; }
.btn-secondary { background: white; border: 1px solid var(--auth-border); color: #53617e; margin-top: 12px; }
.btn-secondary:hover:not(:disabled) { background: #f6f8fc; }
.auth-footer { flex-direction: column; gap: 5px; color: var(--auth-muted); font-size: 12px; text-align: center; margin-top: 22px; }
.auth-approval { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 23px 0 0; color: var(--auth-muted); font-size: 12px; text-align: center; }
.auth-approval > i { flex: 0 0 auto; color: #16824b; font-size: 16px; }
.alert-box, .reset-msg:not(:empty) { border-radius: 9px; padding: 11px 13px; margin: 0 0 18px; font-size: 13px; line-height: 1.75; overflow-wrap: anywhere; }
.alert-box, .reset-msg.error:not(:empty) { color: var(--auth-error); border: 1px solid #f2d9dd; background: #fff5f6; }
.alert-box { display: flex; align-items: flex-start; gap: 9px; }
.reset-msg.success:not(:empty) { color: #26725d; background: #f0faf6; border: 1px solid #d6ede3; }
.input-error input { border-color: #c74a5c; }
.back-link { display: inline-flex; align-items: center; gap: 8px; color: #667393; background: none; border: 0; padding: 0; margin: 0 0 22px; min-height: 30px; font-size: 13px; }
.recovery-progress { display: flex; justify-content: space-between; list-style: none; padding: 0; margin: 0 0 27px; position: relative; }
.recovery-progress::before { content: ''; position: absolute; height: 1px; background: #e4e8f1; right: 33px; left: 33px; top: 16px; }
.recovery-progress li { position: relative; display: flex; align-items: center; flex-direction: column; gap: 6px; min-width: 65px; color: #66728a; font-size: 11px; }
.recovery-progress li > span { display: grid; place-items: center; width: 33px; height: 33px; border-radius: 50%; background: white; border: 1px solid #e1e6ef; font-size: 13px; font-weight: 700; }
.recovery-progress li[data-state='current'] { color: var(--auth-primary); font-weight: 700; }
.recovery-progress li[data-state='current'] > span { color: white; background: var(--auth-primary); border-color: var(--auth-primary); box-shadow: 0 0 0 4px white; }
.recovery-progress li[data-state='complete'] { color: #45806f; }
.recovery-progress li[data-state='complete'] > span { color: #34806b; background: #edf7f3; border-color: #d6e9e1; }
.recovery-panel h1 { font-size: 27px; }
.recovery-panel .form-description { margin-bottom: 24px; font-size: 14px; }
.otp-hint { color: #66728a; font-size: 12px; line-height: 1.8; margin-top: 9px; }
.otp-input { padding-inline: 16px; text-align: center; letter-spacing: 14px; font-size: 23px; }
.otp-input::placeholder { color: #adb6c8; }
.phone-summary { margin: -5px 0 20px; font-size: 13px; color: #66728a; }
.phone-summary bdi { font-weight: 700; color: #425575; letter-spacing: 1px; margin-inline-start: 4px; }
.btn-change-phone { display: block; margin: 10px auto 0; padding: 6px 10px; min-height: 34px; font-size: 13px; border: 0; background: transparent; color: #52649b; }
.btn-change-phone:hover { text-decoration: underline; }
#resetPasswordForm[data-phase='otp'] #sendOTPButton { margin-top: 12px; background: white; color: #53617e; border-color: var(--auth-border); box-shadow: none; font-size: 14px; min-height: 46px; }
#resetPasswordForm[data-phase='otp'] #sendOTPButton:hover:not(:disabled) { background: #f6f8fc; }
.reset-complete { text-align: center; padding: 4px 0 20px; }
.complete-icon, .lock-symbol { display: grid; place-items: center; width: 56px; height: 56px; margin: 0 auto 17px; border-radius: 17px; font-size: 24px; background: #edf7f3; color: #35836b; }
.reset-complete p { font-size: 14px; color: var(--auth-muted); }
.lock-panel { text-align: center; }
.lock-symbol { background: #f0f2fc; color: #4756a1; }
.lock-panel .field { text-align: right; }
.lock-user { display: flex; gap: 12px; text-align: right; align-items: center; border: 1px solid #e7ebf3; background: #fafbfd; border-radius: 12px; padding: 13px 16px; margin: 24px 0; }
.avatar, .avatar-fallback { flex: 0 0 42px; width: 42px; height: 42px; border-radius: 50%; object-fit: cover; }
.avatar-fallback { display: flex; align-items: center; justify-content: center; background: #e8edf9; color: #4b60a2; font-size: 19px; font-weight: 700; }
.user-name { margin: 0; font-size: 15px; font-weight: 700; }
.user-role { margin: 1px 0 0; font-size: 12px; color: #66728a; }
.lock-time { margin: 20px 0 0; color: #66728a; font-size: 12px; }
.spinner { display: inline-block; width: 19px; height: 19px; border: 2px solid #ffffff60; border-top-color: white; border-radius: 50%; animation: auth-spin .7s linear infinite; }
.honeypot { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%); white-space: nowrap; }
@keyframes auth-spin { to { transform: rotate(360deg); } }
@keyframes auth-enter {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes auth-panel-enter {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes energy-travel {
    0% { opacity: 0; stroke-dashoffset: 0; }
    15%, 80% { opacity: .8; }
    100% { opacity: 0; stroke-dashoffset: -328; }
}
@keyframes energy-orbit {
    to { stroke-dashoffset: -44; }
}
@keyframes energy-breathe {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.08); opacity: .5; }
}
@keyframes energy-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}
@media (prefers-reduced-motion: no-preference) {
    .auth-header { animation: auth-enter .45s cubic-bezier(.2, .7, .2, 1) backwards; }
    .auth-shell { animation: auth-enter .6s cubic-bezier(.2, .7, .2, 1) .06s backwards; }
    .auth-footer { animation: auth-enter .45s ease-out .16s backwards; }
    .auth-panel:not([hidden]), #resetPhoneSection:not([hidden]), #otpSection:not([hidden]), #newPasswordSection:not([hidden]), #resetCompleteHint:not([hidden]) { animation: auth-panel-enter .24s ease-out backwards; }
    .energy-flow { animation: energy-travel 8s linear infinite; }
    .energy-orbit { animation: energy-orbit 18s linear infinite; }
    .energy-ring { transform-box: fill-box; transform-origin: center; animation: energy-breathe 6s ease-in-out infinite; }
    .map-label { animation: energy-float 6.8s ease-in-out infinite; }
    .map-subscribers { animation-duration: 7.6s; animation-delay: -2s; }
    .map-reports { animation-duration: 8.4s; animation-delay: -4s; }
    .btn-primary, .btn-secondary { transition: background .15s, box-shadow .15s, transform .16s ease-out; }
    .btn-primary:active:not(:disabled), .btn-secondary:active:not(:disabled) { transform: scale(.99); }
    .input-box > .icon { transition: color .18s; }
    .recovery-progress li > span { transition: color .18s, background-color .18s, border-color .18s, box-shadow .18s; }
}
.input-box:focus-within > .icon { color: var(--auth-primary); }
@media (prefers-reduced-motion: no-preference) and (hover: hover) and (pointer: fine) {
    .btn-primary:hover:not(:disabled), .btn-secondary:hover:not(:disabled) { transform: translateY(-1px); }
    .btn-primary:active:not(:disabled), .btn-secondary:active:not(:disabled) { transform: translateY(0) scale(.99); }
}
@media (max-width: 1000px) {
    .auth-page { padding: 26px 28px 22px; }
    .auth-story { padding: 40px 28px 30px; }
    .auth-form-area { padding: 40px 32px; }
    .story-heading h2 { font-size: 38px; }
    .story-heading p { font-size: 14px; }
}
@media (max-width: 740px) {
    .auth-page { padding: 23px 20px 20px; justify-content: flex-start; }
    .auth-header, .auth-footer, .auth-shell { max-width: 510px; }
    .auth-header { margin-bottom: 24px; }
    .auth-identity img { width: 45px; height: 45px; }
    .auth-identity { gap: 9px; }
    .auth-identity strong { font-size: 19px; }
    .auth-identity small { font-size: 10px; }
    .home-link { font-size: 12px; gap: 5px; }
    .auth-story { display: none; }
    .auth-shell { display: block; border-radius: 20px; }
    .auth-form-area { min-height: 510px; padding: 35px 27px; }
    .auth-panel h1 { font-size: 28px; }
    .recovery-panel h1 { font-size: 25px; }
    .form-description { font-size: 14px; }
}
@media (max-width: 380px) {
    .auth-page { padding-inline: 14px; }
    .auth-form-area { padding-inline: 21px; }
    .home-link span { display: none; }
    .home-link { width: 40px; justify-content: center; font-size: 17px; }
    .meta { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
