/* ============================================================
   Ficha de Contratación Pública — obrero-first
   Versión: 1.0 - Julio 2026
   Diseño para trabajadores en su teléfono, sin login.
   Prioriza: pasos cortos, botones grandes, alto contraste,
   letra grande, mínimo tecleo.
   ============================================================ */

:root {
  --fc-primary: #2c3e50;
  --fc-accent: #f39c12;      /* naranja construcción, alto contraste al sol */
  --fc-accent-dark: #d9820b;
  --fc-ok: #27ae60;
  --fc-err: #e74c3c;
  --fc-bg: #f4f6f8;
  --fc-text: #1f2d3d;
  --fc-muted: #7b8a9a;
  --fc-border: #d3dce6;
  --fc-radius: 14px;
}

/* Ocultar el chrome del sitio: esta página es una app enfocada */
body.fc-body #wrapwrap > header,
body.fc-body #wrapwrap > footer,
body.fc-body .o_footer_copyright,
body.fc-body header#top,
body.fc-body .o_main_navbar { display: none !important; }

body.fc-body {
  background: var(--fc-bg);
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--fc-text);
  -webkit-text-size-adjust: 100%;
}

.fc-app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #fff;
}

/* ---------- Encabezado fijo ---------- */
.fc-top {
  background: var(--fc-primary);
  color: #fff;
  padding: 18px 20px 14px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.fc-top .fc-brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 15px; font-weight: 600; letter-spacing: .3px;
}
.fc-top .fc-brand i { color: var(--fc-accent); font-size: 20px; }
.fc-steptitle { font-size: 21px; font-weight: 700; margin: 12px 0 2px; }
.fc-stepsub { font-size: 14px; opacity: .85; }

/* Barra de progreso */
.fc-progress {
  height: 8px; background: rgba(255,255,255,.2);
  border-radius: 8px; margin-top: 14px; overflow: hidden;
}
.fc-progress-bar {
  height: 100%; background: var(--fc-accent);
  width: 0%; transition: width .3s ease; border-radius: 8px;
}
.fc-stepcount { font-size: 12px; opacity: .8; margin-top: 6px; text-align: right; }

/* ---------- Cuerpo con pasos ---------- */
.fc-main { flex: 1; padding: 22px 20px 120px; }
.fc-step { display: none; animation: fcfade .25s ease; }
.fc-step.active { display: block; }
@keyframes fcfade { from { opacity: 0; transform: translateY(8px);} to {opacity:1; transform:none;} }

.fc-field { margin-bottom: 20px; }
.fc-field > label {
  display: block; font-size: 16px; font-weight: 600;
  margin-bottom: 8px; color: var(--fc-text);
}
.fc-field .fc-hint { font-size: 13px; color: var(--fc-muted); font-weight: 400; margin-top: 2px; }
.fc-req { color: var(--fc-err); font-weight: 700; }
.fc-opt { color: var(--fc-muted); font-weight: 400; font-size: 13px; }

/* Inputs grandes */
.fc-input, .fc-select, textarea.fc-input {
  width: 100%;
  font-size: 18px;
  padding: 15px 16px;
  border: 2px solid var(--fc-border);
  border-radius: var(--fc-radius);
  background: #fff;
  color: var(--fc-text);
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}
.fc-input:focus, .fc-select:focus, textarea.fc-input:focus {
  outline: none; border-color: var(--fc-accent);
  box-shadow: 0 0 0 3px rgba(243,156,18,.15);
}
.fc-select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237b8a9a' stroke-width='2'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 44px;
}
.fc-input.fc-err-field { border-color: var(--fc-err); }
.fc-fielderr { color: var(--fc-err); font-size: 13px; margin-top: 6px; display: none; }
.fc-fielderr.show { display: block; }

/* Opciones tipo tarjeta (radios grandes) */
.fc-choices { display: grid; gap: 10px; }
.fc-choices.cols2 { grid-template-columns: 1fr 1fr; }
.fc-choice {
  display: flex; align-items: center; gap: 10px;
  padding: 15px 16px; border: 2px solid var(--fc-border);
  border-radius: var(--fc-radius); font-size: 17px; cursor: pointer;
  background: #fff; user-select: none;
}
.fc-choice input { display: none; }
.fc-choice .fc-dot {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--fc-border); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.fc-choice.sel { border-color: var(--fc-accent); background: rgba(243,156,18,.08); }
.fc-choice.sel .fc-dot { border-color: var(--fc-accent); background: var(--fc-accent); }
.fc-choice.sel .fc-dot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background:#fff; }

/* Campo condicional */
.fc-when { display: none; }
.fc-when.show { display: block; }

/* ---------- Barra inferior de navegación ---------- */
.fc-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  max-width: 560px; margin: 0 auto;
  display: flex; gap: 12px; padding: 14px 20px 18px;
  background: #fff; border-top: 1px solid var(--fc-border);
  box-shadow: 0 -4px 16px rgba(0,0,0,.06);
}
.fc-btn {
  flex: 1; font-size: 18px; font-weight: 700;
  padding: 17px 20px; border-radius: var(--fc-radius);
  border: none; cursor: pointer; min-height: 56px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.fc-btn-primary { background: var(--fc-accent); color: #fff; }
.fc-btn-primary:active { background: var(--fc-accent-dark); }
.fc-btn-ghost { background: #eef1f5; color: var(--fc-text); flex: 0 0 34%; }
.fc-btn:disabled { opacity: .5; }

/* ---------- Pantalla de éxito ---------- */
.fc-done { text-align: center; padding: 60px 24px; display: none; }
.fc-done.show { display: block; }
.fc-done .fc-check {
  width: 96px; height: 96px; border-radius: 50%; background: var(--fc-ok);
  color: #fff; font-size: 52px; display: flex; align-items: center;
  justify-content: center; margin: 0 auto 24px;
}
.fc-done h2 { font-size: 26px; margin: 0 0 10px; }
.fc-done p { font-size: 17px; color: var(--fc-muted); line-height: 1.5; }

/* Aviso de guardado / errores globales */
.fc-toast {
  position: fixed; bottom: 92px; left: 50%; transform: translateX(-50%);
  background: var(--fc-text); color: #fff; padding: 12px 20px;
  border-radius: 30px; font-size: 14px; opacity: 0; pointer-events: none;
  transition: opacity .3s; z-index: 30; max-width: 90%; text-align: center;
}
.fc-toast.show { opacity: .95; }
.fc-saved { font-size: 12px; color: var(--fc-muted); text-align: center; margin-top: 10px; }

/* Revisión final */
.fc-review { background: var(--fc-bg); border-radius: var(--fc-radius); padding: 4px 16px; }
.fc-review-row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--fc-border); font-size: 15px; }
.fc-review-row:last-child { border-bottom: none; }
.fc-review-row .k { color: var(--fc-muted); }
.fc-review-row .v { font-weight: 600; text-align: right; }
.fc-review-empty { color: var(--fc-muted); font-style: italic; }
