/* ==========================================================================
   FORMULARIOS — Contáctanos, Trabaja con nosotros y PQRS (dentro del bot)
   Campos, selección, fechas, opción Sí/No, casilla de autorización de datos
   (Ley 1581) y estados de validación. Envío y validación: modules/forms.js.
   .was-validated se añade al intentar enviar, para marcar solo entonces los
   campos incompletos.
   ========================================================================== */

.form { padding: 30px 30px 26px; border-radius: 24px; border: 1px solid var(--line); background: #FFFFFF; box-shadow: 0 20px 44px rgba(7,30,58,.07); display: flex; flex-direction: column; gap: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.field input, .field textarea { width: 100%; height: 46px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: #FBFDFF; color: var(--navy); font-family: var(--body); font-size: 13px; transition: border-color .25s ease, box-shadow .25s ease; }
.field textarea { height: auto; min-height: 104px; padding: 14px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(10,121,232,.15); }
.form-submit { height: 52px; border: 0; border-radius: 999px; background: var(--accent); color: #FFFFFF; font-family: var(--body); font-size: 14px; font-weight: 700; cursor: pointer; }
.form-submit:disabled { opacity: .6; cursor: wait; }
.form-status { min-height: 1em; font-size: 12px; line-height: 1.5; color: var(--muted); }
.form-status.is-ok { color: #0B7A45; }
.form-status.is-error { color: #B42318; }

/* Campos adicionales del formulario de postulación */
.field--full { grid-column: 1 / -1; }
.field select { width: 100%; height: 42px; padding: 0 36px 0 14px; border-radius: 12px; border: 1px solid var(--line); background: #FBFDFF url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2352697E' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 14px center; color: var(--navy); font-family: var(--body); font-size: 13px; -webkit-appearance: none; appearance: none; cursor: pointer; transition: border-color .25s ease, box-shadow .25s ease; }
.field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(10,121,232,.15); }
.field select:invalid { color: #6A6A6A; }
.field input[type="date"] { cursor: pointer; }
.field input[type="date"]::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .7; }
.field-hint { font-size: 11px; color: var(--muted); }
.field-hint.is-set { color: var(--accent); font-weight: 600; }

/* Casilla (autorización de datos) */
.check { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; line-height: 1.45; color: var(--ink-2); cursor: pointer; }
.check input { flex: none; width: 16px; height: 16px; margin: 1px 0 0; accent-color: var(--accent); cursor: pointer; }
.check a { color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

/* Opción Sí / No */
.choice { border: 0; padding: 0; margin: 0; min-width: 0; }
.choice legend { padding: 0; margin-bottom: 6px; font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.choice-row { display: flex; gap: 8px; }
.choice-row label { position: relative; flex: 1; }
.choice-row input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; pointer-events: none; }
.choice-row span { display: flex; align-items: center; justify-content: center; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: #FBFDFF; font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; transition: all .2s ease; }
.choice-row input:checked + span { background: var(--accent); border-color: var(--accent); color: #FFFFFF; }
.choice-row input:focus-visible + span { box-shadow: 0 0 0 3px rgba(10,121,232,.25); }
/* Varias opciones (tipo de PQRS): se acomodan en filas */
.choice-row--wrap { flex-wrap: wrap; }
.choice-row--wrap label { flex: 1 1 calc(33.333% - 8px); }
.choice-row--wrap span { height: 38px; padding: 0 8px; font-size: 12.5px; }
.choice .field-hint { display: block; margin-top: 6px; }

/* PQRS anónima: los datos personales se atenúan */
#p-datos, #p-autoriza { transition: opacity .25s ease; }
.is-anonymous #p-datos, .is-anonymous #p-autoriza { opacity: .45; }
.field input:disabled { cursor: not-allowed; }

/* Campos incompletos tras intentar enviar */
.was-validated input:invalid, .was-validated select:invalid, .was-validated textarea:invalid { border-color: #D6453D; box-shadow: 0 0 0 3px rgba(214,69,61,.12); }
.was-validated .choice:invalid .choice-row span { border-color: #D6453D; }
.was-validated .check input:invalid { outline: 2px solid #D6453D; outline-offset: 1px; }

@media (max-width: 640px) {
  .form { padding: 22px 20px; border-radius: 22px; gap: 12px; box-shadow: 0 16px 36px rgba(7,30,58,.07); }
  .form-grid { grid-template-columns: 1fr; gap: 12px; }
  .field label { font-size: 9px; }
  .field input { padding: 0 13px; font-size: 16px; }
  .field textarea { min-height: 84px; padding: 13px; font-size: 16px; }
  .form-submit { height: 50px; }
}
