/* ====================================================
   KING BURGER'S STORE — DESIGN SYSTEM v2.0
   ==================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ── Tokens ── */
:root {
  --brand:        #7c3aed;
  --brand-dark:   #6d28d9;
  --brand-light:  #ede9fe;
  --brand-muted:  #a78bfa;

  --bg:           #f9fafb;
  --bg-dark:      #111827;
  --surface:      #ffffff;
  --surface-2:    #f3f4f6;

  --border:       #e5e7eb;

  --text:         #111827;
  --text-2:       #374151;
  --text-3:       #6b7280;
  --text-4:       #9ca3af;
  --text-light:   #f9fafb;

  --success:      #10b981;
  --success-bg:   #d1fae5;
  --success-text: #064e3b;
  --error:        #ef4444;
  --error-bg:     #fee2e2;
  --error-text:   #991b1b;
  --warning:      #f59e0b;
  --warning-bg:   #fef3c7;
  --warning-text: #78350f;

  --r-sm:  6px;
  --r:    10px;
  --r-lg: 14px;
  --r-xl: 18px;
  --r-2xl:24px;

  --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow:    0 4px 6px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.03);
  --shadow-md: 0 8px 16px rgba(0,0,0,0.07), 0 4px 6px rgba(0,0,0,0.04);
  --shadow-lg: 0 16px 32px rgba(0,0,0,0.08), 0 6px 12px rgba(0,0,0,0.04);
  --shadow-brand: 0 4px 14px rgba(124,58,237,0.30);

  --t:      200ms cubic-bezier(0.4,0,0.2,1);
  --t-slow: 350ms cubic-bezier(0.4,0,0.2,1);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

/* ── Layout ── */
.kb-wrap { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.kb-section { padding: 4rem 1.5rem; }
.kb-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }
.kb-grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem; }
.kb-grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.5rem; }

/* ── Sticky Header ── */
.kb-site-header {
  position: sticky;
  top: 0;
  z-index: 50;
}

/* ── Page Hero (dark) ── */
.kb-page-hero {
  background: var(--bg-dark);
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 3.5rem 1.5rem;
}
.kb-page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 65% 90% at 50% -5%, rgba(124,58,237,0.28) 0%, transparent 60%);
  pointer-events: none;
}
.kb-page-hero > * { position: relative; }
.kb-hero-title {
  color: var(--text-light);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 0.5rem;
}
.kb-hero-sub {
  color: var(--text-4);
  font-size: 1rem;
  max-width: 520px;
  margin: 0 auto;
}

/* ── Card ── */
.kb-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
}
.kb-card-elevated { box-shadow: var(--shadow-lg); }

/* ── Card Header (dark band) ── */
.kb-card-header {
  background: var(--bg-dark);
  color: var(--text-light);
  padding: 2rem 2.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.kb-card-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 120% at 50% -20%, rgba(124,58,237,0.32) 0%, transparent 65%);
  pointer-events: none;
}
.kb-card-header > * { position: relative; }
.kb-card-header h2 {
  font-size: 1.625rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}
.kb-card-header p {
  font-size: 0.875rem;
  color: var(--text-4);
}
.kb-card-header i { color: var(--brand-muted); }

/* ── Buttons ── */
.kb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.6875rem 1.375rem;
  border-radius: var(--r);
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: inherit;
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--t);
  white-space: nowrap;
  line-height: 1;
  -webkit-font-smoothing: antialiased;
}
.kb-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.kb-btn:disabled     { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

.kb-btn-primary  { background: var(--brand); color: #fff; border-color: var(--brand); }
.kb-btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); transform: translateY(-1px); box-shadow: var(--shadow-brand); }
.kb-btn-primary:active { transform: none; box-shadow: none; }

.kb-btn-outline  { background: transparent; color: var(--brand); border-color: var(--brand); }
.kb-btn-outline:hover { background: var(--brand-light); }

.kb-btn-ghost    { background: transparent; color: var(--text-3); border-color: transparent; }
.kb-btn-ghost:hover { background: var(--surface-2); color: var(--text); }

