/* Auth — patient OTP & staff login */
.auth-page {
    margin: 0;
    min-height: 100vh;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
}

.auth-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.auth-bg-gradient {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 50% at 10% 0%, rgba(163, 24, 48, 0.2), transparent 55%),
        linear-gradient(165deg, #6e0716 0%, #9b0d22 45%, #7f0d18 100%);
}

.auth-page--patient .auth-bg-gradient {
    background:
        radial-gradient(ellipse 65% 45% at 90% 10%, rgba(163, 24, 48, 0.22), transparent 50%),
        linear-gradient(165deg, #7f0d18 0%, #c41e3a 35%, #6e0716 100%);
}

.auth-bg-grid {
    position: absolute;
    inset: 0;
    opacity: 0.06;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.15) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.15) 1px, transparent 1px);
    background-size: 40px 40px;
}

.auth-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(320px, 480px);
    max-width: 1100px;
    margin: 0 auto;
    padding: clamp(1rem, 3vw, 2rem);
    gap: clamp(1.5rem, 4vw, 3rem);
    align-items: center;
}

@media (max-width: 899.98px) {
    .auth-shell {
        grid-template-columns: 1fr;
        max-width: 440px;
    }
    .auth-aside-copy,
    .auth-aside-list {
        display: none;
    }
    .auth-aside {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        padding-bottom: 0.5rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    }
    .auth-aside-links {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}

.auth-aside {
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: #fff;
}

.auth-brand-mark {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.85rem;
    background: linear-gradient(135deg, #c41e3a, #7f0d18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 8px 24px rgba(196, 30, 58, 0.35);
}

.auth-brand-text {
    font-weight: 800;
    font-size: 1rem;
    line-height: 1.35;
    max-width: 14rem;
}

.auth-aside-copy h2 {
    font-size: clamp(1.35rem, 3vw, 1.75rem);
    font-weight: 800;
    margin: 0 0 0.65rem;
}

.auth-aside-copy p {
    margin: 0;
    opacity: 0.82;
    font-size: 0.92rem;
    line-height: 1.65;
    max-width: 22rem;
}

.auth-aside-list {
    list-style: none;
    padding: 0;
    margin: 1.25rem 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.auth-aside-list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 0.9;
}

.auth-aside-list i {
    color: #fecdd3;
}

.auth-aside-links {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.auth-aside-links a {
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: color 0.15s;
}

.auth-aside-links a:hover {
    color: #fff;
}

.auth-main {
    width: 100%;
}

.auth-card {
    background: #fff;
    border-radius: 1.25rem;
    padding: clamp(1.35rem, 4vw, 2rem);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.auth-card-head {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.35rem;
}

.auth-card-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.85rem;
    background: #fff1f2;
    color: #c41e3a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
}

.auth-page--staff .auth-card-icon {
    background: #ffe4e8;
    color: #6e0716;
}

.auth-card-head h1 {
    font-size: 1.2rem;
    font-weight: 800;
    margin: 0 0 0.25rem;
    color: #2a0a10;
}

.auth-card-head p {
    margin: 0;
    font-size: 0.82rem;
    color: #9f4d5a;
    font-weight: 600;
}

.auth-card .form-label {
    font-weight: 700;
    font-size: 0.85rem;
    color: #5c1a28;
}

.auth-card .btn-accent,
.auth-card .btn-primary {
    font-weight: 800;
    border-radius: 0.75rem;
    min-height: 48px;
}

.auth-card .alert {
    border-radius: 0.75rem;
    font-size: 0.85rem;
}

.auth-foot {
    text-align: center;
    margin-top: 1.25rem;
    margin-bottom: 0;
    font-size: 0.8rem;
    font-weight: 600;
}

.auth-foot a {
    color: #c41e3a;
    text-decoration: none;
}

.auth-foot a:hover {
    text-decoration: underline;
}

.auth-otp-display {
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: 0.35em;
    text-align: center;
    padding: 0.65rem;
    color: #7f0d18;
    background: #fff1f2;
    border-radius: 0.75rem;
}

.auth-role-hint {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 1rem;
}

.auth-role-hint span {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.25rem 0.55rem;
    border-radius: 2rem;
    background: #fff5f6;
    color: #9f4d5a;
}

/* —— Modern OTP PIN —— */
.auth-phone-chip {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 0.85rem;
    background: linear-gradient(135deg, #fff5f6, #ffe4e8);
    border: 1px solid #f5b8c4;
    border-radius: 0.85rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.auth-phone-chip > i {
    color: #c41e3a;
    font-size: 1.1rem;
}

.auth-phone-num {
    flex: 1;
    font-weight: 800;
    font-size: 0.95rem;
    color: #2a0a10;
    letter-spacing: 0.04em;
}

.auth-phone-change {
    font-size: 0.75rem;
    font-weight: 700;
    color: #c41e3a;
    text-decoration: none;
}

.auth-phone-change:hover {
    text-decoration: underline;
}

.otp-pin-wrap {
    margin-bottom: 1.25rem;
}

.otp-pin-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.65rem;
}

.otp-pin-label {
    font-weight: 800;
    font-size: 0.85rem;
    color: #5c1a28;
}

.otp-pin-progress {
    font-size: 0.75rem;
    font-weight: 700;
    color: #c47a88;
    font-variant-numeric: tabular-nums;
}

.otp-pin.is-complete ~ .otp-pin-hint,
.otp-pin-wrap:has(.otp-pin.is-complete) .otp-pin-progress {
    color: #16a34a;
}

.otp-pin-cells {
    display: flex;
    gap: clamp(0.35rem, 2vw, 0.55rem);
    justify-content: center;
}

.otp-pin-cell {
    width: clamp(2.65rem, 12vw, 3.25rem);
    height: clamp(3.1rem, 14vw, 3.75rem);
    border: 2px solid #f5b8c4;
    border-radius: 0.85rem;
    background: #fffafa;
    text-align: center;
    font-size: clamp(1.35rem, 5vw, 1.65rem);
    font-weight: 800;
    font-family: 'Vazirmatn', ui-monospace, monospace;
    color: #2a0a10;
    caret-color: #c41e3a;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s, transform 0.15s;
    padding: 0;
}

.otp-pin-cell:hover {
    border-color: #f0a8b8;
    background: #fff;
}

.otp-pin-cell:focus {
    outline: none;
    border-color: #c41e3a;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(163, 24, 48, 0.15);
    transform: translateY(-2px);
}

.otp-pin-cell.is-filled {
    border-color: #fda4af;
    background: #fff;
}

.otp-pin-cell.is-active {
    border-color: #c41e3a;
}

.otp-pin.is-complete .otp-pin-cell {
    border-color: #86efac;
    background: #f0fdf4;
}

.otp-pin.is-focused .otp-pin-cells {
    filter: drop-shadow(0 8px 24px rgba(163, 24, 48, 0.08));
}

.otp-pin.is-demo-fill .otp-pin-cell {
    animation: otp-cell-pop 0.35s ease;
}

@keyframes otp-cell-pop {
    0% { transform: scale(0.92); }
    50% { transform: scale(1.06); }
    100% { transform: scale(1); }
}

.otp-pin-hint {
    text-align: center;
    margin: 0.65rem 0 0;
    font-size: 0.75rem;
    font-weight: 600;
    color: #c47a88;
}

.auth-otp-form.has-error .otp-pin-cell {
    border-color: #f87171;
    animation: otp-shake 0.45s ease;
}

@keyframes otp-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

.otp-shake {
    animation: otp-shake 0.45s ease;
}

.otp-submit-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.otp-submit-btn:not(:disabled) {
    box-shadow: 0 8px 24px rgba(163, 24, 48, 0.25);
}

.auth-page--staff .otp-submit-btn:not(:disabled) {
    box-shadow: 0 8px 24px rgba(74, 8, 18, 0.2);
}

.otp-demo-banner {
    border-radius: 1rem;
    overflow: hidden;
}

.otp-demo-fill {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border: 1px dashed #fda4af;
    border-radius: 1rem;
    background: linear-gradient(135deg, #fff1f2, #ffe4e6);
    cursor: pointer;
    text-align: right;
    transition: transform 0.15s, box-shadow 0.15s;
}

.otp-demo-fill:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(163, 24, 48, 0.12);
}

.otp-demo-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.65rem;
    background: #c41e3a;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.otp-demo-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.otp-demo-title {
    font-size: 0.72rem;
    font-weight: 700;
    color: #7f0d18;
}

.otp-demo-digits {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0.25em;
    color: #2a0a10;
}

.otp-demo-cta {
    font-size: 0.7rem;
    font-weight: 800;
    color: #c41e3a;
    white-space: nowrap;
}

.auth-card:has(.otp-pin-wrap) {
    padding-bottom: 1.5rem;
}

.auth-card:has(.otp-pin-wrap) .auth-card-head {
    margin-bottom: 1rem;
}

.auth-captcha {
    padding: 0.85rem 1rem;
    border-radius: 0.85rem;
    background: #fffafa;
    border: 1px solid #f5b8c4;
}

.turnstile-field {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem;
    border-radius: 0.85rem;
    background: #fffafa;
    border: 1px solid #f5b8c4;
}

.turnstile-field .cf-turnstile {
    min-height: 65px;
}

.auth-hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}
