:root {
  --navy: #191933;
  --dark: #0c1226;
  --blue: #5faaff;
  --purple: #8b7bff;
  --soft-blue: #375f9b;

  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.62);
  --muted-2: rgba(255, 255, 255, 0.42);

  --panel: rgba(255, 255, 255, 0.055);
  --panel-strong: rgba(255, 255, 255, 0.10);
  --border: rgba(95, 170, 255, 0.22);
  --border-soft: rgba(255, 255, 255, 0.10);

  --green: #43d9a3;
  --amber: #ffd166;
  --danger: #ef4444;

  --radius: 16px;
  --radius-sm: 11px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: linear-gradient(135deg, var(--navy), var(--dark));
  background-attachment: fixed;
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .brand-title { font-family: "Sora", sans-serif; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.center { text-align: center; }

/* ---------------- TOP BAR ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 40px);
  background: rgba(12, 18, 38, 0.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 11px;
  display: grid; place-items: center;
  font-family: "Sora"; font-weight: 800; font-size: 14px; letter-spacing: .5px;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  color: #0c1226;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-title { font-weight: 700; font-size: 15px; }
.brand-sub { font-size: 12px; color: var(--muted); }

.topnav { display: flex; align-items: center; gap: 8px; }
.nav-link {
  background: none; border: none; color: var(--muted);
  padding: 8px 12px; border-radius: 9px; font-size: 14px; font-weight: 500;
  transition: color .15s, background .15s;
}
.nav-link:hover { color: var(--text); background: var(--panel); }
.nav-link.active { color: var(--text); }

.auth-slot { margin-left: 6px; }
.account-chip { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; }
#account-email { color: var(--muted); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------- BUTTONS ---------------- */
.btn {
  border: 1px solid transparent; border-radius: 11px;
  padding: 11px 18px; font-size: 14px; font-weight: 600;
  transition: transform .12s, filter .15s, background .15s, border-color .15s;
}
.btn:active { transform: translateY(1px); }
.btn.full { width: 100%; }
.btn-primary { background: linear-gradient(135deg, var(--blue), var(--purple)); color: #0c1226; }
.btn-primary:hover { filter: brightness(1.07); }
.btn-primary:disabled { opacity: .5; filter: grayscale(.3); cursor: not-allowed; }
.btn-ghost { background: var(--panel); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--panel-strong); }
.btn-google { background: #fff; color: #1f2430; }
.btn-google:hover { filter: brightness(.96); }
.btn-link { background: none; border: none; color: var(--blue); padding: 0; font-size: 13px; font-weight: 600; }
.btn-link:hover { text-decoration: underline; }

/* ---------------- SHELL / VIEWS ---------------- */
.shell { max-width: 1120px; margin: 0 auto; padding: clamp(22px, 4vw, 44px) clamp(16px, 4vw, 40px) 90px; }
.view { animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.back-link { background: none; border: none; color: var(--muted); font-size: 14px; padding: 4px 0; margin-bottom: 14px; }
.back-link:hover { color: var(--text); }

/* ---------------- HERO ---------------- */
.hero { text-align: center; max-width: 640px; margin: 10px auto 34px; }
.hero-eyebrow {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--blue); background: rgba(95,170,255,.12); border: 1px solid var(--border);
  padding: 6px 12px; border-radius: 999px; margin-bottom: 18px;
}
.hero-title { font-size: clamp(32px, 6vw, 50px); font-weight: 800; margin: 0 0 14px; letter-spacing: -.01em; }
.hero-sub { font-size: 16px; color: var(--muted); line-height: 1.6; margin: 0; }

/* ---------------- CATEGORY GRID ---------------- */
.category-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 40px;
}
@media (max-width: 860px) { .category-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .category-grid { grid-template-columns: 1fr; } }

.cat-card {
  text-align: left; border: 1px solid var(--border-soft); background: var(--panel);
  border-radius: var(--radius); padding: 22px; transition: transform .14s, border-color .15s, background .15s;
  display: flex; flex-direction: column; gap: 8px; min-height: 164px;
}
.cat-card:hover { transform: translateY(-3px); border-color: var(--border); background: var(--panel-strong); }
.cat-emoji {
  width: 48px; height: 48px; border-radius: 13px; display: grid; place-items: center;
  font-size: 24px; margin-bottom: 6px;
}
.cat-name { font-family: "Sora"; font-weight: 700; font-size: 18px; }
.cat-tagline { font-size: 13px; color: var(--blue); font-weight: 600; }
.cat-blurb { font-size: 13.5px; color: var(--muted); line-height: 1.5; margin-top: 2px; }
.cat-cta { margin-top: auto; font-size: 13px; font-weight: 600; color: var(--text); opacity: .85; }

.how-strip {
  display: flex; justify-content: center; gap: 28px; flex-wrap: wrap;
  padding: 20px; border: 1px solid var(--border-soft); border-radius: var(--radius); background: var(--panel);
}
.how-step { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.how-num {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(95,170,255,.15); color: var(--blue); font-weight: 700; font-size: 13px;
}

/* ---------------- CONFIGURE ---------------- */
.configure-head { display: flex; align-items: center; gap: 16px; margin-bottom: 26px; }
.configure-emoji { width: 58px; height: 58px; border-radius: 15px; display: grid; place-items: center; font-size: 30px; flex-shrink: 0; }
.configure-head h2 { margin: 0; font-size: 26px; }
.configure-blurb { margin: 4px 0 0; color: var(--muted); font-size: 14.5px; }

.configure-body { display: grid; grid-template-columns: 1fr 340px; gap: 26px; align-items: start; }
@media (max-width: 880px) { .configure-body { grid-template-columns: 1fr; } }

.opt-group { margin-bottom: 26px; }
.opt-group-head { margin-bottom: 12px; }
.opt-group-label { font-family: "Sora"; font-weight: 700; font-size: 16px; }
.opt-group-help { font-size: 13px; color: var(--muted); margin-top: 2px; }

.opt-cards { display: grid; gap: 10px; }
.opt-card {
  position: relative; text-align: left; border: 1.5px solid var(--border-soft); background: var(--panel);
  border-radius: var(--radius-sm); padding: 14px 16px; transition: border-color .15s, background .15s;
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
}
.opt-card:hover { border-color: var(--border); }
.opt-card.selected { border-color: var(--blue); background: rgba(95,170,255,.10); }
.opt-card .opt-left { display: flex; flex-direction: column; gap: 3px; }
.opt-card .opt-name { font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.opt-card .opt-blurb { font-size: 13px; color: var(--muted); }
.opt-card .opt-price { font-weight: 700; font-size: 15px; white-space: nowrap; }
.opt-price.free { color: var(--green); }

.badge-popular {
  font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: #0c1226; background: var(--amber); padding: 2px 7px; border-radius: 999px;
}
.opt-check {
  width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--border);
  display: grid; place-items: center; flex-shrink: 0; font-size: 12px; color: #0c1226;
}
.opt-card.selected .opt-check { background: var(--blue); border-color: var(--blue); }
.opt-details { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.opt-detail { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.opt-detail::before { content: "✓"; color: var(--green); font-weight: 700; }

/* ---------------- SUMMARY CARD ---------------- */
.summary-card {
  position: sticky; top: 90px; border: 1px solid var(--border); background: var(--panel-strong);
  border-radius: var(--radius); padding: 20px;
}
.summary-card h3 { margin: 0 0 14px; font-size: 17px; }
.summary-lines { display: flex; flex-direction: column; gap: 9px; margin-bottom: 14px; }
.summary-line { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; }
.summary-line .sl-label { color: var(--muted); }
.summary-line .sl-price { font-weight: 600; white-space: nowrap; }
.summary-empty { font-size: 13.5px; color: var(--muted-2); }
.summary-total {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-top: 14px; border-top: 1px solid var(--border-soft); margin-bottom: 16px;
  font-family: "Sora"; font-weight: 700;
}
.summary-total span:last-child { font-size: 22px; }
.summary-note { font-size: 12px; color: var(--muted-2); text-align: center; margin: 12px 0 0; }

/* ---------------- BRIEF ---------------- */
.brief-grid { display: grid; grid-template-columns: 1fr 340px; gap: 26px; align-items: start; margin-top: 18px; }
@media (max-width: 880px) { .brief-grid { grid-template-columns: 1fr; } }
.panel { border: 1px solid var(--border-soft); background: var(--panel); border-radius: var(--radius); padding: 22px; }
.field-label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 16px 0 7px; }
.field-label:first-child { margin-top: 0; }
.input, .textarea {
  width: 100%; background: rgba(0,0,0,.22); border: 1px solid var(--border-soft);
  border-radius: 10px; padding: 11px 13px; font-size: 14px; outline: none; transition: border-color .15s;
}
.input:focus, .textarea:focus { border-color: var(--blue); }
.textarea { resize: vertical; min-height: 110px; line-height: 1.5; }

/* ---------------- ORDERS ---------------- */
.orders-list { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.order-card { border: 1px solid var(--border-soft); background: var(--panel); border-radius: var(--radius); padding: 18px 20px; }
.order-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.order-title { font-family: "Sora"; font-weight: 700; font-size: 16px; }
.order-meta { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.order-total { font-weight: 700; font-size: 16px; }
.status-pill { font-size: 12px; font-weight: 700; padding: 5px 11px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; }
.status-received { background: rgba(95,170,255,.15); color: var(--blue); }
.status-production { background: rgba(255,209,102,.15); color: var(--amber); }
.status-ready { background: rgba(67,217,163,.15); color: var(--green); }
.order-body { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border-soft); font-size: 13.5px; color: var(--muted); line-height: 1.55; }
.order-actions { margin-top: 14px; display: flex; gap: 10px; flex-wrap: wrap; }
.progress-track { display: flex; gap: 6px; margin-top: 12px; }
.progress-seg { flex: 1; height: 5px; border-radius: 999px; background: var(--border-soft); }
.progress-seg.on { background: linear-gradient(90deg, var(--blue), var(--purple)); }

/* ---------------- MODAL ---------------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 60; background: rgba(6,9,20,.72);
  backdrop-filter: blur(6px); display: grid; place-items: center; padding: 20px;
}
.modal { width: 100%; max-width: 400px; background: #141a30; border: 1px solid var(--border); border-radius: 18px; padding: 26px; position: relative; }
.modal h3 { margin: 0 0 4px; font-size: 20px; }
.modal-close { position: absolute; top: 14px; right: 16px; background: none; border: none; font-size: 24px; color: var(--muted); line-height: 1; }
.modal-close:hover { color: var(--text); }
.divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--muted-2); font-size: 12px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border-soft); }
.auth-toggle { margin: 16px 0 0; font-size: 13px; color: var(--muted); text-align: center; }
.error-msg { color: var(--danger); font-size: 13px; margin-top: 10px; min-height: 16px; }
.modal .btn { margin-top: 8px; }
.modal .field-label { margin-top: 14px; }

/* ---------------- TOAST ---------------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #141a30; border: 1px solid var(--border); border-radius: 12px;
  padding: 13px 20px; font-size: 14px; z-index: 80; box-shadow: 0 12px 40px rgba(0,0,0,.4);
}

/* post-purchase add-ons in My Orders */
.order-addons { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border-soft); }
.addons-label { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 9px; }
.addons-row { display: flex; gap: 8px; flex-wrap: wrap; }
.addon-btn { font-size: 13px; padding: 8px 13px; }
