/* =====================================================================
   ACW QUOTE BUILDER — DESIGN SYSTEM
   ---------------------------------------------------------------------
   Palette:
     --black        #0A0A0A   app background
     --charcoal     #1C1C1E   card surfaces
     --charcoal-2   #2A2A2D   elevated / hover surfaces
     --gold         #D4AF37   primary accent (matches cabinet marquees)
     --gold-bright  #F3D774   glow highlight
     --white        #F5F5F7   primary text
     --white-dim    #9A9AA0   secondary text
   Type: system font stack so it reads exactly like a native iPhone app.
   ===================================================================== */

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --black: #0A0A0A;
  --charcoal: #1C1C1E;
  --charcoal-2: #2A2A2D;
  --gold: #D4AF37;
  --gold-bright: #F3D774;
  --white: #F5F5F7;
  --white-dim: #9A9AA0;
  --danger: #E5484D;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

html, body {
  height: 100%;
  background: var(--black);
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  color: var(--white);
  overscroll-behavior-y: none;
  padding-bottom: env(safe-area-inset-bottom);
}

button, input, textarea, select {
  font-family: inherit;
  color: inherit;
}

.hidden { display: none !important; }

/* ---------------------------------------------------------------------
   TOP BAR / LIT MARQUEE — the app's signature element. Every cabinet
   ships with a lit marquee, so the header borrows that exact language:
   warm gold letterforms with a soft neon glow on a near-black field.
   --------------------------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 14px) 18px 14px;
  background: linear-gradient(180deg, #0d0d0e 0%, var(--black) 100%);
  border-bottom: 1px solid #222224;
}

.marquee { display: flex; flex-direction: column; line-height: 1.1; }

.marquee-text {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--gold-bright);
  text-shadow: 0 0 6px rgba(243, 215, 116, 0.55), 0 0 16px rgba(212, 175, 55, 0.35);
}

.marquee-sub {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.5px;
  color: var(--white-dim);
  margin-top: 2px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid #2c2c2e;
  background: var(--charcoal);
  color: var(--gold);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, background 0.15s ease;
}
.icon-btn:active { transform: scale(0.92); background: var(--charcoal-2); }

/* ---------------------------------------------------------------------
   LAYOUT
   --------------------------------------------------------------------- */
.view { min-height: 100%; }
main.view { padding: 16px 16px 0; max-width: 560px; margin: 0 auto; }

.card {
  background: var(--charcoal);
  border: 1px solid #2a2a2c;
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 16px;
  animation: fadeUp 0.35s ease both;
}

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

.section-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--white-dim);
  margin: 0 0 14px;
}

.bottom-spacer { height: 140px; }

/* ---------------------------------------------------------------------
   CABINET SELECTOR
   --------------------------------------------------------------------- */
.cabinet-grid { display: flex; flex-direction: column; gap: 10px; }

.cabinet-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1.5px solid #303032;
  background: var(--charcoal-2);
  text-align: left;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
}
.cabinet-btn:active { transform: scale(0.98); }

.cabinet-btn.selected {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold), 0 0 18px rgba(212, 175, 55, 0.25);
  background: linear-gradient(180deg, #2a2620 0%, var(--charcoal-2) 100%);
}

.cabinet-name { font-size: 17px; font-weight: 700; color: var(--white); }
.cabinet-price { font-size: 20px; font-weight: 800; color: var(--gold); }
.cabinet-tag { font-size: 12px; color: var(--white-dim); }

/* ---------------------------------------------------------------------
   PILL BUTTONS (player layout / controls)
   --------------------------------------------------------------------- */
.pill-row { display: flex; gap: 8px; flex-wrap: wrap; }

.pill-btn {
  flex: 1 1 auto;
  padding: 12px 14px;
  border-radius: 999px;
  border: 1.5px solid #303032;
  background: var(--charcoal-2);
  font-size: 14px;
  font-weight: 600;
  color: var(--white-dim);
  white-space: nowrap;
  transition: all 0.2s ease;
}

.pill-btn.active {
  border-color: var(--gold);
  background: var(--gold);
  color: #141210;
}

