:root {
    --auth-red: #c80000;
    --auth-red-dark: #a90000;
    --auth-red-soft: rgba(200, 0, 0, .10);
    --auth-cyan: #0aa3ad;
    --auth-cyan-dark: #087f88;
    --auth-ink: #1f2933;
    --auth-muted: #6b7280;
    --auth-line: rgba(156, 163, 175, .42);
    --auth-card: rgba(255, 255, 255, .78);
    --auth-card-strong: rgba(255, 255, 255, .92);
    --auth-shadow: 0 22px 60px rgba(15, 23, 42, .13);
    --auth-font: 'Vazirmatn', 'IRANSansX', Tahoma, Arial, sans-serif;
}

html,
body.auth-body {
    min-height: 100%;
}

body.auth-body {
    margin: 0;
    font-family: var(--auth-font);
    background: #f7f8f8;
    color: var(--auth-ink);
}

.auth-page {
    position: relative;
    isolation: isolate;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(20px, 4vh, 34px) 18px;
    overflow-x: hidden;
    overflow-y: auto;
    background-image: url('/images/auth/shirinpolo-auth-desktop.png');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
}

.auth-page::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(circle at 50% 44%, rgba(255, 255, 255, .78) 0 17%, rgba(255, 255, 255, .24) 35%, rgba(255, 255, 255, 0) 58%),
        linear-gradient(180deg, rgba(255, 255, 255, .24), rgba(255, 255, 255, .04));
    pointer-events: none;
}

.auth-card {
    width: min(100%, 416px);
    min-height: 548px;
    padding: 40px 36px 34px;
    border: 1px solid rgba(255, 255, 255, .80);
    border-radius: 16px;
    background: linear-gradient(180deg, var(--auth-card-strong), var(--auth-card));
    box-shadow: var(--auth-shadow);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    animation: authCardIn .45s ease both;
}

@keyframes authCardIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.auth-brand {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 24px;
    text-decoration: none;
}

.auth-brand__logo {
    display: block;
    width: 168px;
    max-width: 72%;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 12px 18px rgba(200, 0, 0, .12));
}

.auth-card__content {
    width: 100%;
}

.auth-header {
    margin: 0 0 22px;
    text-align: center;
}

.auth-title {
    margin: 0;
    color: #1f2937;
    font-size: 18px;
    font-weight: 800;
    line-height: 1.9;
    letter-spacing: -.01em;
}

.auth-description {
    margin: 4px 0 0;
    color: #5f6874;
    font-size: 14px;
    font-weight: 400;
    line-height: 2;
}

.auth-status {
    margin-bottom: 16px;
    padding: 10px 14px;
    border: 1px solid rgba(10, 163, 173, .18);
    border-radius: 12px;
    background: rgba(10, 163, 173, .08);
    color: var(--auth-cyan-dark) !important;
    text-align: center;
    line-height: 1.9;
}

.auth-field {
    margin-top: 14px;
}

.auth-field-label {
    display: block;
    margin-bottom: 7px;
    color: #48515d;
    font-size: 13px;
    font-weight: 700;
}

.auth-field-label--hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.auth-input-wrap {
    position: relative;
}

.auth-input-icon,
.auth-password-toggle {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    color: #9aa3ae;
}

.auth-input-icon {
    right: 13px;
    pointer-events: none;
}

.auth-password-toggle {
    left: 12px;
    border: 0;
    background: transparent;
    cursor: pointer;
    transition: color .18s ease;
}

.auth-password-toggle:hover,
.auth-password-toggle:focus-visible {
    color: var(--auth-cyan-dark);
    outline: none;
}

.auth-input,
.auth-page input[type='text'].auth-input,
.auth-page input[type='tel'].auth-input,
.auth-page input[type='password'].auth-input,
.auth-page input[type='email'].auth-input {
    width: 100%;
    height: 44px;
    box-sizing: border-box;
    border: 1px solid var(--auth-line) !important;
    border-radius: 8px !important;
    background: rgba(255, 255, 255, .64) !important;
    box-shadow: inset 0 1px 1px rgba(15, 23, 42, .02);
    color: #222c37 !important;
    font-family: var(--auth-font);
    font-size: 14px !important;
    line-height: 44px;
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.auth-input--with-start-icon,
.auth-page input.auth-input--with-start-icon {
    padding-right: 44px !important;
}

.auth-input--with-end-icon,
.auth-page input.auth-input--with-end-icon {
    padding-left: 44px !important;
}

.auth-input--center,
.auth-page input.auth-input--center {
    text-align: center;
    letter-spacing: 4px;
    direction: ltr;
}

#national_id.auth-input,
.auth-page #national_id.auth-input {
    padding-right: 48px !important;
    padding-left: 48px !important;
    text-align: center !important;
    text-indent: 0 !important;
}

