/* ==========================================================================
   Quick auth - one screen sign in / sign up + inline checkout identification
   ========================================================================== */

.qa,
.qa * {
    box-sizing: border-box;
}

:root {
    --qa-radius: 14px;
    --qa-border: #e6e8ec;
    --qa-muted: #8a8f98;
    --qa-text: #1f2430;
    --qa-danger: #e03131;
    --qa-success: #2f9e44;
    --qa-bg-soft: #f6f7f9;
}

/* ---------------------------------------------------------------- page shell */

.qa-page {
    padding: 24px 0 56px;
}

.qa-shell {
    max-width: 440px;
    margin: 0 auto;
}

.qa-card {
    background: #fff;
    border: 1px solid var(--qa-border);
    border-radius: 18px;
    box-shadow: 0 12px 32px rgba(20, 24, 35, 0.06);
    padding: 28px 26px 22px;
}

.qa-trust {
    list-style: none;
    margin: 18px 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 16px;
}

.qa-trust li {
    color: var(--qa-muted);
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.qa-trust i {
    color: var(--primary-color);
    font-size: 15px;
}

.qa-home {
    display: block;
    text-align: center;
    margin-top: 16px;
    color: var(--qa-muted);
    font-size: 13px;
}

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

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

.qa {
    position: relative;
}

.qa-panel {
    display: none;
}

.qa-panel.is-active {
    display: block;
    animation: qa-in 0.22s ease;
}

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

.qa-progress {
    height: 3px;
    background: var(--qa-bg-soft);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 20px;
}

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

.qa-progress-bar[data-step-index='2'] {
    width: 66%;
}

.qa-progress-bar[data-step-index='3'] {
    width: 100%;
}

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

.qa-title {
    font-size: 19px;
    font-weight: 700;
    color: var(--qa-text);
    margin: 0 0 6px;
}

.qa-sub {
    font-size: 13px;
    line-height: 2;
    color: var(--qa-muted);
    margin: 0 0 20px;
}

.qa-hint {
    font-size: 12.5px;
    line-height: 1.9;
    color: #8a6d1f;
    background: #fff8e1;
    border: 1px solid #ffe9a8;
    border-radius: 10px;
    padding: 8px 12px;
    margin: 0 0 16px;
}

.qa-note {
    font-size: 12px;
    color: var(--qa-muted);
    text-align: center;
    margin: 14px 0 0;
}

.qa-note i {
    color: var(--qa-success);
}

.qa-terms {
    font-size: 11.5px;
    color: var(--qa-muted);
    text-align: center;
    margin: 8px 0 0;
    line-height: 2;
}

.qa-terms a {
    color: var(--primary-color);
}

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

.qa-field {
    margin-bottom: 16px;
}

.qa-row {
    display: flex;
    gap: 12px;
}

.qa-row .qa-field {
    flex: 1;
    min-width: 0;
}

.qa-label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--qa-text);
    margin-bottom: 7px;
}

.qa-input {
    width: 100%;
    height: 52px;
    border: 1.5px solid var(--qa-border);
    border-radius: var(--qa-radius);
    background: #fff;
    padding: 0 14px;
    font-size: 15px;
    font-family: inherit;
    color: var(--qa-text);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    outline: none;
}

.qa-input::placeholder {
    color: #b9bec7;
    font-size: 14px;
}

.qa-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.04);
}

.qa-input--ltr {
    direction: ltr;
    text-align: left;
    letter-spacing: 1px;
    font-size: 16px;
}

.qa-field.has-error .qa-input,
.qa-field.has-error .qa-otp-box {
    border-color: var(--qa-danger);
}

.qa-error {
    display: none;
    font-size: 12px;
    color: var(--qa-danger);
    margin: 7px 0 0;
    line-height: 1.8;
}

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

/* password */

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

.qa-password-wrap .qa-input {
    padding-left: 46px;
}

.qa-eye {
    position: absolute;
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: 0;
    background: transparent;
    color: var(--qa-muted);
    cursor: pointer;
    font-size: 19px;
    line-height: 1;
}

.qa-check {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    color: var(--qa-text);
    margin-bottom: 16px;
    cursor: pointer;
    user-select: none;
}

.qa-check input {
    width: 17px;
    height: 17px;
    accent-color: var(--primary-color);
    margin: 0;
}

/* captcha */

.qa-captcha-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.qa-captcha-img {
    height: 52px;
    border-radius: 10px;
    border: 1px solid var(--qa-border);
}

.qa-captcha-reload {
    width: 42px;
    height: 52px;
    border: 1.5px solid var(--qa-border);
    border-radius: 10px;
    background: #fff;
    color: var(--qa-muted);
    cursor: pointer;
    font-size: 18px;
}

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

.qa-otp {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.qa-otp-box {
    width: 100%;
    max-width: 58px;
    height: 60px;
    border: 1.5px solid var(--qa-border);
    border-radius: var(--qa-radius);
    background: #fff;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    color: var(--qa-text);
    outline: none;
    transition: border-color 0.15s ease, transform 0.12s ease;
    -moz-appearance: textfield;
}

.qa-otp-box::-webkit-outer-spin-button,
.qa-otp-box::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.qa-otp-box:focus {
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.qa-otp-box.is-filled {
    border-color: var(--primary-color);
    background: var(--qa-bg-soft);
}

.qa.is-shaking .qa-otp {
    animation: qa-shake 0.32s ease;
}

@keyframes qa-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

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

.qa-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 52px;
    border: 0;
    border-radius: var(--qa-radius);
    background: var(--primary-color);
    color: #fff !important;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.15s ease, transform 0.12s ease;
    text-decoration: none;
}

.qa-btn:hover {
    opacity: 0.92;
    color: #fff;
}

.qa-btn:active {
    transform: translateY(1px);
}

.qa-btn[disabled] {
    opacity: 0.55;
    cursor: default;
}

.qa-btn.is-loading .qa-btn-text,
.qa-btn.is-loading .qa-btn-icon {
    visibility: hidden;
}

.qa-btn.is-loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: qa-spin 0.7s linear infinite;
}

