/* مدال ورود — هم‌سبک با site-head-pro (مینیمال) */
.auth-modal {
    --auth-ink: var(--head-pro-ink, var(--ui-text, #172033));
    --auth-soft: var(--head-pro-soft, var(--ui-text-muted, #667085));
    --auth-line: var(--head-pro-line, var(--ui-border, #e7ebf3));
    --auth-bg: var(--head-pro-bg, var(--ui-surface-muted, #f7f9fe));
    --auth-brand: var(--head-pro-brand, var(--theam-color, #6554f2));
    --auth-radius: 18px;
    --auth-shadow: var(--head-pro-shadow, 0 20px 60px rgba(20, 29, 56, 0.1));
}

.auth-modal .modal-dialog {
    max-width: 400px;
}

.auth-modal .modal-content {
    border: 1px solid var(--auth-line);
    border-radius: var(--auth-radius);
    box-shadow: var(--auth-shadow);
    overflow: hidden;
    background: #fff;
}

.auth-modal-form {
    display: none;
    flex-direction: column;
    min-height: 0;
}

.auth-modal-form.is-active {
    display: flex;
}

.auth-modal__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1.25rem 1.25rem 0;
    border-bottom: 0;
}

.auth-modal__top .btn-close {
    margin: 0;
    padding: 0.5rem;
    opacity: 0.45;
}

.auth-modal__title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--auth-ink);
    margin: 0 0 0.25rem;
    line-height: 1.35;
}

.auth-modal__desc {
    font-size: 0.8125rem;
    color: var(--auth-soft);
    margin: 0;
    line-height: 1.5;
}

.auth-modal__steps {
    display: flex;
    gap: 0.35rem;
    padding: 0.75rem 1.25rem 0;
}

.auth-modal__step {
    flex: 1;
    height: 3px;
    border-radius: 999px;
    background: var(--auth-line);
    transition: background 0.2s;
}

.auth-modal__step.is-on {
    background: var(--auth-brand);
}

.auth-modal__body {
    padding: 1rem 1.25rem 0.5rem;
}

.auth-modal__foot {
    padding: 1rem 1.25rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.auth-modal-msg .alert {
    margin: 0;
    border-radius: 0;
    border: 0;
    border-bottom: 1px solid var(--auth-line);
    font-size: 0.8125rem;
    padding: 0.65rem 1.25rem;
}

/* فیلدها — مثل هدر */
.auth-field {
    margin-bottom: 1rem;
}

.auth-field__label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--auth-ink);
    margin-bottom: 0.4rem;
}

.auth-input {
    width: 100%;
    min-height: 48px;
    padding: 0 1rem;
    border: 1px solid var(--auth-line);
    border-radius: var(--auth-radius);
    background: #fff;
    font-size: 0.9375rem;
    color: var(--auth-ink);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-input:focus {
    outline: 0;
    border-color: color-mix(in srgb, var(--auth-brand) 55%, var(--auth-line));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--auth-brand) 18%, transparent);
}

.auth-input.auth-input--phone {
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.04em;
    direction: ltr;
    text-align: left;
}

.auth-input::placeholder {
    color: #b8c0d0;
    letter-spacing: 0.06em;
}

.auth-field__hint {
    font-size: 0.75rem;
    color: var(--auth-soft);
    margin: 0.35rem 0 0;
}

.auth-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    background: var(--auth-bg);
    border: 1px solid var(--auth-line);
    border-radius: 999px;
    font-size: 0.8125rem;
    color: var(--auth-ink);
    margin-bottom: 1rem;
}

.auth-chip strong {
    font-weight: 700;
    direction: ltr;
}

.auth-chip .btn-link {
    font-size: 0.75rem;
    padding: 0;
    vertical-align: baseline;
}

.auth-btn-primary {
    min-height: 48px;
    border-radius: var(--auth-radius);
    font-size: 0.875rem;
    font-weight: 700;
    border: 1px solid var(--auth-brand);
    background: var(--auth-brand);
    color: var(--theam-text-color, #fff) !important;
    width: 100%;
}

.auth-btn-primary:hover,
.auth-btn-primary:focus {
    filter: brightness(0.96);
    color: var(--theam-text-color, #fff) !important;
}

.auth-btn-ghost {
    min-height: 44px;
    border-radius: var(--auth-radius);
    font-size: 0.8125rem;
    font-weight: 600;
    border: 1px solid var(--auth-line);
    background: #fff;
    color: var(--auth-ink);
    width: 100%;
}

.auth-link {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--auth-brand);
    text-decoration: none;
    padding: 0;
    border: 0;
    background: none;
}

.auth-link:hover {
    text-decoration: underline;
    color: var(--auth-brand);
}

.auth-btn-secondary {
    min-height: 44px;
    border-radius: var(--auth-radius);
    font-size: 0.8125rem;
    font-weight: 600;
    border: 1px solid var(--auth-line);
    background: var(--auth-bg);
    color: var(--auth-soft) !important;
    width: 100%;
    margin-top: 0.25rem;
}

.auth-btn-secondary:hover,
.auth-btn-secondary:focus {
    background: #eef1f7;
    border-color: #d5dbe8;
    color: var(--auth-ink) !important;
}

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

.auth-password-wrap .auth-input--pw {
    padding-left: 2.75rem;
}

.auth-password-toggle {
    position: absolute;
    left: 0.65rem;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: none;
    color: var(--auth-soft);
    padding: 0.25rem;
    line-height: 1;
    font-size: 1.15rem;
    cursor: pointer;
}

.auth-password-toggle:hover {
    color: var(--auth-ink);
}

.auth-terms {
    font-size: 0.75rem;
    color: var(--auth-soft);
    margin: 0.5rem 0 0;
    line-height: 1.5;
}

.auth-terms a {
    color: var(--auth-brand);
}

.auth-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.8125rem;
    color: var(--auth-soft);
}

.auth-check .form-check-input:checked {
    background-color: var(--auth-brand);
    border-color: var(--auth-brand);
}

/* OTP */
.auth-otp {
    display: flex;
    gap: 0.45rem;
    justify-content: center;
    direction: ltr;
    margin: 0.5rem 0 1rem;
}

.auth-otp input {
    width: 2.5rem;
    height: 2.75rem;
    text-align: center;
    font-size: 1.25rem;
    font-weight: 700;
    border: 1px solid var(--auth-line);
    border-radius: 12px;
    padding: 0;
    color: var(--auth-ink);
}

.auth-otp input:focus {
    border-color: var(--auth-brand);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--auth-brand) 20%, transparent);
}

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

@media (max-width: 575.98px) {
    .auth-modal .modal-dialog {
        margin: 0.75rem;
        max-width: calc(100% - 1.5rem);
    }

    .auth-modal-form.is-active {
        max-height: calc(100dvh - 1.5rem);
    }

    .auth-modal__foot {
        position: sticky;
        bottom: 0;
        background: #fff;
        border-top: 1px solid var(--auth-line);
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }

    .auth-otp input {
        width: 2.25rem;
        height: 2.5rem;
        font-size: 1.1rem;
    }
}
