/*
 * Colores y tipografia oficiales segun el Manual de Identidad Visual de la
 * Alcaldia de Itagui (2026):
 *   - Azul principal:  Pantone Process Blue C / #0078DC
 *   - Amarillo:        Pantone 7548 C         / #FAB900
 *   - Verde:           Pantone 347 C          / #009F47
 *   - Rojo:            Pantone 185 C          / #EE0027
 *   - Tipografia: DIN 2014 (fuente con licencia comercial, no disponible
 *     para uso libre/web). Se usa "Bahnschrift" como alternativa visual muy
 *     cercana: viene integrada en Windows 10/11 y esta inspirada en la
 *     familia DIN, sin depender de internet ni de una licencia de fuente.
 */
:root {
  --primary: #0078DC;
  --primary-dark: #005CA8;
  --accent-yellow: #FAB900;
  --accent-green: #009F47;
  --accent-red: #EE0027;
  --error: #EE0027;
  --bg: #f4f6f8;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #d1d5db;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Bahnschrift", "DIN Alternate", "Arial Narrow", Arial, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.form-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 1rem;
}

.card {
  background: #fff;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  width: 100%;
  max-width: 440px;
  /* Franja superior con los 4 colores institucionales */
  border-top: 5px solid var(--primary);
  position: relative;
}
.card::after {
  content: "";
  position: absolute;
  top: -5px;
  left: 0;
  width: 60%;
  height: 5px;
  background: linear-gradient(
    to right,
    var(--accent-yellow) 0%, var(--accent-yellow) 33%,
    var(--accent-green) 33%, var(--accent-green) 66%,
    var(--accent-red) 66%, var(--accent-red) 100%
  );
  border-top-left-radius: 12px;
}

.form-container .card { max-width: 100%; }

.brand-header {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1.5rem;
}
.brand-header img {
  height: 56px;
  width: auto;
}
.brand-header .brand-text h1 { margin: 0; font-size: 1.1rem; line-height: 1.2; }
.brand-header .brand-text .muted { margin: 0; }

h1 { font-size: 1.4rem; margin: 0 0 0.25rem; color: var(--primary-dark); font-weight: 700; }
h2 { font-size: 1rem; font-weight: 500; margin: 0 0 1rem; color: var(--text); }
.subtitle { color: var(--muted); font-size: 0.9rem; margin-bottom: 1.5rem; }
.muted { color: var(--muted); font-size: 0.85rem; }

label { display: block; font-weight: 600; margin: 1rem 0 0.35rem; font-size: 0.9rem; }

input[type="text"],
input[type="password"],
input[type="date"],
input[type="email"],
input[type="number"],
input[type="file"] {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
}
/* Campo de fecha: render nativo visible en móviles (iOS/Android) */
input[type="date"] {
  display: block;
  min-height: 2.75rem;
  line-height: 1.4;
  background-color: #fff;
  color: var(--text);
  color-scheme: light;
  -webkit-appearance: none;
  appearance: none;
}
input[type="date"]::-webkit-date-and-time-value {
  text-align: left;
  min-height: 1.4em;
  color: var(--text);
}
input[type="date"]::-webkit-datetime-edit,
input[type="date"]::-webkit-datetime-edit-fields-wrapper {
  padding: 0;
  color: var(--text);
}
input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 1;
  cursor: pointer;
}
.field-error {
  display: none;
  color: var(--error);
  font-size: 0.82rem;
  margin: 6px 0 0 0;
  line-height: 1.3;
}
.field-error.visible {
  display: block;
}
input.invalid {
  border-color: var(--error);
}

input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 120, 220, 0.15);
}

.btn-primary {
  margin-top: 1.5rem;
  width: 100%;
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 0.75rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-secondary {
  background: #fff;
  color: var(--primary);
  border: 1px solid var(--primary);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 0.5rem;
  font-family: inherit;
}

.btn-link {
  background: none;
  border: none;
  color: var(--primary);
  text-decoration: underline;
  cursor: pointer;
  font-size: 0.9rem;
  font-family: inherit;
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin: 1rem 0;
  font-size: 0.9rem;
}
.alert-error { background: #fdecea; color: var(--error); border: 1px solid #f5c6cb; }

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding: 0.5rem 0;
}

.terms-box {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  max-height: 260px;
  overflow-y: auto;
  background: #fafafa;
  font-size: 0.88rem;
  margin: 1rem 0;
}
.terms-box p { margin: 0 0 0.9rem; }

.checkbox-label, .radio-label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-weight: normal;
  font-size: 0.9rem;
  margin: 0.5rem 0;
}

.hint { font-size: 0.8rem; color: var(--muted); margin: 0.25rem 0 0; }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 560px) {
  .grid-2 { grid-template-columns: 1fr; }
}

fieldset {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-top: 1.5rem;
  padding: 1rem;
}
legend { font-weight: 600; padding: 0 0.4rem; color: var(--primary-dark); }

.tabs { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.tab-btn {
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.85rem;
  font-family: inherit;
}
.tab-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.tab-content.hidden { display: none; }

#signature-pad {
  border: 1px dashed var(--border);
  border-radius: 8px;
  width: 100%;
  height: 150px;
  touch-action: none;
  background: #fff;
}

.text-center { text-align: center; }
