/* ============================================================================
   3D Print Pricing — dark neon design system (self-contained, no framework).
   Accents: Cyan #00f0ff · Lime #39ff14
   ========================================================================== */

:root {
  --bg: #0a0e12;
  --bg-2: #0e141b;
  --surface: #121a22;
  --surface-2: #17212b;
  --border: #223140;
  --border-soft: #1a2531;
  --text: #e7eef5;
  --text-dim: #8ba0b3;
  --text-mute: #5c7285;
  --cyan: #00f0ff;
  --lime: #39ff14;
  --danger: #ff4d6d;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 18px 50px -20px rgba(0, 0, 0, 0.75);
  --glow-cyan: 0 0 0 1px rgba(0, 240, 255, 0.35), 0 0 22px -4px rgba(0, 240, 255, 0.45);
  --glow-lime: 0 0 0 1px rgba(57, 255, 20, 0.35), 0 0 22px -4px rgba(57, 255, 20, 0.4);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 100% -10%, rgba(0, 240, 255, 0.06), transparent 60%),
    radial-gradient(1000px 500px at -10% 110%, rgba(57, 255, 20, 0.05), transparent 60%),
    var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ------------------------------- buttons --------------------------------- */
.btn {
  --b: var(--cyan);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.2px;
  padding: 0.7rem 1.15rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-block { width: 100%; }

.btn-primary {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.16), rgba(57, 255, 20, 0.14));
  border-color: rgba(0, 240, 255, 0.45);
  color: #eafcff;
}
.btn-primary:hover { box-shadow: var(--glow-cyan); border-color: var(--cyan); }

.btn-ghost { background: transparent; color: var(--text-dim); }
.btn-ghost:hover { color: var(--text); border-color: var(--cyan); box-shadow: var(--glow-cyan); }

.btn-danger { color: var(--danger); border-color: rgba(255, 77, 109, 0.35); background: transparent; }
.btn-danger:hover { box-shadow: 0 0 0 1px rgba(255, 77, 109, 0.5), 0 0 18px -6px rgba(255, 77, 109, 0.6); }

.btn-sm { padding: 0.45rem 0.75rem; font-size: 0.82rem; }

/* ------------------------------ logo block ------------------------------- */
.logo-container {
  position: relative;
  padding: 0.6rem 0;
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: center;
  /* No frame: the logo sits directly on the page background for a clean,
     premium look. */
  background: transparent;
  border: none;
}
.logo-placeholder {
  /* Hidden by default; the <img> onerror handler reveals it only when no
     logo file is present. */
  display: none;
  position: relative;
  z-index: 1;
  font-weight: 800;
  letter-spacing: 2px;
  font-size: 0.85rem;
  color: #dffcff;
  text-shadow: 0 0 12px rgba(0, 240, 255, 0.5);
}
.logo-img { position: relative; z-index: 1; max-width: 100%; max-height: 230px; object-fit: contain; }
.login-logo .logo-img { max-height: 250px; }

/* ------------------------------- fields ---------------------------------- */
.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field-label { font-size: 0.78rem; color: var(--text-dim); font-weight: 600; letter-spacing: 0.2px; }
.field input, .field select {
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.85rem;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  width: 100%;
}
.field input::placeholder { color: var(--text-mute); }
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: var(--glow-cyan);
  background: var(--surface);
}
select { appearance: none; cursor: pointer; }

/* ============================= LOGIN SCREEN ============================== */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.8rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.login-logo { min-height: 110px; }
.login-title { text-align: center; font-size: 1.4rem; font-weight: 800; letter-spacing: 0.3px; }
.login-sub { text-align: center; color: var(--text-dim); font-size: 0.9rem; margin-top: -0.6rem; }
.login-error {
  color: var(--danger);
  font-size: 0.85rem;
  text-align: center;
  background: rgba(255, 77, 109, 0.08);
  border: 1px solid rgba(255, 77, 109, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.6rem;
}

/* ================================ APP SHELL ============================== */
.app { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }

.sidebar {
  background: linear-gradient(180deg, var(--bg-2), var(--bg));
  border-right: 1px solid var(--border);
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  position: sticky;
  top: 0;
  height: 100vh;
}
.nav { display: flex; flex-direction: column; gap: 0.4rem; }
.nav-btn {
  font-family: inherit;
  text-align: left;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  transition: all 0.18s ease;
}
.nav-btn .nav-ico { font-size: 1.05rem; width: 1.2rem; text-align: center; }
.nav-btn:hover { color: var(--text); background: var(--surface); }
.nav-btn.active {
  color: #eafcff;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.14), rgba(57, 255, 20, 0.1));
  border-color: rgba(0, 240, 255, 0.4);
  box-shadow: var(--glow-cyan);
}
.sidebar-footer { margin-top: auto; display: flex; flex-direction: column; gap: 0.7rem; }
.user-chip {
  display: flex; align-items: center; gap: 0.5rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.6rem 0.75rem;
  font-size: 0.82rem; color: var(--text-dim);
}
.user-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 8px var(--lime); flex: none; }
.user-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { padding: 2rem 2.4rem; max-width: 1400px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.6rem; }
.page-title { font-size: 1.6rem; font-weight: 800; letter-spacing: 0.2px; }
.page-desc { color: var(--text-dim); font-size: 0.92rem; margin-top: 0.2rem; }

