/* Merchant signup — same design tokens as the merchant dashboard (dashboard/dashboard.css). */
:root {
  --bg: #f5f5f7; --surface: #fff; --surface-2: #fafafa;
  --line: rgba(15, 23, 42, .08); --line-strong: rgba(15, 23, 42, .16);
  --ink: #1d1d1f; --ink-2: #3a3a3c; --muted: #6e6e73; --faint: #aeaeb2;
  --accent: #2563eb; --accent-ink: #1d4ed8; --accent-soft: #eaf1ff;
  --green: #059669; --green-soft: #ecfdf5; --red: #dc2626; --red-soft: #fef2f2;
  --radius-card: 16px; --radius-ctl: 10px;
  --shadow-card: 0 1px 2px rgba(15, 23, 42, .04), 0 10px 30px -18px rgba(15, 23, 42, .18);
  --shadow-pop: 0 12px 40px -12px rgba(15, 23, 42, .28);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.45; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* Top bar */
.signup-nav { position: sticky; top: 0; z-index: 50; background: rgba(245, 245, 247, .82); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid var(--line); }
.signup-nav__inner { max-width: 960px; margin: 0 auto; min-height: 60px; padding: 8px clamp(16px, 3vw, 24px); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.signup-brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.signup-brand img { width: 30px; height: 30px; object-fit: contain; }
.signup-nav__title { font-size: 13px; color: var(--muted); font-weight: 500; }
.signup-nav__side { display: flex; align-items: center; gap: 12px; }

/* Language picker */
.language-switcher { position: relative; }
.language-toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 10px 0 8px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); font-size: 13px; font-weight: 600; }
.language-toggle:hover { background: var(--surface-2); }
.language-flag { width: 18px; height: 12px; object-fit: cover; border-radius: 2px; }
.language-dropdown { position: absolute; top: calc(100% + 8px); inset-inline-end: 0; min-width: 200px; max-height: min(62vh, 420px); overflow-y: auto; padding: 6px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-pop); z-index: 60; }
.language-option { width: 100%; display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 6px 10px; border: 0; border-radius: 8px; background: transparent; font-size: 14px; font-weight: 500; text-align: start; }
.language-option:hover { background: var(--bg); }
.language-option.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }

/* Layout */
.signup-main { max-width: 960px; margin: 0 auto; padding: 28px clamp(16px, 3vw, 24px) 64px; }
.signup-hero { margin: 4px 0 20px; }
.signup-hero h1 { margin: 0; font-size: clamp(24px, 3.4vw, 32px); font-weight: 700; letter-spacing: -.025em; line-height: 1.15; }
.signup-hero p { margin: 6px 0 0; color: var(--muted); font-size: 15px; }