.pill-btn:disabled {
  opacity: 0.35;
  pointer-events: none;
}

.pill-note {
  font-size: 11px;
  opacity: 0.75;
  margin-left: 4px;
}

.helper-text {
  font-size: 12.5px;
  color: var(--white-dim);
  margin: 10px 2px 0;
  line-height: 1.4;
}

/* ---------------------------------------------------------------------
   TOGGLE SWITCHES (upgrades)
   --------------------------------------------------------------------- */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #26262a;
}
.toggle-row:last-of-type { border-bottom: none; }

.toggle-label { display: flex; flex-direction: column; gap: 2px; }
.toggle-label span:first-child { font-size: 15px; font-weight: 600; }
.toggle-price { font-size: 12.5px; color: var(--gold); }

.switch { position: relative; display: inline-block; width: 51px; height: 31px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; cursor: pointer; inset: 0;
  background: #38383a; border-radius: 999px;
  transition: background 0.2s ease;
}
.slider::before {
  content: ""; position: absolute; height: 27px; width: 27px;
  left: 2px; top: 2px; background: white; border-radius: 50%;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
.switch input:checked + .slider { background: var(--gold); }
.switch input:checked + .slider::before { transform: translateX(20px); }

.delivery-input-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 10px 14px;
  background: var(--charcoal-2);
  border-radius: var(--radius-sm);
  border: 1px solid #303032;
}
.dollar-sign { color: var(--gold); font-weight: 700; }
.delivery-input-wrap input {
  border: none; background: transparent; font-size: 16px; width: 100%; outline: none;
}

/* ---------------------------------------------------------------------
   FORM FIELDS
   --------------------------------------------------------------------- */
.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }

.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--white-dim);
  margin-bottom: 6px;
}

.optional-tag { font-weight: 400; font-style: italic; opacity: 0.7; }

.field input[type="text"],
.field input[type="tel"],
.field input[type="email"],
.field input[type="date"],
.field input[type="number"],
.field input[type="password"],
.field input[type="file"],
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid #303032;
  background: var(--charcoal-2);
  font-size: 15.5px;
  outline: none;
  transition: border-color 0.15s ease;
}

.field input:focus, .field textarea:focus, .delivery-input-wrap input:focus { border-color: var(--gold); }

.field textarea { resize: vertical; font-family: inherit; }

.dollar-field {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid #303032;
  background: var(--charcoal-2);
}
.dollar-field span { color: var(--gold); font-weight: 700; }
.dollar-field input {
  border: none; background: transparent; padding: 12px 0; font-size: 15.5px; width: 100%; outline: none;
}

/* ---------------------------------------------------------------------
   STICKY PRICE BAR
   --------------------------------------------------------------------- */
.price-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 15;
  background: linear-gradient(180deg, rgba(10,10,10,0) 0%, var(--black) 18%);
  padding: 10px 16px calc(14px + env(safe-area-inset-bottom));
}

.price-bar-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  background: var(--charcoal);
  border: 1px solid #2c2c2e;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 10px;
  max-width: 560px;
  margin-left: auto; margin-right: auto;
  box-shadow: 0 8px 30px rgba(0,0,0,0.55);
}

.price-block { display: flex; flex-direction: column; }
.price-block.small { align-items: flex-end; }
.price-label { font-size: 10.5px; letter-spacing: 0.8px; text-transform: uppercase; color: var(--white-dim); }
.price-value { font-size: 22px; font-weight: 800; color: var(--gold); }
.price-block.small .price-value { font-size: 15px; color: var(--white); }

.primary-btn {
  display: block;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 16px;
  border-radius: var(--radius-md);
  border: none;
  background: linear-gradient(180deg, var(--gold-bright) 0%, var(--gold) 100%);
  color: #191510;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.3px;
  transition: transform 0.1s ease, opacity 0.15s ease;
}
.primary-btn:active { transform: scale(0.98); opacity: 0.9; }

.secondary-btn {
  display: block;
  flex: 1;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--gold);
  background: transparent;
  color: var(--gold);
  font-size: 16px;
  font-weight: 700;
}
.secondary-btn:active { transform: scale(0.98); }