#national_id.auth-input::placeholder,
.auth-page #national_id.auth-input::placeholder {
    direction: rtl;
    text-align: center;
    letter-spacing: 0;
}

.auth-input::placeholder {
    color: #9ba4af;
    opacity: 1;
}

.auth-input:focus,
.auth-page input.auth-input:focus {
    border-color: rgba(10, 163, 173, .72) !important;
    background: rgba(255, 255, 255, .88) !important;
    box-shadow: 0 0 0 4px rgba(10, 163, 173, .11) !important;
}

.auth-error,
.auth-page ul.auth-error {
    margin: 8px 0 0 !important;
    padding: 0 !important;
    list-style: none !important;
    color: #b91c1c !important;
    font-size: 12px !important;
    line-height: 1.8 !important;
}

.auth-actions {
    margin-top: 28px;
}

.auth-actions--compact {
    margin-top: 20px;
}

.auth-button,
.auth-page button.auth-button,
.auth-page a.auth-button {
    width: 100%;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 8px;
    background: linear-gradient(180deg, #dc0b0b 0%, var(--auth-red) 58%, var(--auth-red-dark) 100%);
    box-shadow: 0 13px 22px rgba(200, 0, 0, .18);
    color: #fff !important;
    cursor: pointer;
    font-family: var(--auth-font);
    font-size: 14px;
    font-weight: 800;
    line-height: 1.8;
    text-decoration: none;
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.auth-button:hover,
.auth-button:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 16px 26px rgba(200, 0, 0, .24);
    filter: saturate(1.04);
    outline: none;
}

.auth-button:active {
    transform: translateY(0);
}

.auth-secondary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 16px;
}

.auth-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #2f3a46;
    cursor: pointer;
    font-size: 13px;
    line-height: 1.8;
    user-select: none;
}

.auth-check input {
    width: 17px;
    height: 17px;
    margin: 0;
    border: 1px solid #cfd6de;
    border-radius: 4px;
    accent-color: var(--auth-red);
}

.auth-link,
.auth-page a.auth-link,
.auth-page button.auth-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: #276fb7 !important;
    cursor: pointer;
    font-family: var(--auth-font);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.9;
    text-decoration: none;
    transition: color .18s ease;
}

.auth-link:hover,
.auth-link:focus-visible {
    color: var(--auth-red) !important;
    outline: none;
}

.auth-forgot {
    margin-top: 20px;
    text-align: center;
}

.auth-otp {
    direction: ltr;
    display: flex;
    justify-content: center;
    gap: 9px;
    margin-top: 8px;
}

.auth-otp-box {
    width: 44px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--auth-line);
    border-radius: 10px;
    background: rgba(255, 255, 255, .68);
    color: #1f2937;
    font-size: 20px;
    font-weight: 800;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.auth-otp-box.focused {
    border-color: rgba(10, 163, 173, .78);
    background: rgba(255, 255, 255, .90);
    box-shadow: 0 0 0 4px rgba(10, 163, 173, .11);
}

.auth-otp-box.focused.cursor::after {
    content: '|';
    color: var(--auth-cyan-dark);
    animation: authBlink 1s infinite;
}

@keyframes authBlink {
    50% {
        opacity: 0;
    }
}

.auth-ghost-input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.auth-resend {
    margin-top: 16px;
    text-align: center;
}

.auth-resend__line {
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #667281;
    font-size: 13px;
}

.auth-timer {
    width: 62px;
    margin-right: 5px;
    direction: ltr;
    color: #7b8490;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    text-align: right;
}

.auth-loader {
    width: 22px;
    height: 22px;
    border: 2px solid rgba(10, 163, 173, .18);
    border-bottom-color: var(--auth-cyan);
    border-radius: 999px;
    animation: authSpin .8s linear infinite;
}

@keyframes authSpin {
    to {
        transform: rotate(360deg);
    }
}

