/* ==========================================================================
   BestMart — Login & Registration
   ========================================================================== */
body.bmd-ui, .bmd-ui .aiz-main-wrapper { background: #fff; }

.bma { position: relative; padding: 40px 0 72px; background: radial-gradient(900px 500px at 100% 0%, var(--bm-primary-soft), transparent 60%), radial-gradient(700px 420px at 0% 100%, var(--bm-accent-soft), transparent 60%), #fff; }
@media (max-width: 991px) { .bma { padding: 20px 0 110px; } }
.bma__shell { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 480px); gap: 56px; align-items: center; min-height: calc(100vh - 220px); }
@media (max-width: 991px) { .bma__shell { grid-template-columns: minmax(0, 1fr); min-height: 0; gap: 24px; } }

/* ---------- Brand side ---------- */
.bma__brand { position: relative; overflow: hidden; border-radius: 32px; padding: 48px; min-height: 560px; color: #C7D3E6; background: radial-gradient(120% 90% at 0% 0%, #1a5cff 0%, var(--bm-ink) 60%); display: flex; flex-direction: column; gap: 22px; animation: bmd-page-in .9s var(--bm-ease) backwards; }
@media (max-width: 991px) { .bma__brand { display: none; } }
.bma__dots { position: absolute; inset: 0; opacity: .18; background-image: radial-gradient(rgba(255,255,255,.7) 1px, transparent 1px); background-size: 18px 18px; mask-image: radial-gradient(70% 60% at 60% 70%, #000, transparent); -webkit-mask-image: radial-gradient(70% 60% at 60% 70%, #000, transparent); pointer-events: none; }
.bma__brand > * { position: relative; }
.bma__eyebrow { display: inline-flex; align-self: flex-start; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14); color: #fff; font-size: 13px; font-weight: 700; }
.bma__brand h1 { color: #fff; font-size: clamp(30px, 3.2vw, 42px); line-height: 1.1; letter-spacing: -.03em; font-weight: 800; margin: 0; }
.bma__brand p { margin: 0; font-size: 16px; line-height: 1.65; max-width: 420px; }
.bma__perks { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.bma__perks li { display: flex; gap: 12px; align-items: center; font-size: 15px; color: #E3EAF5; }
.bma__perks li span { width: 36px; height: 36px; border-radius: 11px; background: rgba(255,255,255,.1); display: flex; align-items: center; justify-content: center; color: #FF9A6B; flex: none; }
.bma__floats { position: relative; margin-top: auto; height: 120px; }
.bma__float { position: absolute; background: #fff; color: var(--bm-ink); border-radius: 18px; padding: 12px 14px; display: flex; gap: 10px; align-items: center; box-shadow: 0 24px 48px -20px rgba(0,0,0,.45); font-size: 13.5px; font-weight: 700; }
.bma__float small { display: block; color: var(--bm-muted); font-weight: 600; font-size: 12px; }
.bma__float:nth-child(1) { left: 0; top: 0; }
.bma__float:nth-child(2) { right: 0; bottom: 0; }

/* ---------- Card ---------- */
.bma__card { position: relative; background: #fff; border: 1px solid var(--bm-line-soft); border-radius: 28px; padding: 36px; box-shadow: 0 40px 80px -40px rgba(10, 37, 82, .35); animation: bmd-page-in .8s var(--bm-ease) .1s backwards; }
@media (max-width: 575px) { .bma__card { padding: 24px 20px; border-radius: 24px; box-shadow: 0 24px 48px -30px rgba(10, 37, 82, .35); } }
.bma__logo { display: none; margin: 0 auto 18px; height: 34px; }
/* The header already shows the logo */

/* Steps (kept class names used by the existing scripts) */
.bma .login-step, .bma .reg-step { display: none; }
.bma .login-step.active, .bma .reg-step.active { display: block; animation: bma-step-in .45s var(--bm-ease); }
@keyframes bma-step-in { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }

.bma .step-header { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 24px; }
.bma .step-icon { width: 52px; height: 52px; border-radius: 16px; background: var(--bm-primary-soft); color: var(--bm-primary); display: flex; align-items: center; justify-content: center; flex: none; animation: bmd-pop-in .5s var(--bm-spring); }
.bma .step-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.step-icon--accent { background: var(--bm-accent-soft); color: var(--bm-accent); }
.step-icon--success { background: var(--bm-success-soft); color: var(--bm-success-ink); }
.bma .step-title { font-size: 22px; font-weight: 800; color: var(--bm-ink); letter-spacing: -.02em; line-height: 1.25; }
.bma .step-sub { font-size: 14px; color: var(--bm-muted); margin-top: 4px; line-height: 1.55; }

.bma .field-label { font-size: 13px; font-weight: 700; color: var(--bm-ink); margin-bottom: 8px; }
.bma .phone-row { display: flex; align-items: center; height: 56px; border: 1.5px solid var(--bm-line); border-radius: 16px; background: #fff; overflow: hidden; transition: border-color .2s, box-shadow .2s; }
.bma .phone-row:focus-within { border-color: var(--bm-primary); box-shadow: 0 0 0 4px var(--bm-primary-ring); }
.bma .phone-row.active { border-color: var(--bm-success); }
.bma .phone-prefix { height: 100%; display: flex; align-items: center; gap: 6px; padding: 0 14px; background: var(--bm-bg-soft); border-right: 1px solid var(--bm-line); font-weight: 800; color: var(--bm-ink); font-size: 15px; }
.bma .phone-row input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; padding: 0 16px; font: 700 18px var(--bm-font); letter-spacing: 1.5px; color: var(--bm-ink); background: transparent; }
.bma .phone-row input::placeholder { color: #B3BDCC; font-weight: 500; letter-spacing: 1px; }
.bma .bma-ok { margin-right: 14px; color: var(--bm-success); opacity: 0; transform: scale(.5); transition: all .3s var(--bm-spring); display: flex; }
.bma .phone-row.active .bma-ok { opacity: 1; transform: none; }

.bma .bma-input { width: 100%; height: 54px; padding: 0 16px; border: 1.5px solid var(--bm-line); border-radius: 16px; font: 600 16px var(--bm-font); color: var(--bm-ink); outline: none; background: #fff; transition: border-color .2s, box-shadow .2s; }
.bma .bma-input:focus { border-color: var(--bm-primary); box-shadow: 0 0 0 4px var(--bm-primary-ring); }
.bma .bma-input::placeholder { color: #A3AEC0; font-weight: 500; }
.bma .bma-pw { position: relative; }
.bma .bma-pw .bma-input { padding-right: 52px; }
.bma-pw__toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0; background: transparent; color: var(--bm-subtle); border-radius: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.bma-pw__toggle:hover { background: var(--bm-bg-soft); color: var(--bm-ink); }
.bma-pw__toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.bma .error-feedback { display: none; align-items: center; gap: 8px; margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--bm-danger-soft); color: var(--bm-danger-ink); font-size: 13.5px; font-weight: 600; animation: bmd-fade-down .25s var(--bm-ease); }
.bma .error-feedback svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.bma .info-chip { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--bm-info-soft); color: #0A3C8C; font-size: 13px; font-weight: 600; }
.bma .info-chip svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }

.bma .btn-orange { position: relative; width: 100%; height: 56px; margin-top: 20px; border: 0; border-radius: 16px; background: var(--bm-primary); color: #fff; font: 800 16px var(--bm-font); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px; overflow: hidden; transition: transform .25s var(--bm-ease), box-shadow .25s, background-color .2s; text-decoration: none !important; }
.bma .btn-orange:hover { background: var(--bm-primary-hover); transform: translateY(-2px); box-shadow: 0 14px 28px -14px rgba(0, 108, 253, .7); color: #fff; }
.bma .btn-orange:active { transform: scale(.98); }
.bma .btn-orange[disabled] { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.bma .btn-orange .spinner { display: none; width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid rgba(255,255,255,.35); border-top-color: #fff; animation: bmd-spin .7s linear infinite; }
.bma .btn-orange.loading .spinner { display: block; }
.bma .btn-orange.loading .btn-text { opacity: .8; }
.btn-orange--accent { background: var(--bm-accent); }
.btn-orange--accent:hover { background: var(--bm-accent-hover); box-shadow: 0 14px 28px -14px rgba(255, 94, 24, .7); }

.bma .bma-alt { margin-top: 18px; text-align: center; font-size: 14px; color: var(--bm-muted); }
.bma .bma-alt a { color: var(--bm-primary); font-weight: 800; text-decoration: none; }
.bma .bma-divider { display: flex; align-items: center; gap: 12px; margin: 22px 0 14px; color: var(--bm-subtle); font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; }
.bma .bma-divider::before, .bma .bma-divider::after { content: ''; flex: 1; height: 1px; background: var(--bm-line); }
.bma .social-row { display: flex; gap: 10px; }
.bma .social-btn { flex: 1; height: 50px; border-radius: 14px; border: 1.5px solid var(--bm-line); display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--bm-ink) !important; font-weight: 700; text-decoration: none !important; transition: all .25s var(--bm-ease); }
.bma .social-btn:hover { border-color: var(--bm-primary); transform: translateY(-2px); box-shadow: var(--bm-shadow); }

/* Returning user chip */
.bma .user-chip { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--bm-bg-soft); margin-bottom: 18px; }
.bma .user-avatar { width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(135deg, var(--bm-primary), var(--bm-sky)); color: #fff; font-weight: 800; font-size: 18px; display: flex; align-items: center; justify-content: center; flex: none; }
.bma .user-name { font-weight: 800; color: var(--bm-ink); }
.bma .user-phone { font-size: 13px; color: var(--bm-muted); }
.bma .change-btn { border: 0; background: #fff; color: var(--bm-primary); font: 700 13px var(--bm-font); padding: 8px 12px; border-radius: 10px; cursor: pointer; box-shadow: var(--bm-shadow-sm); }
.bma .bma-row { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; font-size: 13.5px; }
.bma .bma-row label { display: flex; align-items: center; gap: 8px; color: var(--bm-text); margin: 0; cursor: pointer; }
.bma .bma-row input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--bm-primary); }
.bma .bma-row a { color: var(--bm-primary); font-weight: 700; text-decoration: none; }

/* Progress (registration) */
.bma #progressWrap { margin-bottom: 22px; }
.bma-progress__meta { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 700; color: var(--bm-muted); margin-bottom: 8px; }
.bma-progress__meta b { color: var(--bm-ink); }
.bma .bma-progress { height: 6px; border-radius: 6px; background: var(--bm-line-soft); overflow: hidden; }
.bma #progressBar { height: 100%; width: 0; border-radius: 6px; background: linear-gradient(90deg, var(--bm-primary), var(--bm-sky)); transition: width .6s var(--bm-ease); }

/* OTP */
.bma .otp-row { display: flex; gap: 12px; justify-content: center; margin: 8px 0 6px; }
.bma .otp-box { width: 62px; height: 66px; text-align: center; border: 1.5px solid var(--bm-line); border-radius: 18px; font: 800 26px var(--bm-font); color: var(--bm-ink); outline: none; transition: all .2s var(--bm-ease); background: #fff; }
.bma .otp-box:focus { border-color: var(--bm-primary); box-shadow: 0 0 0 4px var(--bm-primary-ring); transform: translateY(-3px); }
.bma .otp-box.filled { border-color: var(--bm-primary); background: var(--bm-primary-soft); animation: bmd-pop-in .3s var(--bm-spring); }
.bma .otp-box.is-invalid-custom { border-color: var(--bm-danger); background: var(--bm-danger-soft); animation: bmd-shake .4s var(--bm-ease); }
@media (max-width: 380px) { .bma .otp-box { width: 54px; height: 60px; } }
.bma #timerRow { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 16px; font-size: 13.5px; color: var(--bm-muted); font-weight: 600; }
.bma #timerRow svg { transform: rotate(-90deg); }
.bma #timerRow .bma-timer-wrap { position: relative; width: 34px; height: 34px; }
.bma #timerNum { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; color: var(--bm-primary); }
.bma #resendBtn { display: none; border: 0; background: transparent; color: var(--bm-primary); font: 800 14px var(--bm-font); cursor: pointer; padding: 6px 10px; border-radius: 10px; }
.bma #resendBtn:hover { background: var(--bm-primary-soft); }

/* Location step */
.bma .pincode-wrap { position: relative; }
.bma #pincodeResults { display: none; position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20; background: #fff; border: 1px solid var(--bm-line); border-radius: 16px; box-shadow: var(--bm-shadow-lg); max-height: 240px; overflow-y: auto; padding: 6px; animation: bmd-fade-down .2s var(--bm-ease); }
.bma .pincode-item { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; cursor: pointer; }
.bma .pincode-item:hover { background: var(--bm-bg-soft); }
.bma .pincode-item svg { stroke: var(--bm-accent) !important; }
.bma #selectedLocation { display: none; margin-top: 14px; padding: 14px 16px; border-radius: 16px; background: var(--bm-success-soft); color: #0F5132; animation: bmd-pop-in .35s var(--bm-spring); }
.bma #selectedLocation b { font-size: 16px; }
.bma .bma-gps { margin-top: 12px; border: 1.5px dashed rgba(255, 94, 24, .5); background: var(--bm-accent-soft); color: var(--bm-accent); border-radius: 14px; height: 46px; width: 100%; font: 700 14px var(--bm-font); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; transition: all .25s var(--bm-ease); }
.bma .bma-gps:hover { border-style: solid; transform: translateY(-1px); }

/* Password strength chips */
.bma #strengthChips { display: none; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.bma .str-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: var(--bm-bg-soft); color: var(--bm-muted); font-size: 12.5px; font-weight: 700; transition: all .3s var(--bm-ease); }
.bma .str-chip svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.bma .str-chip.met { background: var(--bm-success-soft); color: var(--bm-success-ink); }
.bma .bma-terms { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; font-size: 13.5px; color: var(--bm-text); line-height: 1.5; cursor: pointer; }
.bma .bma-terms input { width: 18px; height: 18px; accent-color: var(--bm-primary); margin-top: 1px; flex: none; }
.bma .bma-terms a { color: var(--bm-primary); font-weight: 700; }

/* Success */
.bma .bma-success { text-align: center; padding: 10px 0; }
.bma .bma-success .bmd-success-tick { width: 88px; height: 88px; }
.bma .bma-success h2 { font-size: 26px; font-weight: 800; color: var(--bm-ink); margin: 20px 0 6px; }
.bma .bma-success p { color: var(--bm-muted); margin: 0 0 6px; }

/* ── Phase 8b: recovery & verification pages ── */
.bma .bma-steps { list-style: none; display: flex; gap: 6px; padding: 0; margin: 0 0 22px; counter-reset: s; }
.bma .bma-steps li { flex: 1; display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; color: var(--bm-muted); padding-bottom: 10px; border-bottom: 3px solid var(--bm-line); transition: all .35s var(--bm-ease); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bma .bma-steps li span { flex: 0 0 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--bm-bg-soft); font-size: 12px; transition: all .35s var(--bm-ease); }
.bma .bma-steps li.is-on { color: var(--bm-ink); border-color: var(--bm-primary); }
.bma .bma-steps li.is-on span { background: var(--bm-primary); color: #fff; box-shadow: 0 0 0 4px var(--bm-primary-ring); }
.bma .bma-steps li.is-done { color: var(--bm-success-ink); border-color: var(--bm-success); }
.bma .bma-steps li.is-done span { background: var(--bm-success); color: #fff; }
.bma .bma-tabs { display: flex; gap: 4px; padding: 4px; background: var(--bm-bg-soft); border-radius: 16px; margin-bottom: 18px; }
.bma .bma-tab { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 44px; border: 0; border-radius: 12px; background: transparent; color: var(--bm-muted); font: 700 14px var(--bm-font); cursor: pointer; transition: all .25s var(--bm-ease); }
.bma .bma-tab:hover { color: var(--bm-ink); }
.bma .bma-tab.active { background: #fff; color: var(--bm-primary); box-shadow: 0 6px 16px -10px rgba(10, 37, 82, .45); }
.bma .bma-code { width: 100%; height: 62px; text-align: center; letter-spacing: .5em; padding-left: .5em; border: 1.5px solid var(--bm-line); border-radius: 18px; font: 800 26px var(--bm-font); color: var(--bm-ink); outline: none; background: #fff; transition: all .2s var(--bm-ease); }
.bma .bma-code:focus { border-color: var(--bm-primary); box-shadow: 0 0 0 4px var(--bm-primary-ring); }
.bma .bma-code::placeholder { color: #C9D1DD; letter-spacing: .35em; }
.bma .bma-code.is-invalid-custom, .bma .bma-input.is-invalid-custom { border-color: var(--bm-danger); background: var(--bm-danger-soft); animation: bmd-shake .4s var(--bm-ease); }
.bma .bma-flash { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; font-size: 13.5px; font-weight: 600; margin-bottom: 16px; background: var(--bm-danger-soft); color: var(--bm-danger); }
.bma .bma-flash--ok { background: var(--bm-success-soft); color: var(--bm-success-ink); }
.bma .bma-flash svg { flex: 0 0 18px; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.bma .bma-mailart { width: 92px; height: 92px; margin: 4px auto 18px; border-radius: 28px; display: flex; align-items: center; justify-content: center; background: var(--bm-primary-soft); color: var(--bm-primary); animation: bmd-pop-in .5s var(--bm-spring); position: relative; }
.bma .bma-mailart::after { content: ""; position: absolute; inset: -8px; border-radius: 34px; border: 2px dashed var(--bm-primary-ring); animation: bma-spin 18s linear infinite; }
@keyframes bma-spin { to { transform: rotate(360deg); } }
.bma .bma-center { text-align: center; }
.bma .bma-center .step-title { font-size: 24px; }
.bma .bma-center .step-sub { font-size: 14.5px; max-width: 360px; margin: 6px auto 0; }
.bma .btn-ghost { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 50px; margin-top: 12px; border: 1.5px solid var(--bm-line); border-radius: 16px; background: #fff; color: var(--bm-ink); font: 700 15px var(--bm-font); text-decoration: none; cursor: pointer; transition: all .2s var(--bm-ease); }
.bma .btn-ghost:hover { border-color: var(--bm-primary); color: var(--bm-primary); text-decoration: none; }
@media (max-width: 400px) { .bma .bma-steps li { font-size: 0; gap: 0; justify-content: center; } .bma .bma-steps li span { font-size: 12px; } }
.bma .bmd-field { margin-bottom: 14px; gap: 0; }
.bma .bmd-field .field-label { margin-top: 0; }
.bma .bmd-field .bmd-hint:not(:empty) { margin-top: 7px; }
.bma .bmd-field.is-invalid .bma-input, .bma .bmd-field.is-invalid .bma-code, .bma .bmd-field.is-invalid .phone-row { border-color: var(--bm-danger); box-shadow: 0 0 0 4px rgba(229, 72, 77, .12); animation: bmd-shake .4s var(--bm-ease); }
.bma .bmd-field.is-valid .bma-input, .bma .bmd-field.is-valid .bma-code, .bma .bmd-field.is-valid .phone-row { border-color: var(--bm-success); }
.bma .btn-orange.is-loading .spinner { display: block; }
.bma .btn-orange.is-loading .btn-text { display: none; }
.bma .btn-orange.is-loading { pointer-events: none; }