.text-btn {
  background: none; border: none; color: var(--gold); font-size: 13px; font-weight: 600; padding: 4px 0;
}

/* ---------------------------------------------------------------------
   OVERLAY VIEWS (Quote / Admin)
   --------------------------------------------------------------------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: var(--black);
  display: flex;
  flex-direction: column;
  animation: slideIn 0.28s cubic-bezier(.22,.9,.32,1) both;
}
@keyframes slideIn { from { transform: translateY(4%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.quote-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 14px) 12px 12px;
  border-bottom: 1px solid #222224;
}
.quote-topbar-title { font-size: 16px; font-weight: 700; }
.spacer-block { width: 40px; }

.quote-scroll { flex: 1; overflow-y: auto; padding: 16px; max-width: 560px; width: 100%; margin: 0 auto; }

.quote-action-bar {
  display: flex;
  gap: 10px;
  padding: 12px 16px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid #222224;
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
}

/* ---------------------------------------------------------------------
   QUOTE DOCUMENT
   --------------------------------------------------------------------- */
.quote-doc {
  background: var(--charcoal);
  border: 1px solid #2a2a2c;
  border-radius: var(--radius-lg);
  padding: 22px;
}

.quote-logo-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid #2a2a2c;
}
.quote-logo-row img { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; }
.quote-logo-mark {
  width: 52px; height: 52px; border-radius: 12px;
  border: 1.5px solid var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: var(--gold); font-size: 15px; letter-spacing: 1px;
}
.quote-company-name { font-size: 16px; font-weight: 800; color: var(--gold); }
.quote-company-meta { font-size: 12px; color: var(--white-dim); line-height: 1.5; }

.quote-section { margin-bottom: 18px; }
.quote-section:last-child { margin-bottom: 0; }
.quote-section-label {
  font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--white-dim);
  margin-bottom: 8px;
}
.quote-line {
  display: flex; justify-content: space-between; font-size: 14.5px; padding: 5px 0;
}
.quote-line span:last-child { color: var(--white); font-weight: 600; }
.quote-line.muted span:last-child { color: var(--white-dim); font-weight: 400; }

.quote-divider { height: 1px; background: #2a2a2c; margin: 14px 0; }

.quote-total-row { display: flex; justify-content: space-between; font-size: 22px; font-weight: 800; color: var(--gold); }
.quote-sub-row { display: flex; justify-content: space-between; font-size: 14px; color: var(--white-dim); margin-top: 4px; }

.quote-notes { font-size: 13.5px; color: var(--white-dim); line-height: 1.5; white-space: pre-wrap; }

/* ---------------------------------------------------------------------
   BOTTOM SHEETS (share / admin login)
   --------------------------------------------------------------------- */
.sheet { position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.6); }
.sheet-panel {
  position: relative;
  width: 100%;
  background: var(--charcoal);
  border-radius: 22px 22px 0 0;
  padding: 20px 18px calc(20px + env(safe-area-inset-bottom));
  animation: sheetUp 0.25s ease both;
  border-top: 1px solid #2c2c2e;
}
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

.sheet-title { font-size: 16px; font-weight: 700; margin: 0 0 14px; text-align: center; }

.sheet-option {
  display: block;
  width: 100%;
  padding: 15px;
  margin-bottom: 8px;
  border-radius: var(--radius-md);
  border: 1px solid #303032;
  background: var(--charcoal-2);
  font-size: 15px;
  font-weight: 600;
  color: var(--white);
}
.sheet-option:active { background: #333336; }

.sheet-cancel {
  display: block;
  width: 100%;
  padding: 15px;
  margin-top: 4px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--danger);
  font-size: 15px;
  font-weight: 700;
}

.error-text { color: var(--danger); font-size: 13px; margin: -6px 0 12px; }

.logo-preview-wrap { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.logo-preview-wrap img { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; border: 1px solid #303032; }

.save-confirm { text-align: center; color: var(--gold); font-size: 13px; margin-top: 10px; }

::-webkit-scrollbar { display: none; }