.kb-btn-danger   { background: var(--error-bg); color: var(--error); border-color: var(--error-bg); }
.kb-btn-danger:hover { background: var(--error); color: #fff; border-color: var(--error); }

.kb-btn-lg   { padding: 0.875rem 2.25rem; font-size: 1.0625rem; border-radius: var(--r-lg); }
.kb-btn-sm   { padding: 0.4375rem 0.875rem; font-size: 0.8125rem; border-radius: var(--r-sm); }
.kb-btn-full { width: 100%; }

/* ── Forms ── */
.kb-form-group { margin-bottom: 1.25rem; }
.kb-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.375rem;
  letter-spacing: 0.01em;
}
.kb-input {
  width: 100%;
  padding: 0.6875rem 0.875rem;
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  font-size: 0.9375rem;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  transition: border-color var(--t), box-shadow var(--t);
  appearance: none;
}
.kb-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(124,58,237,0.12); }
.kb-input::placeholder { color: var(--text-4); }
.kb-input:disabled { background: var(--surface-2); color: var(--text-3); cursor: not-allowed; }
.kb-input:read-only { background: var(--surface-2); color: var(--text-3); }

/* ── Badges ── */
.kb-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.kb-badge-brand   { background: var(--brand-light); color: var(--brand-dark); }
.kb-badge-success { background: var(--success-bg);  color: var(--success-text); }
.kb-badge-error   { background: var(--error-bg);    color: var(--error-text); }
.kb-badge-warning { background: var(--warning-bg);  color: var(--warning-text); }
.kb-badge-gray    { background: var(--surface-2);   color: var(--text-3); }
.kb-badge-cyan    { background: #cffafe; color: #164e63; }
.kb-badge-blue    { background: #dbeafe; color: #1e40af; }

/* ── Alerts ── */
.kb-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: var(--r);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 1.25rem;
}
.kb-alert-success { background: var(--success-bg); color: var(--success-text); }
.kb-alert-error   { background: var(--error-bg);   color: var(--error-text); }
.kb-alert-info    { background: var(--brand-light); color: var(--brand-dark); }

/* ── Divider ── */
.kb-divider { height: 1px; background: var(--border); margin: 1.75rem 0; }

/* ── Spinner ── */
.kb-spinner {
  display: inline-block;
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: kb-spin 0.7s linear infinite;
}
@keyframes kb-spin { to { transform: rotate(360deg); } }

/* ── Empty/Error State ── */
.kb-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-3);
}
.kb-state i { font-size: 3.5rem; color: var(--border); display: block; margin-bottom: 1rem; }
.kb-state h3 { font-size: 1.125rem; font-weight: 700; color: var(--text-2); margin-bottom: 0.375rem; }

/* ── Footer ── */
.kb-footer {
  background: var(--bg-dark);
  color: var(--text-4);
  text-align: center;
  padding: 1.75rem 1.5rem;
  font-size: 0.875rem;
  border-top: 1px solid rgba(255,255,255,0.05);
}
.kb-footer p + p { margin-top: 0.35rem; }

/* ── Utility ── */
.hidden { display: none; }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border-width: 0;
}

/* ── Cross-page transitions ── */
/* Same-origin navigations cross-fade via the View Transitions API
   (Chrome/Edge/Safari); browsers without it get a page-load fade-in.
   Both the outgoing and incoming page must carry these rules — they
   live here plus the standalone pages' own styles (login, register,
   redirects, paymentselect). */
@view-transition {
  navigation: auto;
}
@keyframes kb-page-out {
  to { opacity: 0; transform: translateY(-10px); }
}
@keyframes kb-page-in {
  from { opacity: 0; transform: translateY(12px); }
}
::view-transition-old(root) {
  animation: kb-page-out 0.2s ease both;
}
::view-transition-new(root) {
  animation: kb-page-in 0.3s ease 0.06s both;
}
@supports not (view-transition-name: root) {
  body { animation: kb-page-in 0.3s ease both; }
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) { animation: none; }
  body { animation: none; }
}
