/* ==========================================================================
   SERIGRAFÍA 2026 — Estilos
   Mobile-first, pensado para iPhone / PWA instalable
   ========================================================================== */

:root {
  --navy: #0f172a;
  --navy-light: #1e293b;
  --cyan: #22d3ee;
  --cyan-dark: #0891b2;
  --bg: #f4f6f9;
  --card-bg: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --success: #16a34a;
  --radius: 16px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, sans-serif;
  overscroll-behavior-y: none;
}

.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ---------- Header ---------- */
.topbar {
  padding: calc(14px + var(--safe-top)) 20px 14px;
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  color: white;
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
}

.brand-title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.brand-subtitle {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.65);
  margin-left: 32px;
}

/* ---------- Content ---------- */
.content {
  flex: 1;
  padding: 20px 20px calc(20px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
}

/* ---------- Steps indicator ---------- */
.steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 24px;
}

.step-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  transition: all 0.25s ease;
}

.step-dot.active {
  background: var(--navy);
  color: white;
}

.step-dot.done {
  background: var(--cyan-dark);
  color: white;
}

.step-line {
  width: 28px;
  height: 2px;
  background: var(--border);
}

/* ---------- Screens ---------- */
.screen {
  display: none;
  flex-direction: column;
  flex: 1;
  animation: fadeIn 0.25s ease;
}

.screen.active {
  display: flex;
}

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

.q-title {
  font-size: 24px;
  font-weight: 800;
  margin: 4px 0 4px;
  color: var(--text-main);
}

.q-hint {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0 0 20px;
}

/* ---------- Big numeric input ---------- */
.big-input {
  width: 100%;
  padding: 18px 20px;
  font-size: 40px;
  font-weight: 800;
  text-align: center;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-bg);
  color: var(--navy);
  outline: none;
  transition: border-color 0.2s;
}

.big-input:focus {
  border-color: var(--cyan-dark);
}

.error-msg {
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
  min-height: 18px;
  margin: 10px 2px 0;
}

/* ---------- Buttons ---------- */
.btn-primary {
  margin-top: 24px;
  padding: 16px;
  border-radius: var(--radius);
  border: none;
  background: var(--navy);
  color: white;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.2s;
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-primary:disabled {
  opacity: 0.4;
}

.btn-secondary {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  background: transparent;
  color: var(--text-main);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.btn-secondary:active {
  transform: scale(0.98);
}

.nav-row {
  margin-top: 16px;
}

/* ---------- Color chips ---------- */
.color-group {
  margin-bottom: 18px;
}

.group-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px 2px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.dot-clara, .dot-oscura {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.dot-clara {
  background: #fef08a;
  border: 1px solid #d4d4a8;
}

.dot-oscura {
  background: var(--navy);
}

.chip-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.chip {
  padding: 12px 10px;
  border-radius: 12px;
  border: 2px solid var(--border);
  background: var(--card-bg);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  color: var(--text-main);
  transition: all 0.15s;
}

.chip:active {
  transform: scale(0.97);
}

.chip.selected {
  border-color: var(--navy);
  background: var(--navy);
  color: white;
}

/* ---------- Option cards (colores de diseño) ---------- */
.option-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 16px 18px;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  background: var(--card-bg);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
}

.option-card:active {
  transform: scale(0.98);
}

.option-card.selected {
  border-color: var(--cyan-dark);
  background: #ecfeff;
}

.option-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
}

.option-desc {
  font-size: 13px;
  color: var(--text-muted);
}

/* ---------- Result screen ---------- */
.result-card {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 22px;
  box-shadow: 0 2px 16px rgba(15, 23, 42, 0.06);
}

.result-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--navy);
  margin: 0;
  text-align: center;
  letter-spacing: 0.5px;
}

.result-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  margin: 2px 0 18px;
}

.result-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.result-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 14px;
}

.r-label {
  color: var(--text-muted);
}

.r-value {
  font-weight: 700;
  color: var(--text-main);
  text-align: right;
}

.result-divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

.result-total-box {
  margin-top: 18px;
  padding: 18px;
  background: var(--navy);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.total-label {
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
}

.total-value {
  color: white;
  font-size: 32px;
  font-weight: 800;
}

.result-piece-box {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #ecfeff;
  border-radius: 12px;
  font-size: 14px;
  color: var(--text-main);
}

.result-piece-box strong {
  font-size: 16px;
  color: var(--cyan-dark);
}

/* ---------- Error screen ---------- */
.error-card {
  background: var(--danger-bg);
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
}

.error-icon {
  font-size: 34px;
  margin-bottom: 8px;
}

.error-card h2 {
  font-size: 18px;
  color: var(--danger);
  margin: 4px 0 8px;
}

.error-card p {
  font-size: 14px;
  color: var(--text-main);
  line-height: 1.5;
  margin: 0;
}

/* ---------- Footer ---------- */
.footer-note {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  padding: 10px 0 calc(10px + var(--safe-bottom));
}

/* Fix double tap zoom issues on iOS */
input, button, select, textarea {
  font-family: inherit;
}
