/* ==========================================================================
   AutoPack — Trébol Studio
   Paleta y tipografía calcadas de identidad-marca/tokens.css, adaptadas
   a un fondo claro para que un formulario largo se lea cómodo (criterio
   "Apple limpio" pedido: aire, tipografía cuidada, colores neutros).
   ========================================================================== */

:root {
  --bg: #F7F5EF;
  --surface: #FFFFFF;
  --border: #E3DFD2;
  --text: #14241D;
  --text-muted: #5B6B62;
  --verde: #0D261E;
  --verde-suave: #1F4D3A;
  --oro: #C9B082;
  --oro-hover: #D9C698;
  --oro-oscuro: #A8915F;
  --error: #B3261E;
  --error-bg: #FBEAE8;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(13, 38, 30, 0.08);
  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Inter", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 20px 100px;
  min-height: 100vh;
}

/* ---------- Cabecera ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 2px 18px;
}

.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  color: var(--verde);
  letter-spacing: 0.01em;
}
.brand span { color: var(--oro-oscuro); font-weight: 600; }

.timer {
  font-size: 13px;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  white-space: nowrap;
}

/* ---------- Barra de progreso ---------- */
.progress-wrap { margin-bottom: 20px; }
.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--oro-oscuro), var(--oro));
  width: 11%;
  transition: width 0.35s ease;
}
.progress-label {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: right;
}

/* ---------- Banner de borrador ---------- */
.draft-banner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.draft-banner p { margin: 0 0 12px; font-size: 14px; color: var(--text); }
.draft-banner-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Paso / campos ---------- */
.form-root {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 22px 28px;
}

.step-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--verde);
  margin: 0 0 18px;
}

.callout {
  background: #FBF7EC;
  border: 1px solid var(--oro);
  border-left: 4px solid var(--oro-oscuro);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--verde);
  margin-bottom: 22px;
}

.fields { display: flex; flex-direction: column; gap: 24px; }

.field, fieldset.field {
  border: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field.has-error input,
.field.has-error select,
.field.has-error textarea {
  border-color: var(--error);
  background: var(--error-bg);
}

label, legend {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  padding: 0;
}

.req { color: var(--error); font-weight: 700; }
.opt { color: var(--text-muted); font-weight: 400; font-size: 13px; }

.help {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="password"],
select,
textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--oro-oscuro);
  box-shadow: 0 0 0 3px rgba(201, 176, 130, 0.28);
  background: var(--surface);
}

textarea { resize: vertical; min-height: 96px; }

.textarea-wrap { position: relative; }
.textarea-wrap textarea { padding-right: 46px; }

.mic-btn {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.mic-btn:hover { border-color: var(--oro-oscuro); }
.mic-btn.listening {
  background: var(--error);
  border-color: var(--error);
  color: #fff;
  animation: pulse 1.1s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(179, 38, 30, 0.45); }
  70% { box-shadow: 0 0 0 10px rgba(179, 38, 30, 0); }
  100% { box-shadow: 0 0 0 0 rgba(179, 38, 30, 0); }
}

.option-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 15px;
  font-weight: 400;
  color: var(--text);
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  cursor: pointer;
}
.option-row:has(input:checked) {
  border-color: var(--oro-oscuro);
  background: #FBF7EC;
}
.option-row input { margin-top: 3px; accent-color: var(--verde); flex-shrink: 0; }
fieldset.field { display: flex; flex-direction: column; gap: 8px; }
fieldset.field .option-row + .option-row { margin-top: 0; }

.otro-input { margin-top: 6px; }

.file-list {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.file-list li {
  font-size: 13px;
  color: var(--text-muted);
  padding: 6px 10px;
  background: var(--bg);
  border-radius: 8px;
}
.file-list li.file-error { color: var(--error); background: var(--error-bg); }

.error {
  font-size: 13px;
  color: var(--error);
  margin: 0;
  min-height: 16px;
}

/* ---------- Navegación ---------- */
.wizard-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
}

.btn {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  border-radius: 999px;
  padding: 14px 26px;
  border: none;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.1s ease;
}
.btn:active { transform: scale(0.98); }
.btn-sm { padding: 9px 16px; font-size: 13px; }

.btn-primary {
  background: linear-gradient(135deg, var(--oro-hover), var(--oro), var(--oro-oscuro));
  color: var(--verde);
  margin-left: auto;
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-secondary {
  background: transparent;
  color: var(--verde);
  border: 1px solid var(--verde);
}
.btn-secondary:hover { background: rgba(13, 38, 30, 0.05); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover { color: var(--text); }

.btn-danger {
  background: var(--error);
  color: #fff;
}
.btn-danger:hover { filter: brightness(1.08); }

/* ---------- Pantalla de confirmación ---------- */
.confirm-screen {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 48px 28px;
  text-align: center;
}
.confirm-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--verde);
  color: var(--oro);
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
}
.confirm-screen h2 {
  font-family: var(--font-display);
  color: var(--verde);
  font-size: 26px;
  margin: 0 0 12px;
}
.confirm-screen p { color: var(--text-muted); font-size: 15px; line-height: 1.6; margin: 0 0 6px; }
.confirm-note { font-size: 13px; }
.confirm-note a { color: var(--oro-oscuro); }

/* ---------- Honeypot (oculto a personas, visible a bots) ---------- */
.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ==========================================================================
   Panel (dashboard.html) — comparte tokens con el formulario
   ========================================================================== */

.dashboard-page { padding-bottom: 60px; }

.login-gate {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 24px;
  max-width: 360px;
  margin: 40px auto 0;
  text-align: center;
}
.login-gate h2 { font-family: var(--font-display); color: var(--verde); margin: 0 0 6px; }
.login-gate input { margin: 14px 0; }

.dashboard-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.dashboard-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 14px;
}
.dashboard-table th, .dashboard-table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.dashboard-table th { background: var(--bg); font-weight: 600; color: var(--verde); }
.dashboard-table tr:last-child td { border-bottom: none; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--border);
  color: var(--text);
}
.badge-nuevo { background: #E4EEE8; color: var(--verde-suave); }
.badge-en_valoracion { background: #FBF3DC; color: var(--oro-oscuro); }
.badge-propuesta_enviada { background: #E4E9F5; color: #33477A; }
.badge-aceptado { background: #DFF3E3; color: #1F6B3A; }
.badge-descartado { background: #F5E4E2; color: var(--error); }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(13, 38, 30, 0.5);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 30px 16px;
  overflow-y: auto;
  z-index: 50;
}
.modal-content {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 26px 22px;
  max-width: 560px;
  width: 100%;
  position: relative;
  box-shadow: var(--shadow);
}
.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  border: none;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-muted);
}
.modal-content h3 { font-family: var(--font-display); color: var(--verde); margin-top: 0; }
.detail-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
  max-height: 40vh;
  overflow-y: auto;
  padding-right: 4px;
}
.detail-row { font-size: 14px; line-height: 1.5; }
.detail-row strong { color: var(--verde); }
.modal-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }

/* ---------- Responsive ---------- */
@media (min-width: 640px) {
  .page { padding-top: 40px; }
  .step-title { font-size: 30px; }
}

@media (max-width: 420px) {
  .dashboard-table { display: block; overflow-x: auto; }
}
