/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0f0f1a;
  --surface:   #1a1a2e;
  --surface2:  #16213e;
  --accent:    #e94560;
  --accent2:   #f5a623;
  --text:      #e0e0e0;
  --muted:     #888;
  --border:    #2a2a4a;
  --input-bg:  #0d0d1e;
  --success:   #2ecc71;
  --error:     #e94560;
  --radius:    8px;
  --shadow:    0 4px 24px rgba(0,0,0,.5);
}

html, body {
  height: 100%;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ── */
.page-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Navbar ── */
.navbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.navbar-brand .logo-icon {
  width: 36px;
  height: 36px;
  background: var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.navbar-brand span {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.navbar-brand span em {
  color: var(--accent);
  font-style: normal;
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.navbar-links a {
  color: var(--muted);
  font-size: 14px;
  transition: color .2s;
}

.navbar-links a:hover { color: var(--text); text-decoration: none; }

/* ── Hero ── */
.hero {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  background: radial-gradient(ellipse at 20% 50%, rgba(233,69,96,.08) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 20%, rgba(245,166,35,.05) 0%, transparent 50%);
}

.hero-content {
  max-width: 560px;
  text-align: center;
}

.hero-badge {
  display: inline-block;
  background: rgba(233,69,96,.15);
  color: var(--accent);
  border: 1px solid rgba(233,69,96,.3);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .5px;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 16px;
  color: #fff;
}

.hero h1 span { color: var(--accent); }

.hero p {
  font-size: 16px;
  color: var(--muted);
  margin-bottom: 32px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: #c73652; text-decoration: none; color: #fff; }

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

.btn-lg { padding: 14px 36px; font-size: 16px; }

.btn:disabled {
  opacity: .6;
  cursor: not-allowed;
}

.btn-spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  display: none;
}
.btn.loading .btn-spinner { display: block; }
.btn.loading .btn-text { display: none; }

/* ── Auth pages ── */
.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.auth-wrap {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 24px;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 40px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow);
}

.auth-card.wide { max-width: 560px; }

.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}

.auth-logo .logo-icon {
  width: 40px; height: 40px;
  background: var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.auth-logo span {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.auth-logo span em { color: var(--accent); font-style: normal; }

.auth-card h2 {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
}

.auth-card .subtitle {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 28px;
}

/* ── Form elements ── */
.form-group {
  margin-bottom: 18px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .4px;
}

input {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 14px;
  font-size: 15px;
  color: var(--text);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(233,69,96,.15);
}

input::placeholder { color: #444; }

input.error { border-color: var(--error); }

select {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 14px;
  font-size: 15px;
  color: var(--text);
  outline: none;
  transition: border-color .2s;
  appearance: none;
  cursor: pointer;
}
select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(233,69,96,.15); }

textarea {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 14px;
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border-color .2s;
  resize: vertical;
  font-family: inherit;
}
textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(233,69,96,.15); }
textarea::placeholder { color: #444; }

.field-error {
  font-size: 12px;
  color: var(--error);
  margin-top: 4px;
  display: none;
}
.field-error.visible { display: block; }

/* ── Alert ── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 20px;
  display: none;
  align-items: flex-start;
  gap: 10px;
}
.alert.visible { display: flex; }
.alert-error   { background: rgba(233,69,96,.12); border: 1px solid rgba(233,69,96,.3); color: #ff8fa0; }
.alert-success { background: rgba(46,204,113,.12); border: 1px solid rgba(46,204,113,.3); color: #7ee8a2; }
.alert-info    { background: rgba(245,166,35,.1);  border: 1px solid rgba(245,166,35,.3); color: #f5c860; }

/* ── Stripe card element ── */
.stripe-field {
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  transition: border-color .2s;
}
.stripe-field.StripeElement--focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(233,69,96,.15);
}

/* ── Price badge ── */
.price-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 22px;
}

.price-badge .price {
  font-size: 28px;
  font-weight: 800;
  color: var(--accent);
}

.price-badge .price-info {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}

.price-badge .price-info strong {
  display: block;
  color: var(--text);
  font-size: 15px;
}

/* ── Divider ── */
.divider {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin: 20px 0;
  position: relative;
}
.divider::before, .divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: calc(50% - 24px);
  height: 1px;
  background: var(--border);
}
.divider::before { left: 0; }
.divider::after  { right: 0; }

/* ── Business code hint ── */
.code-hint {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 20px;
  display: flex;
  gap: 10px;
}
.code-hint .icon { font-size: 18px; flex-shrink: 0; }

/* ── Password strength ── */
.pw-strength {
  margin-top: 6px;
}
.pw-strength-bar {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.pw-strength-fill {
  height: 100%;
  border-radius: 2px;
  transition: width .3s, background .3s;
  width: 0;
}
.pw-strength-label {
  font-size: 11px;
  margin-top: 4px;
  color: var(--muted);
}

/* ── Steps indicator ── */
.steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 32px;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
}

.step-num {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--surface2);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  transition: all .3s;
}