.auth-resend__status {
    min-height: 19px;
    margin-top: 4px;
    color: #667281;
    font-size: 12px;
    line-height: 1.7;
    transition: opacity .25s ease;
}

.auth-resend__status.is-success {
    color: #15803d;
}

.auth-resend__status.is-error {
    color: #b91c1c;
}

.auth-hidden {
    display: none !important;
}

.auth-reset-note {
    margin: 0 0 20px;
    color: #4b5563;
    font-size: 14px;
    line-height: 2;
    text-align: center;
}

.auth-inline-ltr {
    direction: ltr;
    display: inline-block;
    font-weight: 800;
}

.auth-copyright {
    position: fixed;
    right: 0;
    bottom: 16px;
    left: 0;
    margin: 0 auto;
    color: rgba(90, 100, 112, .56);
    font-size: 12px;
    line-height: 1.8;
    text-align: center;
    pointer-events: none;
}

@media (min-width: 1537px) {
    .auth-card {
        width: 430px;
        min-height: 560px;
    }

    .auth-brand__logo {
        width: 184px;
    }
}

@media (max-width: 1180px) {
    .auth-page {
        background-position: center center;
    }

    .auth-card {
        width: min(100%, 402px);
    }
}

@media (max-width: 900px) {
    .auth-page {
        align-items: center;
        justify-content: center;
        padding: clamp(18px, 4vh, 30px) 18px;
        background-image: url('/images/auth/shirinpolo-auth-mobile.png');
        background-position: center center;
        background-size: cover;
    }

    .auth-page::before {
        background: linear-gradient(180deg, rgba(255, 255, 255, .42) 0%, rgba(255, 255, 255, .10) 58%, rgba(255, 255, 255, .20) 100%);
    }

    .auth-card {
        width: min(100%, 372px);
        min-height: auto;
        padding: clamp(24px, 4vh, 30px) 24px 24px;
        border-radius: 18px;
        background: rgba(255, 255, 255, .78);
        box-shadow: 0 18px 42px rgba(15, 23, 42, .11);
    }

    .auth-brand {
        margin-bottom: 16px;
    }

    .auth-brand__logo {
        width: 145px;
    }

    .auth-title {
        font-size: 17px;
    }

    .auth-description,
    .auth-reset-note {
        font-size: 13px;
    }

    .auth-copyright {
        display: none;
    }
}

@media (max-width: 480px) {
    .auth-page {
        padding: 18px 14px;
    }

    .auth-card {
        width: min(100%, 344px);
        padding: 22px 18px 20px;
        border-radius: 16px;
    }

    .auth-brand__logo {
        width: 128px;
        max-width: 66%;
    }

    .auth-header {
        margin-bottom: 16px;
    }

    .auth-title {
        font-size: 16px;
    }

    .auth-description,
    .auth-reset-note {
        font-size: 12.5px;
    }

    .auth-input,
    .auth-page input[type='text'].auth-input,
    .auth-page input[type='tel'].auth-input,
    .auth-page input[type='password'].auth-input,
    .auth-page input[type='email'].auth-input,
    .auth-button,
    .auth-page button.auth-button {
        min-height: 43px;
        height: 43px;
        font-size: 13px !important;
    }

    .auth-secondary-row {
        flex-direction: column;
        align-items: stretch;
        gap: 9px;
        margin-top: 12px;
    }

    .auth-check,
    .auth-link {
        justify-content: center;
    }

    .auth-otp {
        gap: 6px;
    }

    .auth-otp-box {
        width: 39px;
        height: 47px;
        border-radius: 9px;
        font-size: 18px;
    }
}


@media (max-height: 700px) and (max-width: 900px) {
    .auth-page {
        align-items: center;
        padding-top: 14px;
        padding-bottom: 14px;
    }

    .auth-card {
        padding-top: 20px;
        padding-bottom: 18px;
    }

    .auth-brand {
        margin-bottom: 12px;
    }

    .auth-brand__logo {
        width: 118px;
    }

    .auth-header {
        margin-bottom: 12px;
    }

    .auth-field {
        margin-top: 10px;
    }

    .auth-actions,
    .auth-actions--compact {
        margin-top: 15px;
    }
}

@media (max-width: 380px) {
    .auth-card {
        padding-right: 14px;
        padding-left: 14px;
    }

    .auth-otp-box {
        width: 35px;
        height: 44px;
        font-size: 16px;
    }
}
