/* Farmhouse — formulario público del colaborador (colaborador.html).
   Sin fuentes ni recursos de terceros (política de seguridad estricta, ver main.py). */
:root {
  color-scheme: light;      /* siempre claro: el formulario no cambia con el modo oscuro del equipo */
  --bg: #f1f5f2; --card: #ffffff; --ink: #14231b; --muted: #5d6f64; --line: #d9e2dc;
  --primary: #0f6b43; --primary-hover: #0b5a38; --primary-soft: #e6f3ec; --on-primary: #ffffff;
  --err: #c62828; --field: #ffffff; --alert-bg: #fde7e7; --alert-ink: #9b1c1c;
  --shadow: 0 1px 2px rgba(16,40,28,.06), 0 8px 24px rgba(16,40,28,.08);
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 760px; margin: 0 auto; padding: 20px 16px 48px; }
[hidden] { display: none !important; }

.brand { display: flex; align-items: center; gap: 14px; margin: 8px 0 18px; }
.logo { width: 52px; height: 52px; border-radius: 14px; object-fit: contain; background: var(--card); padding: 4px; box-shadow: var(--shadow); }
.brand h1 { margin: 0; font-size: 1.35rem; letter-spacing: -.01em; }
.brand p { margin: 0; color: var(--muted); font-size: .9rem; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 22px; box-shadow: var(--shadow); margin-bottom: 16px; }
.state { text-align: center; padding: 40px 22px; }
.state h2 { margin: 0 0 8px; font-size: 1.2rem; }
.state p { margin: 0; color: var(--muted); }
.check { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-size: 34px; font-weight: 700; }
.spinner { display: block; width: 30px; height: 30px; margin: 0 auto 12px; border: 3px solid var(--line); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.hello { margin: 0 0 6px; font-size: 1.1rem; font-weight: 700; }
.intro { margin: 0 0 14px; color: var(--muted); font-size: .95rem; }
.secure { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: 10px; background: var(--primary-soft); color: var(--ink); font-size: .85rem; margin-bottom: 6px; }

.sec { display: flex; align-items: center; gap: 10px; margin: 26px 0 12px; font-size: .8rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--primary); }
.sec::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.sec span { width: 24px; height: 24px; border-radius: 50%; background: var(--primary-soft); display: grid; place-items: center; font-size: .75rem; }
.note { margin: -6px 0 12px; color: var(--muted); font-size: .88rem; }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 16px; }
.full { grid-column: 1 / -1; }
label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 5px; }
.opt { font-weight: 400; color: var(--muted); }
input, select, textarea {
  width: 100%; padding: 12px; font: inherit; color: var(--ink); background: var(--field);
  border: 1px solid var(--line); border-radius: 10px; transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 76px; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.field.bad input, .field.bad select, .field.bad textarea { border-color: var(--err); }
.hint { display: block; margin-top: 4px; color: var(--muted); font-size: .78rem; }
.err { display: none; margin-top: 4px; color: var(--err); font-size: .8rem; }
.field.bad .err, #consentErr.on { display: block; }

.dep-row { display: grid; grid-template-columns: 1fr 80px 1fr 44px; gap: 8px; margin-bottom: 8px; }
.dep-row button { border: 0; border-radius: 10px; background: var(--alert-bg); color: var(--alert-ink); font-size: 1.2rem; cursor: pointer; }

.consent { display: flex; gap: 10px; align-items: flex-start; margin: 22px 0 4px; font-weight: 400; font-size: .9rem; }
.consent input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--primary); }

.btn { font: inherit; font-weight: 700; cursor: pointer; border-radius: 12px; padding: 13px 18px; border: 1px solid var(--line); background: var(--card); color: var(--ink); }
.btn.primary { width: 100%; margin-top: 18px; background: var(--primary); border-color: var(--primary); color: var(--on-primary); font-size: 1.05rem; }
.btn.primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn.ghost { border-style: dashed; color: var(--primary); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.alert { margin-top: 14px; padding: 12px 14px; border-radius: 10px; background: var(--alert-bg); color: var(--alert-ink); font-size: .9rem; }
.foot { text-align: center; color: var(--muted); font-size: .8rem; margin-top: 8px; }

/* Señuelo anti-robots: fuera de pantalla, no con display:none (los robots lo detectan). */
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

@media (max-width: 600px) {
  .card { padding: 18px 16px; }
  .grid { grid-template-columns: 1fr; }
  .dep-row { grid-template-columns: 1fr 70px 1fr 44px; }
}
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } * { transition: none !important; } }

/* Datos bancarios pendientes */
.consent.pending { margin: 4px 0 14px; padding: 12px 14px; border: 1px dashed var(--line); border-radius: 12px; cursor: pointer; }
.consent.pending strong { display: block; font-weight: 600; }
.consent.pending small { display: block; margin-top: 2px; color: var(--muted); font-size: .85rem; }
.consent.pending:has(input:checked) { border-style: solid; border-color: var(--primary); background: var(--primary-soft); }
#bankFields[hidden] { display: none; }