.step.active .step-num {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.step.done .step-num {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.step-label {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.step.active .step-label { color: var(--text); }

.step-line {
  width: 60px;
  height: 2px;
  background: var(--border);
  margin: 0 4px;
  margin-bottom: 18px;
  transition: background .3s;
}
.step-line.done { background: var(--success); }

/* ── Features grid (landing) ── */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  max-width: 900px;
  margin: 60px auto 0;
  padding: 0 24px;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
}

.feature-icon {
  font-size: 28px;
  margin-bottom: 12px;
}

.feature-card h3 {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
}

.feature-card p {
  font-size: 13px;
  color: var(--muted);
}

/* ── Footer ── */
footer {
  text-align: center;
  padding: 24px;
  color: var(--muted);
  font-size: 13px;
  border-top: 1px solid var(--border);
}

/* ── Dashboard ── */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.sidebar-brand .logo-icon {
  width: 32px; height: 32px;
  background: var(--accent);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.sidebar-brand span {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.sidebar-brand span em { color: var(--accent); font-style: normal; }

.sidebar-nav {
  flex: 1;
  padding: 0 12px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  transition: all .2s;
  cursor: pointer;
  text-decoration: none;
  margin-bottom: 2px;
}

.nav-item:hover { background: rgba(255,255,255,.05); color: var(--text); text-decoration: none; }
.nav-item.active { background: rgba(233,69,96,.15); color: var(--accent); }
.nav-item .nav-icon { font-size: 17px; width: 20px; text-align: center; }

.sidebar-footer {
  padding: 16px 20px 0;
  border-top: 1px solid var(--border);
}

.sidebar-user {
  font-size: 13px;
}

.sidebar-user .business { font-weight: 700; color: var(--text); }
.sidebar-user .email    { color: var(--muted); font-size: 12px; }
.sidebar-user .code     { color: var(--accent); font-size: 11px; font-weight: 600; letter-spacing: 2px; margin-top: 4px; }

.main-content {
  flex: 1;
  margin-left: 240px;
  padding: 32px;
}

.page-header {
  margin-bottom: 28px;
}

.page-header h1 {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.page-header p { color: var(--muted); font-size: 14px; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
}

.stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 28px;
  font-weight: 800;
  color: #fff;
}

.stat-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

/* ══════════════════════════════════════════
   GLOBAL MODAL — used on all dashboard pages
   ══════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  /* shift centre point right so it sits in the content area, not behind the sidebar */
  padding: 24px 24px 24px calc(240px + 24px);
  backdrop-filter: blur(2px);
}

.modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 32px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 40px rgba(0,0,0,.6);
  animation: fadeIn .2s ease;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.modal-header h3 { font-size: 18px; font-weight: 700; color: #fff; }

.modal-close {
  background: none; border: none;
  color: var(--muted); font-size: 24px;
  cursor: pointer; line-height: 1;
  padding: 0 4px;
  transition: color .15s;
}
.modal-close:hover { color: var(--text); }

.modal-actions {
  display: flex;
  align-items: center;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ── Animations ── */
@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.auth-card { animation: fadeIn .3s ease; }

/* ── Responsive ── */
@media (max-width: 600px) {
  .auth-card { padding: 28px 20px; }
  .form-row  { grid-template-columns: 1fr; }
  .navbar    { padding: 0 16px; }
}