/* Progress */
.progress-shell { margin-bottom: 16px; }
.progress-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.progress-meta .step-eyebrow { font-size: 12px; font-weight: 600; color: var(--muted); }
.progress-meta .step-current-label { display: none; }
.progress-meta .step-count { font-size: 12px; color: var(--faint); white-space: nowrap; }
.step-track { position: relative; display: flex; justify-content: space-between; gap: 4px; }
.step-track::before { content: ''; position: absolute; top: 13px; inset-inline: 14px; height: 2px; background: var(--line); z-index: 0; }
.step-track-fill { position: absolute; top: 13px; inset-inline-start: 14px; height: 2px; background: var(--accent); z-index: 1; width: 0%; transition: width .35s ease; }
.step-node { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; min-width: 0; cursor: default; }
.step-node.is-clickable { cursor: pointer; }
.step-dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--bg); border: 2px solid var(--line-strong); color: var(--muted); transition: all .2s ease; }
.step-node.active .step-dot { border-color: var(--accent); background: var(--accent); color: #fff; box-shadow: 0 0 0 4px rgba(37, 99, 235, .14); }
.step-node.completed .step-dot { border-color: var(--green); background: var(--green); color: #fff; }
.step-node .step-text { display: none; text-align: center; }
.step-node .step-label { font-size: 12px; font-weight: 500; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.step-node.active .step-label { color: var(--ink); font-weight: 600; }
.step-node.completed .step-label { color: var(--ink-2); }
@media (min-width: 640px) { .step-node .step-text { display: block; } }

/* Card + sections */
.signup-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding: clamp(20px, 3vw, 32px); }
.form-step h2 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.form-step .step-intro { margin: 4px 0 22px; color: var(--muted); font-size: 14px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.field-grid .span-2 { grid-column: 1 / -1; }
@media (max-width: 640px) { .field-grid { grid-template-columns: 1fr; } }
.form-group { margin: 0; min-width: 0; }
.form-group > label, .field-label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.help { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.error-text { color: var(--red); font-size: 12.5px; margin-top: 6px; }

/* Controls */
.input-field { width: 100%; min-height: 44px; padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-ctl); background: var(--surface); color: var(--ink); font-size: 15px; transition: border-color .15s ease, box-shadow .15s ease; }
.input-field:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, .16); }
.input-field.error { border-color: var(--red); }
.input-field[readonly] { background: var(--surface-2); color: var(--muted); }
select.input-field { appearance: none; -webkit-appearance: none; padding-inline-end: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%236e6e73' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
html[dir="rtl"] select.input-field { background-position: left 14px center; }
input[type="file"].input-field { padding: 6px; font-size: 13px; color: var(--muted); }
input[type="file"].input-field::file-selector-button { margin-inline-end: 10px; padding: 7px 12px; border: 0; border-radius: 8px; background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; cursor: pointer; }
.btn-primary, .btn-secondary, .btn-ghost { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: var(--radius-ctl); font-size: 14px; font-weight: 600; line-height: 1; white-space: nowrap; transition: background .15s ease, opacity .15s ease; }
.btn-primary { background: var(--accent); color: #fff; border: 1px solid transparent; }
.btn-primary:hover { background: var(--accent-ink); }
.btn-secondary { background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--accent-ink); border: 0; padding: 0 6px; min-height: 36px; }
.btn-ghost:hover { text-decoration: underline; }
.checkbox-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; font-size: 14px; color: var(--ink-2); }
.checkbox-item input { margin-top: 2px; width: 18px; height: 18px; accent-color: var(--accent); flex-shrink: 0; }
.checkbox-item + .checkbox-item { margin-top: 10px; }
.form-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.form-actions > div { flex: 1; }

/* Owner phones (markup generated by the script) */
#ownerPhonesList > div { display: flex; align-items: center; gap: 8px; }
#ownerPhonesList button { min-height: 40px; min-width: 40px; border-radius: 8px; color: var(--muted); }
#ownerPhonesList button:hover { color: var(--red); background: var(--red-soft); }

/* File lists */
.file-list { display: grid; gap: 6px; margin-top: 8px; }
.file-list > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); font-size: 13px; }
.file-list button { color: var(--red); font-weight: 600; background: transparent; border: 0; font-size: 13px; }

