/* ═══════════════════════════════════════════════════════════
   AUTH PAGES — white translucent form on a soft, image-free stage
   navy #0D1F2D · teal #0F8B88 · mint #5ed4d0 · gray #E8ECEF
   ═══════════════════════════════════════════════════════════ */
@keyframes auFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(24px, -20px) scale(1.06); }
}
@keyframes auRing {
    to { transform: rotate(360deg); }
}
@keyframes auCardIn {
    from { opacity: 0; transform: translateY(22px) scale(.98); }
    to   { opacity: 1; transform: none; }
}
@keyframes auShine {
    to { transform: translateX(130%); }
}
@keyframes auSpark {
    0%   { transform: translate(0, 0) scale(0); opacity: 1; }
    100% { transform: translate(var(--sx), var(--sy)) scale(1); opacity: 0; }
}
@keyframes auPlaneOut {
    0%   { transform: translate(0, 0) rotate(0); opacity: 1; }
    60%  { transform: translate(34px, -26px) rotate(-18deg); opacity: 0; }
    61%  { transform: translate(-30px, 22px) rotate(0); opacity: 0; }
    100% { transform: translate(0, 0) rotate(0); opacity: 1; }
}
@keyframes auCheckPop {
    0%   { transform: scale(0) rotate(-30deg); opacity: 0; }
    70%  { transform: scale(1.25) rotate(5deg); opacity: 1; }
    100% { transform: scale(1) rotate(0); opacity: 1; }
}
@keyframes auPulseRing {
    0%   { transform: scale(.6); opacity: .8; }
    100% { transform: scale(2.2); opacity: 0; }
}
@keyframes auKeyTurn {
    0%   { transform: rotate(0); }
    50%  { transform: rotate(90deg); }
    100% { transform: rotate(90deg); }
}
@keyframes auResend {
    to { transform: rotate(-360deg); }
}

/* ── stage ── */
.au-body {
    margin: 0;
    min-height: 100vh;
    font-family: "Tajawal", sans-serif;
    color: #0D1F2D;
    background:
        radial-gradient(60% 50% at 0% 0%, rgba(15, 139, 136, .16), transparent 60%),
        radial-gradient(50% 45% at 100% 100%, rgba(13, 31, 45, .12), transparent 60%),
        linear-gradient(180deg, #f6f9fa 0%, #eef3f4 100%);
    overflow-x: hidden;
}
.au-stage {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 84px 16px 40px;
}
.au-blob {
    position: absolute;
    z-index: 0;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(2px);
    animation: auFloat 12s ease-in-out infinite;
}
.au-blob--1 {
    top: -140px;
    inset-inline-start: -120px;
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, rgba(15, 139, 136, .22), transparent 68%);
}
.au-blob--2 {
    bottom: -160px;
    inset-inline-end: -140px;
    width: 460px;
    height: 460px;
    background: radial-gradient(circle, rgba(94, 212, 208, .22), transparent 68%);
    animation-delay: -6s;
}
.au-ring {
    position: absolute;
    z-index: 0;
    border-radius: 50%;
    border: 1px dashed rgba(15, 139, 136, .35);
    pointer-events: none;
    animation: auRing 60s linear infinite;
}
.au-ring--1 { width: 620px; height: 620px; top: 50%; left: 50%; margin: -310px 0 0 -310px; }
.au-ring--2 { width: 860px; height: 860px; top: 50%; left: 50%; margin: -430px 0 0 -430px; border-style: solid; border-color: rgba(13, 31, 45, .06); animation-direction: reverse; animation-duration: 90s; }

