/* ==========================================================================
   Authentication pages (login, register, OTP, reseller / merchant)
   Shared by every storefront template. Loaded via frontend.components.auth_assets
   ========================================================================== */

.auth-page {
    --auth-primary: var(--primary_color, #0f3d4c);
    --auth-primary-deep: #0b2c37;
    --auth-primary-deep: color-mix(in srgb, var(--auth-primary) 72%, #000);
    --auth-primary-soft: rgba(15, 61, 76, 0.08);
    --auth-primary-soft: color-mix(in srgb, var(--auth-primary) 9%, transparent);
    --auth-primary-ring: rgba(15, 61, 76, 0.16);
    --auth-primary-ring: color-mix(in srgb, var(--auth-primary) 18%, transparent);
    --auth-on-primary: var(--primary_text_color, #ffffff);
    --auth-text: #111827;
    --auth-muted: #6b7280;
    --auth-line: #e8ebf0;
    --auth-field-bg: #f7f8fa;
    --auth-danger: #dc2626;
    --auth-radius: 24px;
    --auth-field-radius: 12px;

    position: relative;
    overflow: hidden;
    padding: 56px 0 72px;
    background-color: #f4f6f9;
    background-image:
        radial-gradient(600px 400px at 0% 0%, var(--auth-primary-soft), transparent 70%),
        radial-gradient(500px 360px at 100% 100%, var(--auth-primary-soft), transparent 70%);
}

.auth-page > .container {
    position: relative;
    width: 100%;
}

/* ---------- Shell: brand panel + form card ---------- */
.auth-shell {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    background-color: #ffffff;
    border-radius: var(--auth-radius);
    box-shadow:
        0 1px 2px rgba(16, 24, 40, 0.04),
        0 24px 60px -24px rgba(16, 24, 40, 0.22);
    overflow: hidden;
}

@media (min-width: 992px) {
    .auth-shell {
        grid-template-columns: 5fr 6fr;
        min-height: 600px;
    }

    .auth-shell--wide {
        max-width: 1120px;
        grid-template-columns: 4fr 7fr;
    }
}

/* ---------- Brand panel ---------- */
.auth-aside {
    position: relative;
    overflow: hidden;
    display: flex;
    color: #ffffff;
    background-color: var(--auth-primary);
    background-image:
        radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.12) 1px, transparent 0),
        linear-gradient(150deg, var(--auth-primary) 0%, var(--auth-primary-deep) 100%);
    background-size: 22px 22px, 100% 100%;
}

.auth-aside__shape {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.auth-aside__shape--1 {
    width: 320px;
    height: 320px;
    top: -120px;
    right: -110px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0) 70%);
}

.auth-aside__shape--2 {
    width: 260px;
    height: 260px;
    bottom: -110px;
    left: -80px;
    border: 40px solid rgba(255, 255, 255, 0.06);
}

.auth-aside__inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 48px 44px;
}

.auth-aside__eyebrow {
    margin: 0 0 4px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
}

.auth-aside__brand {
    margin: 0 0 28px;
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    word-break: break-word;
}

.auth-aside__heading {
    margin: 0 0 12px;
    font-size: 30px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: #ffffff;
}

.auth-aside__text {
    margin: 0 0 32px;
    font-size: 15px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.78);
}

.auth-aside__points {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0 0 32px;
    padding: 0;
    list-style: none;
}

.auth-aside__points li {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    background-color: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.auth-aside__points strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
}

.auth-aside__points small {
    display: block;
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.7);
}

.auth-aside__point-icon {
    flex: 0 0 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--auth-primary);
    background-color: #ffffff;
    border-radius: 10px;
}

.auth-aside__foot {
    margin: auto 0 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.65);
}

/* ---------- Form card ---------- */
.auth-card {
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
    padding: 36px 32px 32px;
    background-color: #ffffff;
    color: var(--auth-text);
    border-radius: var(--auth-radius);
    box-shadow:
        0 1px 2px rgba(16, 24, 40, 0.04),
        0 24px 60px -24px rgba(16, 24, 40, 0.22);
}

