/* ==========================================================================
   Quick auth — mobile → one time code → (name).
   Works both as a full page and inside the checkout modal.

   The markup and the behaviour in js/pages/quick-auth.js are unchanged; this
   sheet dresses them in the storefront's design tokens (see css/theme.css).
   ========================================================================== */

.qa-page {
    display: block;
}

.qa-shell {
    width: 100%;
    max-width: 440px;
    margin-inline: auto;
    display: grid;
    gap: 1.25rem;
}

/* ------------------------------------------------------------------ card */

.qa-card {
    background: var(--surface-card);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(47, 56, 95, .05), 0 1px 3px rgba(47, 56, 95, .04);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

/* ------------------------------------------------------------- progress */

.qa-progress {
    position: absolute;
    inset-inline: 0;
    top: 0;
    height: 3px;
    background: var(--line);
}

.qa-progress-bar {
    display: block;
    height: 100%;
    background: var(--brand);
    border-radius: 0 0 3px 3px;
    transition: width .3s ease;
    width: 33%;
}

.qa-progress-bar[data-step-index="1"] { width: 33%; }
.qa-progress-bar[data-step-index="2"] { width: 66%; }
.qa-progress-bar[data-step-index="3"] { width: 100%; }

.qa-step-count {
    display: block;
    font-size: 10px;
    color: var(--ink-muted);
    margin-bottom: .75rem;
    font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------- panels */

.qa-panel {
    display: none;
}

.qa-panel.is-active {
    display: block;
    animation: qaFade .25s ease-out;
}

@keyframes qaFade {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}

/* ------------------------------------------------------------ typography */

.qa-title {
    font-family: 'Dana', 'IRANYekan', Tahoma, sans-serif;
    font-size: 1.05rem;
    font-weight: 900;
    color: var(--ink);
    margin: 0 0 .35rem;
    line-height: 1.6;
}

.qa-sub,
.qa-goal {
    font-size: .75rem;
    color: var(--ink-muted);
    line-height: 1.9;
    margin: 0 0 1.25rem;
}

.qa-note,
.qa-hint {
    font-size: .6875rem;
    color: var(--ink-muted);
    line-height: 1.8;
    margin: .75rem 0 0;
}

.qa-terms {
    font-size: .625rem;
    color: var(--ink-muted);
    line-height: 1.9;
    margin: 1rem 0 0;
    text-align: center;
}

.qa-link {
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    color: var(--brand-dark);
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
}

.qa-link:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- tabs */

.qa-tabs {
    display: flex;
    gap: .25rem;
    background: var(--surface);
    border-radius: 12px;
    padding: .25rem;
    margin-bottom: 1.25rem;
}

.qa-tab {
    flex: 1;
    height: 38px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    font: inherit;
    font-size: .75rem;
    font-weight: 700;
    color: var(--ink-muted);
    cursor: pointer;
    transition: background-color .18s ease, color .18s ease;
}

.qa-tab.is-active {
    background: var(--surface-card);
    color: var(--brand-dark);
    box-shadow: 0 1px 2px rgba(47, 56, 95, .06);
}

/* --------------------------------------------------------------- fields */

.qa-field {
    display: block;
    margin-bottom: 1rem;
}

.qa-label {
    display: block;
    font-size: .6875rem;
    font-weight: 700;
    color: var(--ink-body);
    margin-bottom: .4rem;
}

.qa-input {
    width: 100%;
    height: 46px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: var(--surface-card);
    padding-inline: .875rem;
    font: inherit;
    font-size: .8125rem;
    color: var(--ink);
    transition: border-color .18s ease, box-shadow .18s ease;
}

.qa-input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(217, 43, 31, .16);
}

.qa-input--ltr {
    direction: ltr;
    text-align: left;
    font-variant-numeric: tabular-nums;
}

.qa-input[aria-invalid="true"] { border-color: #dc2626; }

.qa-error {
    display: none;
    font-size: .625rem;
    color: #dc2626;
    margin: .35rem 0 0;
}

.qa-error.is-visible { display: block; }

/* password field with its reveal toggle */

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

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

.qa-eye {
    position: absolute;
    left: .375rem;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--ink-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.qa-eye:hover { color: var(--ink); background: var(--surface); }

.qa-password-mobile {
    font-size: .6875rem;
    color: var(--ink-muted);
}

/* -------------------------------------------------------------- captcha */

.qa-captcha-row {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.qa-captcha-row .qa-input { flex: 1; }

.qa-captcha-img {
    height: 46px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: var(--surface-card);
}

.qa-captcha-reload {
    width: 46px;
    height: 46px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: var(--surface-card);
    color: var(--ink-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: border-color .18s ease, color .18s ease;
}

.qa-captcha-reload:hover { border-color: var(--brand); color: var(--brand-dark); }

/* ------------------------------------------------------------ otp boxes */

.qa-otp {
    display: flex;
    gap: .5rem;
    direction: ltr;
    justify-content: center;
    margin-bottom: .5rem;
}

.qa-otp-box {
    width: 46px;
    height: 54px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: var(--surface-card);
    text-align: center;
    font-size: 1.15rem;
    font-weight: 900;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.qa-otp-box:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(217, 43, 31, .16);
}

.qa-sent-to,
.qa-sent-text {
    font-size: .6875rem;
    color: var(--ink-muted);
}

.qa-countdown {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    color: var(--ink-body);
}

/* -------------------------------------------------------------- buttons */

.qa-btn {
    width: 100%;
    height: 46px;
    border: 0;
    border-radius: 12px;
    background: var(--brand);
    color: #fff;
    font: inherit;
    font-size: .8125rem;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    transition: background-color .18s ease, opacity .18s ease;
}

.qa-btn:hover { background: var(--brand-dark); }
.qa-btn:disabled { opacity: .5; cursor: not-allowed; }

/* the "or" rule between the code button and the password button */
.qa-or {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: 1.25rem 0;
}

.qa-or::before,
.qa-or::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--line);
}

.qa-or span {
    font-size: .625rem;
    color: var(--ink-muted);
}

.qa-btn--ghost {
    background: var(--surface-card);
    color: var(--ink-body);
    border: 1px solid #e5e7eb;
}

.qa-btn--ghost:hover { background: var(--surface); color: var(--brand-dark); border-color: var(--brand); }

.qa-btn.is-loading { color: transparent; position: relative; pointer-events: none; }

.qa-btn.is-loading::after {
    content: "";
    position: absolute;
    inset: 0;
    margin: auto;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, .4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

.qa-btn-icon { font-size: .6875rem; }

.qa-actions {
    display: grid;
    gap: .5rem;
    margin-top: 1rem;
}

.qa-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-top: .875rem;
    font-size: .6875rem;
}

/* ------------------------------------------------------------- checkbox */

.qa-check {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .6875rem;
    color: var(--ink-body);
    cursor: pointer;
}

.qa-check input {
    width: 16px;
    height: 16px;
    accent-color: var(--brand);
}

/* ------------------------------------------------------- confirm / done */

.qa-confirm {
    background: var(--surface);
    border-radius: 12px;
    padding: .875rem;
    margin-bottom: 1rem;
}

.qa-confirm-label {
    display: block;
    font-size: .625rem;
    color: var(--ink-muted);
    margin-bottom: .25rem;
}

.qa-confirm-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

.qa-confirm-num {
    direction: ltr;
    font-weight: 900;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.qa-done {
    text-align: center;
    padding: 1rem 0;
}

.qa-done-circle {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: #ecfdf5;
    color: #059669;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
}

.qa-done-text {
    font-size: .8125rem;
    font-weight: 800;
    color: var(--ink);
}

/* ---------------------------------------------------------------- trust */

.qa-trust {
    display: grid;
    gap: .5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.qa-trust li {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .6875rem;
    color: var(--ink-muted);
    background: var(--surface-card);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: .625rem .875rem;
}

.qa-trust i { color: var(--brand); }

.qa-home {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    font-size: .6875rem;
    font-weight: 700;
    color: var(--ink-muted);
    text-decoration: none;
}

.qa-home:hover { color: var(--brand-dark); }

/* ------------------------------------------------- guest banner (checkout) */

.qa-guest-banner {
    display: flex;
    align-items: center;
    gap: .75rem;
    background: #fdf3f2;
    border: 1px solid #fbdedb;
    border-radius: 16px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.qa-guest-banner i { color: var(--brand); font-size: 1.1rem; }
.qa-guest-banner p { margin: 0; flex: 1; font-size: .75rem; line-height: 1.9; color: var(--ink-body); }

/* --------------------------------------------------------------- modal */

.qa-modal {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.qa-modal.is-open { display: flex; }

.qa-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .55);
    backdrop-filter: blur(2px);
}

.qa-modal-box {
    position: relative;
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--surface-card);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, .3);
}

.qa-modal-close {
    position: absolute;
    top: .5rem;
    left: .5rem;
    z-index: 1;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--ink-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.qa-modal-close:hover { background: var(--surface); color: var(--ink); }

.qa--modal .qa-card {
    border: 0;
    box-shadow: none;
    padding-top: 2.5rem;
}