/* ------------------------------- tabs ------------------------------------ */
.tab { display: none; animation: tabIn 0.35s cubic-bezier(0.22, 1, 0.36, 1); }
.tab.active { display: block; }
@keyframes tabIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ------------------------------- cards ----------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.4rem;
}

/* ---------------------------- catalog grid ------------------------------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.2rem; }
.p-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.25s ease, border-color 0.2s ease;
}
.p-card:hover { transform: translateY(-4px); border-color: rgba(0, 240, 255, 0.5); box-shadow: var(--glow-cyan), var(--shadow); }
.p-thumb {
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, var(--surface-2), var(--bg-2));
  display: flex; align-items: center; justify-content: center;
  border-bottom: 1px solid var(--border-soft);
  overflow: hidden;
}
.p-thumb img { width: 100%; height: 100%; object-fit: cover; }
.p-thumb .ph { color: var(--text-mute); font-size: 2.4rem; }
.p-body { padding: 1rem 1.1rem 1.2rem; display: flex; flex-direction: column; gap: 0.55rem; flex: 1; }
.p-cat {
  align-self: flex-start;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase;
  color: var(--lime);
  background: rgba(57, 255, 20, 0.08);
  border: 1px solid rgba(57, 255, 20, 0.28);
  padding: 0.2rem 0.55rem; border-radius: 999px;
}
.p-name { font-size: 1.08rem; font-weight: 700; line-height: 1.2; }
.p-meta { display: flex; justify-content: space-between; font-size: 0.82rem; color: var(--text-dim); }
.p-meta b { color: var(--text); font-weight: 600; }
.p-price {
  margin-top: auto;
  display: flex; align-items: baseline; justify-content: space-between;
  padding-top: 0.7rem; border-top: 1px solid var(--border-soft);
}
.p-price .lbl { font-size: 0.72rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; }
.p-price .val {
  font-size: 1.5rem; font-weight: 800;
  color: var(--lime); text-shadow: 0 0 16px rgba(57, 255, 20, 0.45);
}
.p-actions { display: flex; gap: 0.5rem; padding: 0 1.1rem 1.1rem; }
.p-actions .btn { flex: 1; }

.empty-state {
  text-align: center; color: var(--text-dim);
  padding: 4rem 1rem; display: flex; flex-direction: column; align-items: center; gap: 1rem;
}
.empty-ico { font-size: 3rem; opacity: 0.4; }

/* ------------------------ new product form layout ------------------------ */
.form-layout { display: grid; grid-template-columns: 1fr 340px; gap: 1.2rem; align-items: start; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.span-2 { grid-column: span 2; }
.form-actions { display: flex; align-items: center; gap: 0.8rem; margin-top: 1.4rem; }

/* uploader */
.uploader { display: flex; gap: 1rem; align-items: center; }
.uploader-preview {
  width: 108px; height: 108px; flex: none;
  border-radius: var(--radius-sm); border: 1px dashed var(--border);
  background: var(--bg-2);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.uploader-preview img { width: 100%; height: 100%; object-fit: cover; }
.uploader-placeholder { color: var(--text-mute); font-size: 0.8rem; }
.uploader-actions { display: flex; flex-direction: column; gap: 0.5rem; align-items: flex-start; }
.uploader-name { font-size: 0.8rem; color: var(--text-dim); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------- live price panel ------------------------------ */
.price-panel { position: sticky; top: 2rem; }
.panel-title { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; color: var(--text); }
.breakdown { list-style: none; display: flex; flex-direction: column; gap: 0.6rem; }
.breakdown li { display: flex; justify-content: space-between; font-size: 0.9rem; color: var(--text-dim); }
.breakdown li b { color: var(--text); font-weight: 600; }
.breakdown-total { padding-top: 0.6rem; border-top: 1px solid var(--border-soft); font-weight: 700; }
.breakdown-total span, .breakdown-total b { color: var(--cyan) !important; }
.final-price {
  margin-top: 1.2rem; padding: 1.1rem;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(57, 255, 20, 0.1), rgba(0, 240, 255, 0.08));
  border: 1px solid rgba(57, 255, 20, 0.3);
  display: flex; flex-direction: column; gap: 0.2rem; text-align: center;
}
.final-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.6px; color: var(--text-dim); }
.final-value { font-size: 2rem; font-weight: 800; color: var(--lime); text-shadow: 0 0 20px rgba(57, 255, 20, 0.5); }

.settings-card { max-width: 720px; }
.saved-hint { color: var(--lime); font-size: 0.85rem; }

/* -------------------------------- toast ---------------------------------- */
.toast {
  position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%);
  background: var(--surface-2); border: 1px solid var(--cyan);
  box-shadow: var(--glow-cyan), var(--shadow);
  color: var(--text); padding: 0.8rem 1.3rem; border-radius: var(--radius-sm);
  font-size: 0.9rem; z-index: 100; animation: toastIn 0.25s ease;
  pointer-events: none; /* never intercept clicks on the UI underneath */
}
.toast.error { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger), var(--shadow); }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ------------------------------ responsive ------------------------------- */
@media (max-width: 1024px) {
  .form-layout { grid-template-columns: 1fr; }
  .price-panel { position: static; }
}
@media (max-width: 720px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: column; }
  .main { padding: 1.3rem; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .page-head { flex-direction: column; align-items: flex-start; }
}