/* Locations */
.locations-search-row { display: flex; gap: 10px; flex-wrap: wrap; }
.locations-search-row .input-field { flex: 1 1 220px; min-width: 0; }
.locations-hint { font-size: 12.5px; color: var(--muted); margin: 0 0 10px; }
.locations-feedback { font-size: 13px; margin-top: 8px; color: var(--muted); }
.locations-feedback.is-error { color: var(--red); }
.locations-results { margin-top: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); max-height: 240px; overflow-y: auto; display: none; }
.locations-results.is-open { display: block; }
.location-result-item { width: 100%; text-align: start; padding: 12px 14px; border: 0; border-bottom: 1px solid var(--line); background: transparent; cursor: pointer; }
.location-result-item:last-child { border-bottom: 0; }
.location-result-item:hover { background: var(--surface-2); }
.location-result-item .result-name { font-weight: 600; color: var(--ink); display: block; }
.location-result-item .result-address { font-size: 13px; color: var(--muted); display: block; margin-top: 2px; }
.location-result-item.is-selected { background: var(--accent-soft); cursor: default; }
.location-result-item .result-selected-badge { display: inline-block; margin-top: 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; color: var(--accent-ink); background: #dbeafe; border-radius: 999px; padding: 2px 8px; }
.signup-map-surface { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #e8f0fe; height: 280px; margin-top: 10px; }
.signup-map-canvas { width: 100%; height: 100%; min-height: 280px; }
.signup-map-status { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; text-align: center; font-size: 13px; color: var(--muted); background: #e8f0fe; z-index: 1; pointer-events: none; }
.signup-map-status.is-hidden { display: none; }
.signup-map-status.is-error { color: var(--red); background: var(--red-soft); }
.selected-locations { display: grid; gap: 10px; margin-top: 10px; }
.selected-location-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--surface); display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; }
.selected-location-card.is-principal { border-color: rgba(37, 99, 235, .35); background: #f8fbff; }
.location-badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 2px 8px; font-size: 11px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; }
.location-badge.principal { background: #dbeafe; color: var(--accent-ink); }
.location-badge.secondary { background: rgba(15, 23, 42, .06); color: var(--muted); }
.location-card-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-location { min-height: 34px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); border-radius: 8px; padding: 0 10px; font-size: 12.5px; font-weight: 600; }
.btn-location:hover { background: var(--surface-2); }
.btn-location.danger { color: var(--red); border-color: rgba(220, 38, 38, .25); }
.btn-location.danger:hover { background: var(--red-soft); }

/* Branding step */
.branding-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 720px) { .branding-grid { grid-template-columns: 1fr; } }
.upload-card { border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); padding: 16px; }
.upload-card__title { margin: 0 0 2px; font-size: 14px; font-weight: 600; }
.upload-card__help { margin: 0 0 12px; font-size: 12px; color: var(--muted); }
.upload-card__body { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.upload-preview { display: grid; place-items: center; overflow: hidden; border: 1px dashed var(--line-strong); background: var(--surface); color: var(--faint); font-size: 22px; }
.upload-preview--logo { width: 88px; height: 88px; border-radius: 50%; }
.upload-preview--card { width: 168px; height: 104px; border-radius: 12px; }
.upload-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.upload-preview--card img { object-fit: contain; }
.upload-preview.has-image { border-style: solid; }
.upload-preview.has-image i { display: none; }
.upload-card__actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.upload-card__name { font-size: 12px; color: var(--muted); flex-basis: 100%; overflow-wrap: anywhere; }
.upload-card input[type="file"] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Review */
.review-block { border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; background: var(--surface); }
.review-block + .review-block { margin-top: 12px; }
.review-block h3 { margin: 0 0 12px; font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.review-block h3 i { color: var(--accent); font-size: 13px; }
.review-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; font-size: 14px; }
.review-grid .span-2 { grid-column: 1 / -1; }
@media (max-width: 640px) { .review-grid { grid-template-columns: 1fr; } }
.review-grid p, .review-list p { margin: 0; }
.review-grid .k, .review-list .k { font-size: 12px; color: var(--muted); }
.review-grid .v, .review-list .v { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.review-list { display: grid; gap: 8px; font-size: 14px; }
.review-thumbs { display: flex; align-items: center; gap: 14px; }
.review-thumbs img { border: 1px solid var(--line); background: #fff; object-fit: contain; }
.review-thumbs img.logo { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.review-thumbs img.card { width: 92px; height: 58px; border-radius: 8px; }
.consents { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }

/* Email code step */
.verify-panel { max-width: 460px; margin: 0 auto; text-align: center; padding: 8px 0; }
.verify-panel .verify-icon { width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 22px; }
.verify-panel h2 { font-size: 22px; }
.verify-panel .step-intro { margin-bottom: 20px; }
.otp-input { width: 100%; max-width: 280px; margin: 0 auto; display: block; text-align: center; font-size: 28px; font-weight: 700; letter-spacing: .45em; padding-inline-start: calc(14px + .45em); min-height: 60px; font-variant-numeric: tabular-nums; direction: ltr; }
.verify-actions { display: grid; gap: 10px; margin-top: 18px; }
.verify-actions .btn-primary { width: 100%; }
.verify-secondary { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 14px; margin-top: 6px; font-size: 13px; color: var(--muted); }
.verify-feedback { min-height: 20px; margin-top: 10px; font-size: 13px; }
.verify-feedback.is-error { color: var(--red); }
.verify-feedback.is-ok { color: var(--green); }

/* Loading overlay */
#loadingOverlay { position: fixed; inset: 0; background: rgba(15, 23, 42, .4); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); align-items: center; justify-content: center; z-index: 1000; padding: 16px; }
.loading-box { background: var(--surface); border-radius: var(--radius-card); padding: 28px 32px; text-align: center; box-shadow: var(--shadow-pop); max-width: 360px; }
.loading-box i { color: var(--accent); font-size: 28px; margin-bottom: 12px; }
.loading-box p { margin: 0; }
.loading-box p + p { margin-top: 4px; color: var(--muted); font-size: 13px; }

.hidden { display: none !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: .01ms !important; } }
@media (max-width: 640px) {
  .signup-nav__title { display: none; }
  .form-actions { flex-wrap: wrap; }
  .form-actions > div { display: none; }
  .form-actions .btn-primary { flex: 1; }
  .upload-card__body { flex-direction: column; align-items: flex-start; }
}
