/* =========================================================
   AUTH MODAL
   (themed for BalootBooking)
   ========================================================= */


/* =========================================================
   MODAL CONTAINER
   ========================================================= */

.auth-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;

    display: none;
    align-items: center;
    justify-content: center;

    padding: 20px;
}

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


/* =========================================================
   OVERLAY
   ========================================================= */

.auth-modal-overlay {
    position: absolute;
    inset: 0;

    background: rgba(59, 40, 30, 0.55);

    backdrop-filter: blur(2px);
}


/* =========================================================
   MODAL BOX
   ========================================================= */

.auth-modal-box {
    position: relative;
    z-index: 1;

    width: 430px;
    max-width: 100%;

    background: var(--white, #ffffff);

    border-radius: 18px;

    padding: 44px 30px 28px;

    box-shadow: 0 20px 60px rgba(59, 40, 30, 0.25);

    direction: rtl;
}


/* =========================================================
   CLOSE BUTTON
   ========================================================= */

.auth-modal-close {
    position: absolute;

    top: 14px;
    left: 14px;

    width: 34px;
    height: 34px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 0;
    border-radius: 50%;

    background: var(--beige-light, #f3ece3);
    color: var(--brown-dark, #3b281e);

    font-size: 14px;

    cursor: pointer;

    transition:
        background 0.2s ease,
        color 0.2s ease;
}

.auth-modal-close:hover {
    background: var(--beige, #e8d9c7);
    color: var(--brown-dark, #3b281e);
}


/* =========================================================
   BRAND
   ========================================================= */

.auth-brand {
    display: flex;
    flex-direction: column;
    align-items: center;

    gap: 10px;

    margin-bottom: 22px;
}

.auth-brand-icon {
    width: 54px;
    height: 54px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: var(--brown-dark, #3b281e);
    color: var(--white, #ffffff);

    font-size: 22px;
}

.auth-brand-name {
    color: var(--brown-dark, #3b281e);

    font-size: 20px;
    font-weight: 700;

    letter-spacing: 0.3px;
}

.auth-brand-name span {
    color: var(--brown, #654536);
}


/* =========================================================
   STEP
   ========================================================= */

.auth-step {
    display: block;
}

.auth-hidden {
    display: none;
}


/* =========================================================
   TITLE / DESCRIPTION
   ========================================================= */

.auth-title {
    margin: 0 0 10px;

    text-align: center;

    color: var(--brown-dark, #3b281e);

    font-size: 20px;
    font-weight: 750;
}

.auth-description {
    margin: 0 0 22px;

    text-align: center;

    color: var(--text-muted, #7c7067);

    font-size: 13px;
    line-height: 1.9;
}

.auth-phone-display {
    display: inline-block;

    margin: 0 4px;

    color: var(--brown-dark, #3b281e);
    font-weight: 700;

    direction: ltr;
    letter-spacing: 0.5px;
}


/* =========================================================
   INPUT WRAPPER + FLOATING LABEL
   ========================================================= */

.auth-input-wrapper {
    position: relative;

    margin-bottom: 6px;
}

.auth-input {
    width: 100%;
    height: 58px;

    padding: 22px 16px 8px 46px;

    border: 1.5px solid var(--border, #e4dbd1);
    border-radius: 12px;

    outline: none;

    background: var(--white, #ffffff);
    color: var(--text-dark, #2c211b);

    font-family: inherit;
    font-size: 14px;

    direction: rtl;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.auth-input::placeholder {
    color: transparent;
}

.auth-input:focus {
    border-color: var(--brown-medium, #80604c);

    box-shadow: 0 0 0 3px rgba(107, 73, 55, 0.10);
}


/* =========================================================
   FLOATING LABEL
   ========================================================= */

.auth-input-label {
    position: absolute;

    top: 50%;
    right: 16px;

    transform: translateY(-50%);

    padding: 0 4px;

    background: var(--white, #ffffff);
    color: var(--text-muted, #7c7067);

    font-size: 13px;

    pointer-events: none;

    transition: all 0.18s ease;
}

.auth-input:focus + .auth-input-label,
.auth-input:not(:placeholder-shown) + .auth-input-label {
    top: 10px;
    transform: none;

    font-size: 10px;

    color: var(--brown-medium, #80604c);
}


/* =========================================================
   ICON
   ========================================================= */

.auth-input-icon {
    position: absolute;

    top: 50%;
    left: 16px;

    transform: translateY(-50%);

    color: var(--brown-medium, #80604c);

    font-size: 17px;

    pointer-events: none;
}


/* =========================================================
   OTP INPUT
   ========================================================= */

.auth-otp-input {
    direction: ltr;

    text-align: center;

    padding: 22px 16px 8px;

    font-size: 18px;
    letter-spacing: 10px;
    font-weight: 700;
}

.auth-otp-input::placeholder {
    color: transparent;
    letter-spacing: normal;
}


/* =========================================================
   INFO NOTE
   ========================================================= */

.auth-info {
    margin: 12px 2px 20px;

    text-align: center;

    color: var(--text-muted, #7c7067);

    font-size: 11px;
    line-height: 1.9;
}

.auth-info a {
    color: var(--brown, #654536);
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: var(--beige-dark, #d5c2ad);
}


/* =========================================================
   SUBMIT BUTTON
   ========================================================= */

.auth-submit-button {
    width: 100%;
    height: 52px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border: 0;
    border-radius: 12px;

    background: var(--brown-dark, #3b281e);
    color: var(--white, #ffffff);

    font-family: inherit;
    font-size: 14px;
    font-weight: 700;

    cursor: pointer;

    box-shadow: 0 6px 16px rgba(59, 40, 30, 0.15);

    transition:
        background 0.2s ease,
        transform 0.2s ease,
        opacity 0.2s ease;
}

.auth-submit-button:hover:not(:disabled) {
    background: #503529;

    transform: translateY(-1px);
}

.auth-submit-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;

    transform: none;
}


/* =========================================================
   ERROR
   ========================================================= */

.auth-error {
    min-height: 22px;

    margin: 6px 2px 8px;

    text-align: center;

    color: #a3413a;

    font-size: 12px;
    line-height: 1.8;
}

.auth-error:empty {
    min-height: 0;
    margin-bottom: 12px;
}


/* =========================================================
   BACK BUTTON
   ========================================================= */

.auth-back-button {
    width: 100%;

    margin-top: 14px;
    padding: 8px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 6px;

    border: 0;
    border-radius: 8px;

    background: transparent;
    color: var(--brown, #654536);

    font-family: inherit;
    font-size: 13px;
    font-weight: 600;

    cursor: pointer;

    transition: background 0.2s ease;
}

.auth-back-button:hover {
    background: var(--beige-light, #f3ece3);
}

.auth-back-button i {
    font-size: 14px;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 500px) {

    .auth-modal-box {
        width: 100%;
        max-width: calc(100% - 8px);

        padding: 38px 20px 22px;

        border-radius: 15px;
    }

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

    .auth-description {
        font-size: 12px;
    }

    .auth-brand-name {
        font-size: 18px;
    }

    .auth-submit-button {
        height: 48px;
        font-size: 13px;
    }
}


/* =========================================================
   OTP STATUS — timer / expired
   ========================================================= */

.auth-otp-status {
    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 40px;
    margin: 4px 0 14px;
}

/* ---------- TIMER PILL (compact) ---------- */

.auth-otp-timer {
    display: inline-flex;
    align-items: center;
    gap: 7px;

    padding: 5px 11px 5px 10px;

    background:
        linear-gradient(135deg, #faf5ed 0%, #f2e7d6 100%);

    border: 1px solid #e8d9c2;
    border-radius: 999px;

    color: var(--brown, #654536);

    font-size: 11.5px;
    font-weight: 600;

    direction: rtl;

    box-shadow:
        0 1px 2px rgba(59, 40, 30, 0.03),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);

    transition:
        background 0.25s ease,
        border-color 0.25s ease;
}

.auth-otp-timer i {
    color: var(--brown, #654536);
    font-size: 12px;
    opacity: 0.85;
}

.auth-otp-timer strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 44px;
    height: 21px;
    padding: 0 6px;

    background: var(--white, #ffffff);
    border-radius: 6px;

    color: var(--brown-dark, #3b281e);

    font-family: "Vazir FD", "Vazir", Tahoma, sans-serif;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: 0.5px;

    direction: ltr;
    font-variant-numeric: tabular-nums;

    box-shadow: inset 0 0 0 1px rgba(59, 40, 30, 0.06);

    transition:
        color 0.25s ease,
        background 0.25s ease,
        box-shadow 0.25s ease;
}

/* ---------- WARNING STATE (< 60s) ---------- */

.auth-otp-timer.is-warning {
    background:
        linear-gradient(135deg, #fef4ec 0%, #fbe0c8 100%);
    border-color: #f0c296;
}

.auth-otp-timer.is-warning i {
    color: #b55a1e;
    opacity: 1;
}

.auth-otp-timer.is-warning strong {
    color: #b55a1e;
    box-shadow: inset 0 0 0 1px rgba(181, 90, 30, 0.15);
}

.auth-otp-timer[hidden] {
    display: none;
}

/* ---------- EXPIRED PILL ---------- */

.auth-otp-expired {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    padding: 7px 14px;

    background: #fdf2f0;
    border: 1px solid #f0cdc6;
    border-radius: 999px;

    color: #a3413a;

    font-size: 11.5px;
    font-weight: 700;

    direction: rtl;
}

.auth-otp-expired i {
    font-size: 13px;
}

.auth-otp-expired[hidden] {
    display: none;
}


/* =========================================================
   RESEND BUTTON
   ========================================================= */

.auth-resend-button {
    width: 100%;
    height: 50px;

    margin-bottom: 10px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    border: 1.5px solid var(--beige-dark, #d5c2ad);
    border-radius: 12px;

    background: var(--white, #ffffff);
    color: var(--brown-dark, #3b281e);

    font-family: inherit;
    font-size: 13.5px;
    font-weight: 700;

    cursor: pointer;

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        transform 0.15s ease,
        box-shadow 0.2s ease;
}

.auth-resend-button i {
    font-size: 15px;
    color: var(--brown, #654536);
}

.auth-resend-button:hover:not(:disabled) {
    background: var(--beige-light, #f3ece3);
    border-color: var(--brown-light, #a98b76);
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(59, 40, 30, 0.08);
}

.auth-resend-button:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: none;
}

.auth-resend-button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.auth-resend-button[hidden] {
    display: none;
}