/* Inside the shell the card is just the right-hand column */
.auth-shell .auth-card {
    max-width: none;
    border-radius: 0;
    box-shadow: none;
    padding: 44px 48px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-shell .auth-card > * {
    width: 100%;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
}

.auth-shell--wide .auth-card > * {
    max-width: 620px;
}

.auth-card__head {
    margin-bottom: 26px;
}

.auth-card__head--center {
    text-align: center;
}

.auth-card__icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    font-size: 24px;
    color: var(--auth-primary);
    background-color: var(--auth-primary-soft);
}

.auth-card__icon--success {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    font-size: 32px;
    color: #ffffff;
    background-color: #16a34a;
    box-shadow: 0 0 0 10px #dcfce7, 0 12px 30px -8px rgba(22, 163, 74, 0.6);
    margin-bottom: 26px;
}

.auth-card__title {
    margin: 0 0 8px;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--auth-text);
}

.auth-card__subtitle {
    margin: 0;
    font-size: 15px;
    line-height: 1.55;
    color: var(--auth-muted);
}

.auth-card__subtitle strong {
    color: var(--auth-text);
}

/* ---------- Login / Register tabs ---------- */
.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin-bottom: 28px;
    padding: 4px;
    background-color: #f1f3f6;
    border-radius: 14px;
}

.auth-tabs a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    font-size: 14px;
    font-weight: 600;
    color: var(--auth-muted);
    text-decoration: none;
    border-radius: 10px;
    transition: color 0.2s, background-color 0.2s, box-shadow 0.2s;
}

.auth-tabs a:hover {
    color: var(--auth-text);
}

.auth-tabs a.is-active {
    color: var(--auth-text);
    background-color: #ffffff;
    box-shadow: 0 1px 3px rgba(16, 24, 40, 0.1), 0 1px 2px rgba(16, 24, 40, 0.06);
}

/* ---------- Alerts ---------- */
.auth-alert {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 20px;
    padding: 12px 14px;
    border-radius: var(--auth-field-radius);
    font-size: 14px;
    line-height: 1.45;
}

.auth-alert i {
    margin-top: 2px;
}

.auth-alert--success {
    color: #166534;
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
}

.auth-alert--error {
    color: #991b1b;
    background-color: #fef2f2;
    border: 1px solid #fecaca;
}

/* ---------- Form ---------- */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.auth-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}

@media (min-width: 576px) {
    .auth-grid {
        grid-template-columns: 1fr 1fr;
    }

    .auth-grid .auth-field--full {
        grid-column: 1 / -1;
    }
}

.auth-section-label {
    grid-column: 1 / -1;
    margin: 6px 0 -4px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--auth-muted);
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
}

.auth-label {
    margin: 0;
    font-size: 13.5px;
    font-weight: 600;
    color: #374151;
}

.auth-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.auth-req {
    color: var(--auth-danger);
}

.auth-optional {
    font-weight: 400;
    font-size: 12px;
    color: var(--auth-muted);
}

.auth-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-icon {
    position: absolute;
    left: 16px;
    z-index: 1;
    font-size: 16px;
    color: #9ca3af;
    pointer-events: none;
    transition: color 0.2s;
}

