/* ──────────────────────────────────────────
   SpaceRig App CSS — Design Form + Proposal
   Extends theme.css variables.
   ────────────────────────────────────────── */

/* ── Landing page hero CTA ── */
.hero-actions {
  margin-top: 2.5rem;
  display: flex;
  gap: 1rem;
  align-items: center;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--accent);
  color: #0a0a0f;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  padding: 0.85rem 2rem;
  border-radius: 6px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
  letter-spacing: 0.01em;
}

.cta-btn:hover { opacity: 0.88; transform: translateY(-1px); }
.cta-btn:active { transform: translateY(0); }
.cta-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ── App Nav ── */
.app-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 4rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.nav-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.nav-tagline {
  color: var(--fg-muted);
  font-size: 0.85rem;
}

.nav-action {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--accent);
  text-decoration: none;
  border: 1px solid var(--accent-dim);
  padding: 0.4rem 1rem;
  border-radius: 6px;
  transition: background 0.2s;
}

.nav-action:hover { background: var(--accent-dim); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-link {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--fg-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.nav-link:hover { color: var(--fg); }

/* ── Alert ── */
.alert-error {
  margin: 0 4rem 2rem;
  background: rgba(255, 80, 80, 0.08);
  border: 1px solid rgba(255, 80, 80, 0.3);
  color: #ff8080;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.alert-icon { font-size: 1.1rem; }

/* ─────────────────────────────────────
   DESIGN FORM PAGE
   ───────────────────────────────────── */

.design-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 3rem 2rem 6rem;
}

.design-header {
  margin-bottom: 3rem;
}

.design-header h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.1;
  margin: 1rem 0 1rem;
}

/* Form sections */
.design-form {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.form-section {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  background: var(--bg-surface);
}

.section-label {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent);
  text-transform: uppercase;
  display: block;
  margin-bottom: 1.5rem;
}

.optional-tag {
  font-size: 0.65rem;
  color: var(--fg-muted);
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  margin-left: 0.5rem;
}

/* Labels + inputs */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.field-group label {
  font-size: 0.875rem;
  color: var(--fg-muted);
  font-weight: 500;
}

.field-group input,
.field-group textarea {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.75rem 1rem;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}

.field-group input:focus,
.field-group textarea:focus {
  border-color: var(--accent);
}

.field-group textarea {
  resize: vertical;
  line-height: 1.6;
}

/* Room dimensions row */
.field-row {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
}

.field-row .field-group {
  flex: 1;
}

.field-sep {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--fg-muted);
  padding-bottom: 0.75rem;
  flex-shrink: 0;
}

.area-display {
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: var(--fg-muted);
  padding-bottom: 0.85rem;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 80px;
}

.area-active { color: var(--accent); }

/* Option cards (use case + platform) */
.option-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.platform-grid {
  grid-template-columns: repeat(5, 1fr);
}

.option-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1.25rem 1rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
}

.option-card input[type=radio] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.option-card:hover { border-color: var(--accent-dim); }
.option-card.selected {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.option-icon { font-size: 1.5rem; }
.option-title {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--fg);
}
.option-desc {
  font-size: 0.78rem;
  color: var(--fg-muted);
  line-height: 1.4;
}

.platform-card {
  align-items: center;
  justify-content: center;
  padding: 1rem;
  text-align: center;
}

.platform-card .option-title { font-size: 0.82rem; }

/* Budget */
.budget-field { gap: 1rem; }

.input-prefix-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-prefix {
  position: absolute;
  left: 1rem;
  color: var(--fg-muted);
  font-size: 1rem;
  pointer-events: none;
}

.input-prefix-wrap input {
  padding-left: 1.8rem !important;
}

.budget-presets {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.preset-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--fg-muted);
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.preset-btn:hover { border-color: var(--accent-dim); color: var(--fg); }
.preset-btn.active { border-color: var(--accent); color: var(--accent); }

/* Submit */
.form-submit {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.submit-note {
  color: var(--fg-muted);
  font-size: 0.82rem;
}

/* ─────────────────────────────────────
   PROPOSAL OUTPUT PAGE
   ───────────────────────────────────── */

.proposal-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem 6rem;
}

/* Header band */
.proposal-header {
  padding: 3rem 0 2.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 3rem;
}

.proposal-meta {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.proposal-date {
  font-size: 0.82rem;
  color: var(--fg-muted);
}

.proposal-header h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  margin-bottom: 1rem;
}

.proposal-summary {
  color: var(--fg-muted);
  font-size: 1.05rem;
  max-width: 720px;
  line-height: 1.7;
  margin-bottom: 2rem;
}

