/*
 * css/components.css
 * ─────────────────────────────────────────────────────────────
 * Reusable UI components used across multiple pages:
 *   - Cards
 *   - Tabs
 *   - Checklist items (calculator)
 *   - Buttons
 *   - Forms (inputs, selects, textareas)
 *   - Modals
 *   - Total bar (calculator footer)
 *   - Settings panel
 * ─────────────────────────────────────────────────────────────
 */

/* ── Card ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 16px;
}
.card-title {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-family: 'DM Mono', monospace;
  margin-bottom: 12px;
}

/* ── Tabs ── */
.tab-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.tab {
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid var(--border2);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-family: 'Outfit', sans-serif;
  transition: all 0.15s;
}
.tab:hover        { color: var(--text); border-color: var(--border2); }
.tab.active       { background: var(--accent); color: #111; border-color: var(--accent); font-weight: 600; }

/* ── Checklist (calculator add-ons) ── */
.check-section-title {
  font-size: 11px;
  color: var(--muted2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: 'DM Mono', monospace;
  margin: 16px 0 8px;
}

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.1s;
  border: 1px solid transparent;
}
.check-item:hover         { background: var(--surface2); }
.check-item.checked       { background: rgba(200,240,96,0.05); border-color: rgba(200,240,96,0.15); }
.check-item input[type=checkbox] { display: none; }

/* Custom checkbox visual */
.checkmark {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--border2);
  flex-shrink: 0;
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.checked .checkmark { background: var(--accent); border-color: var(--accent); }
.checkmark::after {
  content: '';
  width: 5px;
  height: 9px;
  border: 2px solid #111;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translateY(-1px);
  display: none;
}
.checked .checkmark::after { display: block; }

.check-body  { flex: 1; }
.check-label { font-size: 14px; color: var(--text); }
.check-desc  { font-size: 12px; color: var(--muted); margin-top: 1px; }
.check-price { font-size: 13px; color: var(--muted); font-family: 'DM Mono', monospace; flex-shrink: 0; white-space: nowrap; padding-top: 3px; }
.checked .check-price { color: var(--accent); }

/* Base-included item (always-on, shown at top of calculator) */
.base-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: rgba(200,240,96,0.06);
  border: 1px solid rgba(200,240,96,0.15);
  margin-bottom: 4px;
}
.base-dot {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: var(--accent);
  flex-shrink: 0;
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.base-dot::after { content: '✓'; font-size: 11px; color: #111; font-weight: 700; }

/* ── Total bar (bottom of calculator) ── */
.total-bar {
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  gap: 16px;
}
.total-label  { font-size: 12px; color: var(--muted); font-family: 'DM Mono', monospace; text-transform: uppercase; letter-spacing: 0.08em; }
.total-amount { font-family: 'DM Serif Display', serif; font-size: 36px; color: var(--accent); line-height: 1; }

/* ── Buttons ── */
.btn {
  padding: 10px 20px;
  border-radius: var(--radius);
  border: none;
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-primary        { background: var(--accent); color: #111; }
.btn-primary:hover  { background: var(--accent2); }
.btn-ghost          { background: transparent; color: var(--muted); border: 1px solid var(--border2); }
.btn-ghost:hover    { color: var(--text); border-color: var(--border2); background: var(--surface2); }
.btn-danger         { background: transparent; color: var(--danger); border: 1px solid rgba(255,107,107,0.3); }
.btn-danger:hover   { background: rgba(255,107,107,0.1); }
.btn-sm             { padding: 6px 14px; font-size: 13px; }

/* ── Forms ── */
.form-grid                { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid.full           { grid-template-columns: 1fr; }
.form-group               { display: flex; flex-direction: column; gap: 6px; }
.form-group.span2         { grid-column: span 2; }

label {
  font-size: 12px;
  color: var(--muted);
  font-family: 'DM Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

input, textarea, select {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  transition: border-color 0.15s;
  width: 100%;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
}
textarea            { resize: vertical; min-height: 80px; }
select option       { background: var(--surface2); }

/* ── Modal ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-title {
  font-family: 'DM Serif Display', serif;
  font-size: 22px;
  margin-bottom: 20px;
}

/* ── Settings panel ── */
.settings-section { margin-bottom: 28px; }
.settings-label {
  font-size: 11px;
  color: var(--muted);
  font-family: 'DM Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}