.auth-input {
    width: 100%;
    height: 52px;
    padding: 0 16px 0 46px;
    font-size: 15px;
    color: var(--auth-text);
    background-color: var(--auth-field-bg);
    border: 1.5px solid transparent;
    border-radius: var(--auth-field-radius);
    outline: none;
    box-shadow: inset 0 0 0 1px var(--auth-line);
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.auth-input--plain {
    padding-left: 16px;
}

.auth-input--has-toggle {
    padding-right: 52px;
}

.auth-input::placeholder {
    color: #a3a9b3;
}

.auth-input:hover {
    background-color: #f2f4f7;
}

.auth-input:focus {
    background-color: #ffffff;
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 4px var(--auth-primary-ring);
}

.auth-input-wrap:focus-within .auth-input-icon {
    color: var(--auth-primary);
}

.auth-input[type="file"] {
    height: auto;
    min-height: 52px;
    padding: 10px 12px;
    font-size: 14px;
    color: var(--auth-muted);
    cursor: pointer;
    background-color: #ffffff;
    border: 1.5px dashed #cfd5dd;
    box-shadow: none;
}

.auth-input[type="file"]:hover {
    border-color: var(--auth-primary);
}

.auth-input[type="file"]::file-selector-button {
    margin-right: 12px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--auth-primary);
    background-color: var(--auth-primary-soft);
    border: 0;
    border-radius: 8px;
    cursor: pointer;
}

.auth-input--otp {
    height: 60px;
    padding-left: 16px;
    text-align: center;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 0.6em;
    text-indent: 0.6em;
}

.auth-input--otp::placeholder {
    letter-spacing: 0.4em;
}

.auth-field.is-invalid .auth-input {
    background-color: #fffafa;
    border-color: var(--auth-danger);
    box-shadow: none;
}

.auth-field.is-invalid .auth-input:focus {
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.12);
}

.auth-field.is-invalid .auth-input-icon {
    color: var(--auth-danger);
}

.auth-error {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--auth-danger);
}

.auth-error::before {
    content: "\f06a";
    font-family: "Font Awesome 7 Pro", "Font Awesome 6 Pro", "Font Awesome 6 Free", sans-serif;
    font-weight: 400;
    font-size: 12px;
}

.auth-hint {
    font-size: 12.5px;
    color: var(--auth-muted);
}

.auth-toggle {
    position: absolute;
    right: 6px;
    z-index: 1;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: #6b7280;
    background: transparent;
    border: 0;
    border-radius: 10px;
    cursor: pointer;
    transition: color 0.2s, background-color 0.2s;
}

.auth-toggle:hover {
    color: var(--auth-text);
    background-color: rgba(17, 24, 39, 0.06);
}

.auth-toggle:focus-visible {
    outline: 2px solid var(--auth-primary);
    outline-offset: 1px;
}

/* ---------- Buttons ---------- */
.auth-btn {
    position: relative;
    width: 100%;
    min-height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    border-radius: var(--auth-field-radius);
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.auth-btn:active {
    transform: translateY(1px);
}

.auth-btn:focus-visible {
    outline: 2px solid var(--auth-primary);
    outline-offset: 3px;
}

.auth-btn--primary {
    color: var(--auth-on-primary);
    background-color: var(--auth-primary);
    background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0) 60%);
    border-color: var(--auth-primary);
    box-shadow: 0 10px 24px -10px var(--auth-primary);
}

.auth-btn--primary:hover {
    color: var(--auth-on-primary);
    background-color: var(--auth-primary-deep);
    border-color: var(--auth-primary-deep);
    box-shadow: 0 14px 28px -12px var(--auth-primary);
    transform: translateY(-1px);
}

.auth-btn__arrow {
    font-size: 14px;
    transition: transform 0.2s;
}

.auth-btn:hover .auth-btn__arrow {
    transform: translateX(4px);
}

.auth-btn--outline {
    color: var(--auth-text);
    background-color: #ffffff;
    border-color: var(--auth-line);
}

.auth-btn--outline:hover {
    color: var(--auth-text);
    background-color: #f9fafb;
    border-color: #cfd5dd;
}

.auth-btn--google svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.auth-btn-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* ---------- Divider & footer ---------- */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 12.5px;
    color: #9ca3af;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background-color: var(--auth-line);
}

.auth-footer {
    margin: 6px 0 0;
    text-align: center;
    font-size: 14px;
    color: var(--auth-muted);
}

