/* ==========================================================================
   SmartMusika — Business registration (SM_Shops) form styles
   Works in light and dark themes (html.dark).
   ========================================================================== */

.sm-reg-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 1.25rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px -12px rgba(15, 23, 42, 0.12);
}
html.dark .sm-reg-card {
  background: #0b1222;
  border-color: #1e293b;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 32px -16px rgba(0, 0, 0, 0.6);
}

.sm-reg-section + .sm-reg-section {
  border-top: 1px solid #eef2f6;
}
html.dark .sm-reg-section + .sm-reg-section {
  border-top-color: #1e293b;
}

.sm-reg-section-icon {
  width: 2.25rem;
  height: 2.25rem;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  background: #fff7ed;
  color: #ea580c;
  font-size: 0.95rem;
}
html.dark .sm-reg-section-icon {
  background: rgba(234, 88, 12, 0.14);
  color: #fb923c;
}

/* ── Fields ─────────────────────────────────────────────────────────── */
.sm-field {
  min-width: 0;
}

.sm-label {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.4rem;
}
html.dark .sm-label {
  color: #cbd5e1;
}

.sm-req {
  color: #ea580c;
  font-weight: 700;
}

.sm-optional {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  background: #f1f5f9;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
}
html.dark .sm-optional {
  color: #94a3b8;
  background: #1e293b;
}

.sm-input {
  display: block;
  width: 100%;
  min-width: 0;
  border: 1px solid #cbd5e1;
  background-color: #ffffff;
  color: #0f172a;
  border-radius: 0.75rem;
  padding: 0.7rem 0.95rem;
  font-size: 0.9375rem;
  line-height: 1.4;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.sm-input::placeholder {
  color: #94a3b8;
}
.sm-input:hover {
  border-color: #94a3b8;
}
.sm-input:focus {
  outline: none;
  border-color: #f97316;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.18);
}
html.dark .sm-input {
  background-color: #0f172a;
  border-color: #334155;
  color: #f1f5f9;
  color-scheme: dark;
}
html.dark .sm-input::placeholder {
  color: #64748b;
}
html.dark .sm-input:hover {
  border-color: #475569;
}
html.dark .sm-input:focus {
  border-color: #fb923c;
  box-shadow: 0 0 0 3px rgba(251, 146, 60, 0.2);
}

.sm-select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2364748b'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.06l3.71-3.83a.75.75 0 111.08 1.04l-4.25 4.39a.75.75 0 01-1.08 0L5.21 8.27a.75.75 0 01.02-1.06z' clip-rule='evenodd'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
  background-size: 1.1rem;
  text-overflow: ellipsis;
}

.sm-help {
  font-size: 0.75rem;
  line-height: 1.45;
  color: #64748b;
  margin-top: 0.4rem;
}
html.dark .sm-help {
  color: #94a3b8;
}

.sm-error {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  font-size: 0.75rem;
  line-height: 1.45;
  font-weight: 500;
  color: #e11d48;
  margin-top: 0.4rem;
}
.sm-error i {
  margin-top: 0.15rem;
}
html.dark .sm-error {
  color: #fb7185;
}

.sm-field.has-error .sm-input,
.sm-field.has-error .sm-input:focus {
  border-color: #f43f5e;
  box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.14);
}