/* Top-line metrics */
.proposal-topline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.topline-item {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.5rem;
  min-width: 120px;
}

.topline-item.highlight {
  border-color: var(--accent-dim);
  background: var(--accent-dim);
}

.topline-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 0.3rem;
}

.topline-value {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--fg);
}

.accent-text { color: var(--accent) !important; }

.over-budget-notice {
  margin-top: 1.5rem;
  background: rgba(255, 160, 60, 0.08);
  border: 1px solid rgba(255, 160, 60, 0.3);
  color: #ffa03c;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  font-size: 0.9rem;
}

/* Sections */
.proposal-body {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.proposal-section { }

.section-heading {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: var(--fg);
}

/* Analysis grid */
.analysis-grid {
  display: grid;
  grid-template-columns: 160px 1fr 1fr;
  gap: 1rem;
}

.analysis-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
}

.analysis-card.wide { grid-column: span 1; }

.analysis-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 0.5rem;
}

.analysis-value {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
}

.analysis-text {
  font-size: 0.9rem;
  color: var(--fg-muted);
  line-height: 1.6;
}

/* BOM table */
.bom-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.bom-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.bom-table th {
  background: var(--bg-surface);
  color: var(--fg-muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.9rem 1.25rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.bom-row {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.bom-row:hover { background: var(--bg-surface); }
.bom-row:last-child { border-bottom: none; }

.bom-table td {
  padding: 1rem 1.25rem;
  vertical-align: top;
}

.category-pill {
  display: inline-block;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.2rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--fg-muted);
  white-space: nowrap;
}

.sku-name {
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 0.25rem;
}

.sku-purpose {
  font-size: 0.8rem;
  color: var(--fg-muted);
  line-height: 1.4;
}

.qty-cell {
  font-family: var(--font-display);
  font-weight: 600;
  text-align: center;
}

.price-cell {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--fg-muted);
  text-align: right;
  white-space: nowrap;
}

.total-cell { color: var(--fg); }

.bom-subtotal td,
.bom-install td {
  padding: 0.75rem 1.25rem;
  font-size: 0.85rem;
  color: var(--fg-muted);
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
}

.install-label { font-style: italic; }
.install-value { font-family: var(--font-display); }

.bom-grand-total td {
  padding: 1rem 1.25rem;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  background: var(--accent-dim);
  border-top: 2px solid var(--accent);
}

.text-right { text-align: right !important; }
.text-center { text-align: center !important; }

/* Platform + lead time */
.two-col-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.info-block {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.75rem 2rem;
}

.info-text {
  color: var(--fg-muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

.lead-time-display {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent);
}

/* Recommendations */
.recommendations-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.rec-item {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
}

.rec-num {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  min-width: 2rem;
  padding-top: 0.1rem;
}

.rec-text {
  color: var(--fg-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Actions */
.proposal-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding-top: 1rem;
}

.secondary-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--fg);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.8rem 1.75rem;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.2s;
}

.secondary-btn:hover { border-color: var(--accent-dim); }

.room3d-btn {
  background: linear-gradient(135deg, #1a2a4a 0%, #1e1a3a 100%);
  border: 1px solid #3a4a8a;
  color: #8aa4f0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.8rem 1.75rem;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s;
}
.room3d-btn:hover { border-color: #5b7cf7; color: #b0c4ff; }

.action-btn { display: inline-flex; align-items: center; gap: 0.5rem; }

/* Print */
@media print {
  .app-nav, .proposal-actions { display: none; }
  .proposal-page { padding: 0; max-width: 100%; }
  body { background: white; color: #1a1a1a; }
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .app-nav { padding: 1rem 1.5rem; }
  .nav-tagline { display: none; }
  .alert-error { margin: 0 1.5rem 1.5rem; }
  .design-page { padding: 2rem 1.5rem 4rem; }
  .option-grid { grid-template-columns: 1fr; }
  .platform-grid { grid-template-columns: repeat(3, 1fr); }
  .field-row { flex-wrap: wrap; }
  .form-submit { flex-direction: column; align-items: flex-start; }
  .proposal-topline { gap: 0.4rem; }
  .two-col-section { grid-template-columns: 1fr; }
  .analysis-grid { grid-template-columns: 1fr 1fr; }
  .analysis-grid .analysis-card:first-child { grid-column: span 2; }
}

@media (max-width: 600px) {
  .platform-grid { grid-template-columns: repeat(2, 1fr); }
  .analysis-grid { grid-template-columns: 1fr; }
  .analysis-grid .analysis-card:first-child { grid-column: span 1; }
  .proposal-actions { flex-direction: column; }
}