/* home pill */
.au-home {
    position: fixed;
    z-index: 5;
    top: 18px;
    inset-inline-start: 18px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .8);
    border: 1px solid #E8ECEF;
    color: #0D1F2D;
    font-weight: 700;
    font-size: .9rem;
    text-decoration: none;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 20px rgba(13, 31, 45, .06);
    transition: all .3s ease;
}
.au-home i { color: #0F8B88; transition: transform .3s ease; }
.au-home:hover { color: #0F8B88; transform: translateY(-2px); box-shadow: 0 12px 26px rgba(15, 139, 136, .18); }
.au-home:hover i { transform: translateX(-3px); }
html[dir="ltr"] .au-home:hover i { transform: translateX(3px); }

/* ── card ── */
.au-card {
    position: relative;
    z-index: 1;
    width: min(480px, 100%);
    padding: 36px 34px 30px;
    border-radius: 28px;
    background: rgba(255, 255, 255, .82);
    border: 1px solid rgba(255, 255, 255, .9);
    box-shadow: 0 30px 70px -30px rgba(13, 31, 45, .35), 0 0 0 1px #E8ECEF;
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    animation: auCardIn .6s cubic-bezier(.22, 1, .36, 1);
}
.au-card::before {
    content: "";
    position: absolute;
    top: 0;
    inset-inline: 40px;
    height: 3px;
    border-radius: 3px;
    background: linear-gradient(90deg, transparent, #0F8B88, #5ed4d0, transparent);
}
.au-card--wide { width: min(560px, 100%); }
.au-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 14px;
}
.au-logo img {
    height: 74px;
    width: auto;
}
.au-head {
    text-align: center;
    margin-bottom: 24px;
}
.au-head h1 {
    margin: 0 0 6px;
    font-size: 1.6rem;
    font-weight: 900;
    color: #0D1F2D;
}
.au-head p {
    margin: 0;
    color: #6b7a83;
    font-size: .95rem;
    line-height: 1.8;
}
.au-head b { color: #0F8B88; direction: ltr; unicode-bidi: isolate; }

/* ── fields (floating labels) ── */
.au-field {
    position: relative;
    margin-bottom: 16px;
}
.au-field input {
    width: 100%;
    height: 56px;
    padding: 20px 16px 6px;
    border-radius: 14px;
    border: 1.5px solid #E8ECEF;
    background: rgba(255, 255, 255, .9);
    color: #0D1F2D;
    font-family: "Tajawal", sans-serif;
    font-size: 1rem;
    font-weight: 700;
    outline: none;
    transition: border-color .25s ease, box-shadow .25s ease, background .25s ease;
}
.au-field label {
    position: absolute;
    top: 50%;
    inset-inline-start: 16px;
    transform: translateY(-50%);
    color: #8a97a0;
    font-size: .95rem;
    font-weight: 600;
    pointer-events: none;
    transition: all .2s ease;
}
.au-field input:focus,
.au-field input:not(:placeholder-shown) {
    background: #fff;
}
.au-field input:focus {
    border-color: #0F8B88;
    box-shadow: 0 0 0 4px rgba(15, 139, 136, .14);
}
.au-field input:focus + label,
.au-field input:not(:placeholder-shown) + label {
    top: 10px;
    transform: none;
    font-size: .72rem;
    color: #0F8B88;
    font-weight: 800;
}
/* phone prefix */
.au-field--prefix input { padding-inline-end: 110px; }
/* الحشوة تُثبَّت بجهة فعلية لأن direction: ltr داخلها يعكس الخصائص المنطقية */
.au-prefix {
    position: absolute;
    top: 50%;
    left: 8px;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 10px;
    background: #f3f6f7;
    border: 1px solid #E8ECEF;
    font-weight: 800;
    font-size: .85rem;
    color: #0D1F2D;
    direction: ltr;
}
html[dir="ltr"] .au-prefix { left: auto; right: 8px; }
.au-prefix img { width: 20px; height: 14px; object-fit: cover; border-radius: 3px; }
/* password eye */
.au-field--icon input { padding-inline-end: 52px; }
.au-eye {
    position: absolute;
    top: 50%;
    inset-inline-end: 8px;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 0;
    background: transparent;
    color: #8a97a0;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: all .25s ease;
}
.au-eye:hover { background: rgba(15, 139, 136, .1); color: #0F8B88; }
.au-captcha { margin-bottom: 16px; display: flex; justify-content: center; }
/* options row */
.au-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 2px 0 20px;
    font-size: .9rem;
}
.au-link {
    position: relative;
    color: #0F8B88;
    font-weight: 700;
    text-decoration: none;
}
.au-link::after {
    content: "";
    position: absolute;
    inset-inline: 0;
    bottom: -2px;
    height: 2px;
    border-radius: 2px;
    background: #0F8B88;
    transform: scaleX(0);
    transform-origin: 0 50%;
    transition: transform .3s ease;
}
.au-link:hover { color: #0c6f6c; }
.au-link:hover::after { transform: scaleX(1); }
.au-switch {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: #5b6b73;
    font-weight: 600;
    user-select: none;
}
.au-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.au-switch__track {
    position: relative;
    width: 40px;
    height: 22px;
    border-radius: 999px;
    background: #E8ECEF;
    transition: background .3s ease;
}
.au-switch__track::after {
    content: "";
    position: absolute;
    top: 3px;
    inset-inline-start: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(13, 31, 45, .25);
    transition: transform .3s cubic-bezier(.34, 1.56, .64, 1);
}
.au-switch input:checked + .au-switch__track { background: #0F8B88; }
.au-switch input:checked + .au-switch__track::after { transform: translateX(18px); }
html[dir="rtl"] .au-switch input:checked + .au-switch__track::after { transform: translateX(-18px); }
.au-foot {
    margin-top: 18px;
    text-align: center;
    color: #6b7a83;
    font-size: .92rem;
}
.au-foot .au-link { margin-inline-start: 4px; }

/* ── buttons: shared base ── */
.au-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    min-height: 56px;
    padding: 0 22px;
    border: 0;
    border-radius: 14px;
    font-family: "Tajawal", sans-serif;
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
    cursor: pointer;
    overflow: hidden;
    isolation: isolate;
    transition: transform .4s cubic-bezier(.34, 1.56, .64, 1), box-shadow .4s ease, background .4s ease;
}
.au-btn:hover { transform: translateY(-3px); }
.au-btn:active { transform: translateY(0) scale(.99); }
.au-btn .btn-text { position: relative; z-index: 1; }
.au-btn__ico {
    position: relative;
    z-index: 1;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    font-size: 1rem;
}
.au-btn .spinner-border { width: 22px; height: 22px; border-width: 2px; }

/* 1) LOGIN — a door that opens (shared .btn-door structure) */
.au-btn--login {
    background: #0D1F2D;
    box-shadow: 0 10px 24px rgba(13, 31, 45, .25);
}
.au-btn--login:hover {
    box-shadow: 0 18px 34px rgba(15, 139, 136, .35);
    background: #12293a;
}
.au-btn--login .btn-door__frame {
    position: relative;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: #000;
    border: 1.5px solid rgba(94, 212, 208, .45);
}
.au-btn--login .btn-door__glow { position: absolute; inset: 0; z-index: 1; background: radial-gradient(circle, #5ed4d0, #0F8B88 60%); opacity: 0; transition: opacity .35s ease .1s; }
.au-btn--login .btn-door__leaf { position: absolute; top: 0; width: 50%; height: 100%; z-index: 2; transition: transform .5s cubic-bezier(.4, 0, .2, 1); }
.au-btn--login .btn-door__leaf--l { left: 0; background: linear-gradient(135deg, #2a5568, #12293a); border-right: 1px solid rgba(94, 212, 208, .5); }
.au-btn--login .btn-door__leaf--r { right: 0; background: linear-gradient(225deg, #2a5568, #12293a); border-left: 1px solid rgba(94, 212, 208, .5); }
.au-btn--login .btn-door__leaf i { position: absolute; top: 50%; width: 3px; height: 3px; border-radius: 50%; background: #5ed4d0; transform: translateY(-50%); }
.au-btn--login .btn-door__leaf--l i { right: 3px; }
.au-btn--login .btn-door__leaf--r i { left: 3px; }
.au-btn--login:hover .btn-door__leaf--l { transform: translateX(-100%); }
.au-btn--login:hover .btn-door__leaf--r { transform: translateX(100%); }
.au-btn--login:hover .btn-door__glow { opacity: 1; }

/* 2) REGISTER — a user-plus icon bursting with sparks */
.au-btn--register {
    background: linear-gradient(120deg, #0F8B88, #12a19d);
    box-shadow: 0 10px 24px rgba(15, 139, 136, .3);
}
.au-btn--register:hover { box-shadow: 0 18px 34px rgba(15, 139, 136, .42); }
.au-btn--register::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, .35) 50%, transparent 70%);
    transform: translateX(-130%);
}
.au-btn--register:hover::after { animation: auShine .7s ease forwards; }
.au-btn--register .au-btn__ico { background: rgba(255, 255, 255, .16); overflow: visible; transition: transform .4s cubic-bezier(.34, 1.56, .64, 1); }
.au-btn--register:hover .au-btn__ico { transform: scale(1.12) rotate(-8deg); }
.au-spark {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    margin: -3px 0 0 -3px;
    border-radius: 50%;
    background: #fff;
    opacity: 0;
    pointer-events: none;
}
.au-btn--register:hover .au-spark { animation: auSpark .7s ease-out forwards; }
.au-spark:nth-child(1) { --sx: -22px; --sy: -18px; }
.au-spark:nth-child(2) { --sx: 22px;  --sy: -20px; animation-delay: .05s; }
.au-spark:nth-child(3) { --sx: 26px;  --sy: 10px;  animation-delay: .1s; }
.au-spark:nth-child(4) { --sx: -26px; --sy: 12px;  animation-delay: .08s; }
.au-spark:nth-child(5) { --sx: 0;     --sy: -26px; animation-delay: .12s; }
.au-spark:nth-child(6) { --sx: 4px;   --sy: 26px;  animation-delay: .15s; }

/* 3) OTP — shield gets its check with a pulse ring */
.au-btn--otp {
    background: linear-gradient(120deg, #0D1F2D, #123544);
    box-shadow: 0 10px 24px rgba(13, 31, 45, .28);
}
.au-btn--otp:hover { background: linear-gradient(120deg, #0F8B88, #0c6f6c); box-shadow: 0 18px 34px rgba(15, 139, 136, .4); }
.au-btn--otp .au-btn__ico { background: rgba(255, 255, 255, .12); overflow: visible; }
.au-btn--otp .au-shield { position: relative; display: grid; place-items: center; width: 100%; height: 100%; }
.au-btn--otp .au-shield > i { grid-area: 1 / 1; }
.au-btn--otp .au-shield .fa-shield { color: #5ed4d0; font-size: 1.05rem; }
.au-btn--otp .au-shield .fa-check { color: #0D1F2D; font-size: .55rem; opacity: 0; transform: scale(0); }
.au-btn--otp:hover .au-shield .fa-shield { color: #fff; }
.au-btn--otp:hover .au-shield .fa-check { animation: auCheckPop .5s cubic-bezier(.34, 1.56, .64, 1) forwards; }
.au-btn--otp .au-shield::before {
    content: "";
    position: absolute;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid #5ed4d0;
    opacity: 0;
}
.au-btn--otp:hover .au-shield::before { animation: auPulseRing .9s ease-out forwards; }

/* 4) SEND CODE — the paper plane takes off and returns */
.au-btn--send {
    background: linear-gradient(120deg, #0F8B88, #0c6f6c);
    box-shadow: 0 10px 24px rgba(15, 139, 136, .3);
}
.au-btn--send:hover { box-shadow: 0 18px 34px rgba(15, 139, 136, .42); }
.au-btn--send .au-btn__ico { background: rgba(255, 255, 255, .16); overflow: hidden; }
.au-btn--send .au-btn__ico i { display: block; }
.au-btn--send:hover .au-btn__ico i { animation: auPlaneOut 1s ease-in-out forwards; }
html[dir="rtl"] .au-btn--send .au-btn__ico i { transform: scaleX(-1); }
.au-btn--send .au-trail {
    position: absolute;
    inset-inline-start: 0;
    bottom: 0;
    height: 3px;
    width: 0;
    background: linear-gradient(90deg, transparent, #5ed4d0);
    transition: width .6s ease;
}
.au-btn--send:hover .au-trail { width: 100%; }

/* 5) RESET — the key turns and the lock opens */
.au-btn--reset {
    background: #0D1F2D;
    box-shadow: 0 10px 24px rgba(13, 31, 45, .28);
}
.au-btn--reset:hover { background: #0F8B88; box-shadow: 0 18px 34px rgba(15, 139, 136, .4); }
.au-btn--reset .au-btn__ico { background: rgba(255, 255, 255, .12); }
.au-btn--reset .au-lock { position: relative; display: grid; place-items: center; width: 100%; height: 100%; }
.au-btn--reset .au-lock > i { grid-area: 1 / 1; transition: opacity .3s ease, transform .5s ease; }
.au-btn--reset .au-lock .fa-key { color: #5ed4d0; }
.au-btn--reset .au-lock .fa-lock-open { color: #fff; opacity: 0; transform: translateY(6px); }
.au-btn--reset:hover .au-lock .fa-key { animation: auKeyTurn .6s ease forwards; opacity: 0; transition-delay: .35s; }
.au-btn--reset:hover .au-lock .fa-lock-open { opacity: 1; transform: none; transition-delay: .35s; }

/* resend (ghost) */
.au-resend {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1.5px solid #E8ECEF;
    background: #fff;
    color: #0D1F2D;
    font-family: "Tajawal", sans-serif;
    font-weight: 700;
    font-size: .85rem;
    cursor: pointer;
    transition: all .3s ease;
}
.au-resend i { color: #0F8B88; }
.au-resend:hover:not(:disabled) { border-color: #0F8B88; color: #0F8B88; }
.au-resend:hover:not(:disabled) i { animation: auResend .7s ease; }
.au-resend:disabled { opacity: .5; cursor: not-allowed; }
.au-timer {
    font-weight: 800;
    color: #0F8B88;
    font-variant-numeric: tabular-nums;
}
.au-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 6px 0 18px;
}

/* ── OTP boxes ── */
.au-otp {
    display: flex;
    justify-content: center;
    gap: 10px;
    direction: ltr;
    margin: 6px 0 16px;
}
.au-otp input {
    width: 56px;
    height: 64px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 900;
    color: #0D1F2D;
    border-radius: 14px;
    border: 1.5px solid #E8ECEF;
    background: rgba(255, 255, 255, .9);
    outline: none;
    transition: all .25s ease;
}
.au-otp input:focus {
    border-color: #0F8B88;
    box-shadow: 0 0 0 4px rgba(15, 139, 136, .14);
    transform: translateY(-2px);
}
.au-otp input:not(:placeholder-shown) { background: rgba(15, 139, 136, .08); border-color: rgba(15, 139, 136, .35); }

@media (max-width: 575px) {
    .au-stage { padding: 76px 12px 28px; }
    .au-card { padding: 28px 20px 24px; border-radius: 22px; }
    .au-otp input { width: 48px; height: 56px; font-size: 1.3rem; }
    .au-options { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
    .au-blob, .au-ring, .au-card { animation: none; }
}