/* ── Logo uploader ──────────────────────────────────────────────────── */
.sm-logo-preview {
  width: 7rem;
  height: 7rem;
  flex-shrink: 0;
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Checkerboard so transparent logos stay visible in both themes */
  background-color: #ffffff;
  background-image:
    linear-gradient(45deg, #f1f5f9 25%, transparent 25%),
    linear-gradient(-45deg, #f1f5f9 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f1f5f9 75%),
    linear-gradient(-45deg, transparent 75%, #f1f5f9 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}
html.dark .sm-logo-preview {
  border-color: #334155;
  background-color: #1e293b;
  background-image:
    linear-gradient(45deg, #273449 25%, transparent 25%),
    linear-gradient(-45deg, #273449 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #273449 75%),
    linear-gradient(-45deg, transparent 75%, #273449 75%);
}
.sm-logo-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0.5rem;
}
.sm-logo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  color: #94a3b8;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.sm-logo-placeholder i {
  font-size: 1.6rem;
}

.sm-dropzone {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.25rem;
  min-height: 7rem;
  padding: 1rem 1.1rem;
  border: 1.5px dashed #cbd5e1;
  border-radius: 1rem;
  background: #f8fafc;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.sm-dropzone:hover,
.sm-dropzone.is-dragging {
  border-color: #f97316;
  background: #fff7ed;
}
html.dark .sm-dropzone {
  border-color: #334155;
  background: #0f172a;
}
html.dark .sm-dropzone:hover,
html.dark .sm-dropzone.is-dragging {
  border-color: #fb923c;
  background: rgba(234, 88, 12, 0.08);
}
#id_logo:focus-visible + .sm-dropzone,
.sm-dropzone:focus-within {
  border-color: #f97316;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.18);
}

@media (max-width: 420px) {
  .sm-logo-row {
    flex-direction: column;
    align-items: stretch;
  }
  .sm-logo-preview {
    width: 100%;
    height: 9rem;
  }
}

/* ── Stepper ────────────────────────────────────────────────────────── */
.sm-step-dot {
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 700;
  border: 2px solid #e2e8f0;
  color: #94a3b8;
  background: #ffffff;
}
html.dark .sm-step-dot {
  border-color: #334155;
  background: #0f172a;
  color: #64748b;
}
.sm-step.is-current .sm-step-dot {
  border-color: #ea580c;
  background: #ea580c;
  color: #ffffff;
  box-shadow: 0 0 0 4px rgba(234, 88, 12, 0.15);
}
.sm-step.is-done .sm-step-dot {
  border-color: #10b981;
  background: #10b981;
  color: #ffffff;
}

/* ---------- Status alerts ---------- */
.sm-alert {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.9rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid;
  font-size: 0.875rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.sm-alert > i { margin-top: 0.2rem; }
.sm-alert > p, .sm-alert > div { min-width: 0; }
.sm-alert-error { background: #fff1f2; border-color: #fecdd3; color: #9f1239; }
.sm-alert-error > i { color: #f43f5e; }
.sm-alert-success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.sm-alert-success > i { color: #10b981; }
html.dark .sm-alert-error { background: rgba(76, 5, 25, 0.45); border-color: #881337; color: #fda4af; }
html.dark .sm-alert-success { background: rgba(2, 44, 34, 0.5); border-color: #065f46; color: #6ee7b7; }

/* ---------- Super user callout ---------- */
.sm-callout {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  padding: 1rem 1.1rem;
  border-radius: 1rem;
  border: 1px solid #fed7aa;
  background: linear-gradient(135deg, #fff7ed, #eff6ff);
}
html.dark .sm-callout {
  border-color: rgba(234, 88, 12, 0.35);
  background: linear-gradient(135deg, rgba(234, 88, 12, 0.12), rgba(37, 99, 235, 0.1));
}

/* ---------- Tabs ---------- */
.sm-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem;
  padding: 0.4rem;
  margin: 1rem 1rem 0;
  border-radius: 0.85rem;
  background: #f1f5f9;
}
html.dark .sm-tabs { background: #1e293b; }
.sm-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-width: 0;
  padding: 0.6rem 0.5rem;
  border-radius: 0.6rem;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  color: #475569;
  transition: background-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.sm-tab span { min-width: 0; overflow-wrap: anywhere; }
.sm-tab:hover { color: #ea580c; }
.sm-tab[aria-selected="true"] { background: #fff; color: #0f172a; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12); }
html.dark .sm-tab { color: #94a3b8; }
html.dark .sm-tab:hover { color: #fb923c; }
html.dark .sm-tab[aria-selected="true"] { background: #0f172a; color: #fff; }
.sm-tab:focus-visible { outline: 2px solid #f97316; outline-offset: 2px; }
.sm-gender-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}
.sm-gender-option {
  position: relative;
  display: flex;
  min-height: 2.9rem;
  align-items: center;
  justify-content: center;
  border: 1px solid #cbd5e1;
  border-radius: 0.75rem;
  background: #fff;
  color: #475569;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 700;
  transition: border-color 150ms ease, color 150ms ease, background 150ms ease;
}
.sm-gender-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.sm-gender-option:has(input:checked) {
  border-color: #f97316;
  background: #fff7ed;
  color: #c2410c;
  box-shadow: inset 0 0 0 1px #f97316;
}
.sm-gender-option:has(input:focus-visible) {
  outline: 2px solid #f97316;
  outline-offset: 2px;
}
html.dark .sm-gender-option {
  border-color: #475569;
  background: #0f172a;
  color: #cbd5e1;
}
html.dark .sm-gender-option:has(input:checked) {
  border-color: #f97316;
  background: #431407;
  color: #fed7aa;
}
@media (min-width: 640px) {
  .sm-tabs { margin: 1.5rem 2rem 0; }
  .sm-tab { font-size: 0.875rem; padding: 0.7rem 0.75rem; }
}
@media (max-width: 380px) {
  .sm-tab i { display: none; }
}

/* ---------- One-time code boxes ---------- */
.sm-otp {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: clamp(0.3rem, 2vw, 0.75rem);
  max-width: 26rem;
}
.sm-otp-box {
  width: 100%;
  min-width: 0;
  aspect-ratio: 5 / 6;
  max-height: 4.25rem;
  border: 1.5px solid #cbd5e1;
  border-radius: 0.75rem;
  background: #fff;
  color: #0f172a;
  text-align: center;
  text-transform: uppercase;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: clamp(1.1rem, 5vw, 1.6rem);
  font-weight: 700;
  caret-color: #ea580c;
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}
.sm-otp-box:focus { outline: none; border-color: #f97316; box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.2); }
.sm-otp-box.is-filled { border-color: #94a3b8; background: #f8fafc; }
.sm-otp.has-error .sm-otp-box { border-color: #f43f5e; }
html.dark .sm-otp-box { background: #0f172a; border-color: #334155; color: #f8fafc; }
html.dark .sm-otp-box.is-filled { background: #1e293b; border-color: #64748b; }
html.dark .sm-otp.has-error .sm-otp-box { border-color: #fb7185; }