.auth-link {
    font-weight: 600;
    color: var(--auth-primary);
    text-decoration: none;
}

.auth-link:hover {
    color: var(--auth-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ---------- OTP timer ---------- */
.auth-timer {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--auth-primary);
    background-color: var(--auth-primary-soft);
    border-radius: 999px;
    white-space: nowrap;
}

/* ---------- Choice cards (Customer / Reseller / Merchant) ---------- */
.auth-choice-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-choice {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px;
    color: var(--auth-text);
    text-decoration: none;
    background-color: #ffffff;
    border: 1.5px solid var(--auth-line);
    border-radius: 16px;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s, background-color 0.2s;
}

.auth-choice:hover {
    color: var(--auth-text);
    border-color: var(--auth-primary);
    background-color: #fcfdfd;
    box-shadow: 0 14px 30px -16px rgba(16, 24, 40, 0.3);
    transform: translateY(-2px);
}

.auth-choice:focus-visible {
    outline: 2px solid var(--auth-primary);
    outline-offset: 2px;
}

.auth-choice__icon {
    flex: 0 0 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    border-radius: 14px;
    color: var(--auth-primary);
    background-color: var(--auth-primary-soft);
    transition: background-color 0.2s, color 0.2s;
}

.auth-choice:hover .auth-choice__icon {
    color: var(--auth-on-primary);
    background-color: var(--auth-primary);
}

.auth-choice__text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
    line-height: 1.35;
}

.auth-choice__text strong {
    font-size: 16px;
    font-weight: 600;
}

.auth-choice__text small {
    font-size: 13px;
    color: var(--auth-muted);
}

.auth-choice__arrow {
    flex: 0 0 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: #9ca3af;
    background-color: #f3f4f6;
    border-radius: 50%;
    transition: transform 0.2s, color 0.2s, background-color 0.2s;
}

.auth-choice:hover .auth-choice__arrow {
    color: var(--auth-primary);
    background-color: var(--auth-primary-soft);
    transform: translateX(3px);
}

/* ---------- Tablet & mobile: brand panel becomes a hero band ---------- */
@media (max-width: 991.98px) {
    .auth-page {
        padding: 32px 0 56px;
    }

    .auth-shell {
        max-width: 560px;
    }

    .auth-shell--wide {
        max-width: 720px;
    }

    .auth-aside__inner {
        padding: 30px 28px 56px;
    }

    .auth-aside__brand {
        margin-bottom: 14px;
    }

    .auth-aside__heading {
        font-size: 22px;
        margin-bottom: 8px;
    }

    .auth-aside__text {
        margin-bottom: 0;
        font-size: 14px;
    }

    .auth-aside__points,
    .auth-aside__foot {
        display: none;
    }

    .auth-shell .auth-card {
        position: relative;
        z-index: 1;
        margin-top: -28px;
        padding: 32px 28px 32px;
        border-radius: var(--auth-radius) var(--auth-radius) 0 0;
    }
}

@media (max-width: 575.98px) {
    .auth-page {
        padding: 0 0 40px;
        background-image: none;
        background-color: #ffffff;
    }

    .auth-page > .container {
        padding-left: 0;
        padding-right: 0;
    }

    .auth-shell {
        border-radius: 0;
        box-shadow: none;
    }

    .auth-aside__inner {
        padding: 26px 20px 52px;
    }

    .auth-aside__heading {
        font-size: 20px;
    }

    .auth-shell .auth-card {
        padding: 28px 20px 8px;
    }

    /* Standalone card (success pages) on phones */
    .auth-page > .container > .auth-card {
        margin-top: 24px;
        padding: 32px 20px;
        box-shadow: none;
    }

    .auth-card__title {
        font-size: 24px;
    }

    /* 16px stops iOS from zooming into the field */
    .auth-input {
        font-size: 16px;
    }
}

.auth-link--sm {
    font-size: 13px;
}