.qa-btn {
    position: relative;
}

@keyframes qa-spin {
    to { transform: rotate(360deg); }
}

.qa-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px 18px;
    margin-top: 16px;
    min-height: 22px;
}

.qa-link {
    border: 0;
    background: transparent;
    padding: 0;
    font-family: inherit;
    font-size: 13px;
    color: var(--primary-color);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.qa-link:hover {
    text-decoration: underline;
    color: var(--primary-color);
}

.qa-countdown {
    font-size: 13px;
    color: var(--qa-muted);
    direction: rtl;
}

.qa-sent-to {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
    margin-bottom: 16px;
}

.qa-sent-text,
.qa-password-mobile {
    direction: rtl;
}

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

.qa-tabs {
    display: flex;
    background: var(--qa-bg-soft);
    border-radius: var(--qa-radius);
    padding: 4px;
    margin-bottom: 22px;
}

.qa-tab {
    flex: 1;
    height: 42px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--qa-muted);
    cursor: pointer;
}

.qa-tab.is-active {
    background: #fff;
    color: var(--qa-text);
    box-shadow: 0 2px 6px rgba(20, 24, 35, 0.08);
}

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

.qa-done {
    text-align: center;
    padding: 22px 0 10px;
}

.qa-done-circle {
    width: 66px;
    height: 66px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: #e9f7ec;
    color: var(--qa-success);
    font-size: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: qa-pop 0.32s ease;
}

@keyframes qa-pop {
    from { transform: scale(0.6); opacity: 0; }
    to { transform: none; opacity: 1; }
}

.qa-done-text {
    font-size: 15px;
    font-weight: 700;
    color: var(--qa-text);
    margin: 0;
}

/* ------------------------------------------------- goal / step / confirm --- */

.qa-goal {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 18px;
    padding: 9px 12px;
    border-radius: 10px;
    background: var(--qa-bg-soft);
    font-size: 12.5px;
    font-weight: 700;
    color: var(--qa-text);
}

.qa-goal i {
    color: var(--primary-color);
    font-size: 16px;
}

.qa-step-count {
    display: inline-block;
    margin-bottom: 8px;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--primary-color);
}

/* the number we already know, shown for confirmation instead of a second input */

.qa-confirm {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1.5px solid var(--qa-border);
    border-radius: var(--qa-radius);
    background: var(--qa-bg-soft);
    padding: 12px 14px;
    margin-bottom: 16px;
}

.qa-confirm-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.qa-confirm-label {
    font-size: 11.5px;
    color: var(--qa-muted);
}

.qa-confirm-num {
    font-size: 17px;
    font-weight: 700;
    color: var(--qa-text);
    letter-spacing: 1px;
}

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

.qa-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

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

.qa-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 20, 28, 0.55);
    backdrop-filter: blur(2px);
}

.qa-modal-box {
    position: relative;
    width: 100%;
    max-width: 420px;
    max-height: 92vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 18px;
    padding: 26px 24px 20px;
    box-shadow: 0 24px 60px rgba(10, 12, 18, 0.28);
    animation: qa-in 0.24s ease;
}

/* the modal is a single focused task, so it stays quieter than the full page */

.qa--modal .qa-title {
    font-size: 17px;
    padding-left: 34px;
}

.qa--modal .qa-sub {
    margin-bottom: 16px;
}

.qa--modal .qa-note {
    margin-top: 12px;
}

.qa-modal-close {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: var(--qa-bg-soft);
    color: var(--qa-muted);
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
}

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

.qa-guest-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border: 1px solid var(--qa-border);
    border-right: 4px solid var(--primary-color);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 16px;
}

.qa-guest-banner i {
    font-size: 24px;
    color: var(--primary-color);
}

.qa-guest-banner p {
    margin: 0;
    font-size: 13px;
    line-height: 1.9;
    color: var(--qa-text);
    flex: 1;
}

.qa-guest-banner .qa-link {
    white-space: nowrap;
    font-weight: 700;
}

/* ------------------------------------------------------------------ responsive */

@media (max-width: 480px) {
    .qa-card {
        padding: 22px 18px 18px;
        border-radius: 16px;
    }

    .qa-otp {
        gap: 6px;
    }

    .qa-otp-box {
        height: 54px;
        font-size: 21px;
    }

    .qa-row {
        flex-direction: column;
        gap: 0;
    }

    .qa-guest-banner {
        flex-wrap: wrap;
    }
}

/* left to right locales */

html[dir='ltr'] .qa-guest-banner {
    border-right: 1px solid var(--qa-border);
    border-left: 4px solid var(--primary-color);
}

html[dir='ltr'] .qa-password-wrap .qa-input {
    padding-left: 14px;
    padding-right: 46px;
}

html[dir='ltr'] .qa-eye {
    left: auto;
    right: 6px;
}

html[dir='ltr'] .qa-modal-close {
    left: auto;
    right: 12px;
}
