/* ==========================================================
   1. VARIABLES Y BASE
   ========================================================== */

:root {
  --bg: #ffffff;
  --light: #f6f8fa;

  --accent-dark: #0e2b55;
  --accent: #1c4a8d;

  --muted: #666;
  --secondary: #888;
  --border: #e3e6ea;

  --radius: 8px;
  --shadow: 0 6px 18px rgba(20, 20, 20, 0.06);



  /* ⚠️ Ojo: esta variable estaba mal cerrada */
  --accent-font: 'FlechaL', 'Accord', Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial;

  font-family: 'FlechaL', 'Accord', Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial;
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  height: 100%;
}

body {
  margin: 0;
  padding: 18px;
  background: var(--light);
  display: flex;
  justify-content: center;
}



.thx-header {
    text-align: center;
    border-bottom: solid 4px var(--accent);
    padding-bottom: 20px;
    margin-bottom: 40px;
}
.thx-header h2{margin-bottom: 5px;}

.high-risk .thx-header h2 {color: #e53935;}
.medium-risk .thx-header h2 {color: #e5e235;}
.low-risk .thx-header h2 {color: #2dba47;}


.thx-edades {
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    margin-top: 20px;
    gap: 4px;
}
.thx-edades > div {
  min-width: 130px;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    font-size: 18px;
    color: #fff;
    background: var( --accent-dark)
}
.thx-score {
    border: solid 1px var(--border);
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
}
.thx-score_title h3 {
    gap: 10px;
    padding: 0;
    margin: 0 0 10px 0;
    display: flex;
    align-content: center;
    align-items: center;
}
.thx-score_title h3 span {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 20px;
}
span.red {background-color: #e53935;}
span.yellow {background-color: #e5e235;}
span.green {background-color: #2dba47;}
.thx-score h3 {
    margin-top: 0;
}

.thx-score h4{
    color: var(--accent);
}

span.level-score {
    display: inline-block;
    width: 13px;
    height: 13px;
    border-radius: 13px;
    background-color: #ccc;
}
.high-risk span.level-score {background-color: #e53935;}
.medium-risk span.level-score {background-color: #e5e235;}
.low-risk span.level-score {background-color: #2dba47;}


/* ==========================================================
   2. LAYOUT PRINCIPAL
   ========================================================== */

main {
  width: 100%;
  max-width: 760px;
  background: var(--bg);
  /*overflow: hidden;*/
}

#header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.hidden {
  display: none;
}
span.spacer-xs {    display: block;    margin-top:20px;}
span.spacer-s {    display: block;    margin-top: 40px;}
span.spacer-m {    display: block;    margin-top: 60px;}
span.spacer-l {    display: block;    margin-top: 80px;}
span.spacer-xl {    display: block;    margin-top: 100px;}
span.spacer-xxl {    display: block;    margin-top: 120px;}

/* ==========================================================
   3. PROGRESS BAR
   ========================================================== */

#progressWrap {
  flex: 1;
}

#progressBar {
  height: 10px;
  background: #eee;
  border-radius: 999px;
  overflow: hidden;
}

#progressFill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #2db5ff);
}


/* ==========================================================
   4. CONTENIDO / STEPS
   ========================================================== */

#formContainer {
  padding: 20px;
}

.form-step {
  display: none;
}

.form-step.active {
  display: block;
}
#qr-container {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}


/* ==========================================================
   5. TIPOGRAFÍA
   ========================================================== */

h1,
h2 {
  margin: 0 0 32px;
  font-size: 20px;
  font-family: var(--accent-font);
  color: var(--accent);
  text-align: center;
}

p {
  margin: 0 0 12px;
  color: var(--muted);
}

p.subtitle {
  margin-bottom: 0;
  font-size: 12px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--secondary);
}


/* ==========================================================
   6. BOTONES
   ========================================================== */

.btn {
  flex: 1;
  padding: 24px 14px;
  font-size: larger;
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  background: var(--accent);
  color: #fff;
}

.btn.secondary {
  background: #f2f4f6;
  color: var(--muted);
}

.btn-icon {
  background: transparent;
  border: 0;
  font-size: 20px;
  padding: 6px 8px;
  cursor: pointer;
}

.controls {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 16px;
}


/* ==========================================================
   7. OPTIONS / SINGLE & NUMBER
   ========================================================== */

.options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.options-inline {
  flex-direction: row;
  flex-wrap: wrap;
}

.options-number {
  display: flex;
  justify-content: space-between;
}

.option-btn {
  display: block;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.options-inline button.option-btn {
    flex: 1 1 auto;
    font-size: larger;
    padding: 24px;
}

.option-btn .title {
  font-weight: 600;
  font-size: 16px;
}

.option-btn .desc {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
}


/* Estados */

.option-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.option-btn:hover .desc {
  color: #fff;
}

.option-btn.selected {
  background: #eaf3ff;
  border-color: var(--accent);
}

.option-btn.selected:hover {
  background: var(--accent);
  border-color: #fff;
}

.option-btn.selected .title {
  color: var(--accent);
}

.option-btn.selected:hover .title {
  color: #fff;
}


/* ==========================================================
   8. FORMULARIOS
   ========================================================== */

.form-step form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.birthdate-selects {
    display: flex;
}
.input-container {
  position: relative;
  width: 100%;
  padding-bottom: 14px;
}
.input-container.container-number-unit
 {
    width: 256px;
    margin: auto;
}


/* Rows específicas */
.input-container.row-name,
.input-container.row-location {
  flex: 1 1;
  min-width: 160px;
}
.input-tel {
    display: flex;
    /* align-items: stretch; */
}
.input-tel .prefij{
  background: #f0f0f0;
  border-bottom: 1px solid var(--accent-dark);
    padding: 6px 0px 0 4px;
    vertical-align: middle;
    font-size: 19px;
}
label {
  font-size: 13px;
  color: var(--muted);
}

input,
select {
  appearance: none;
  width: 100%;
  height: 44px;
  padding: 12px 15px;
  font-size: 16px;
  font-family: Accord, Arial, sans-serif;

  background: #f0f0f0;
  border: none;
  border-bottom: 1px solid var(--accent-dark);
  outline: none;

  transition: border-color 0.3s ease;
}

input[type="checkbox"]{
  width: 10px;
    height: 10px;
    display: block;
    padding: 0;
  border: var(--border) solid 1px;}
input[type="checkbox"]:checked{background-color: var(--accent);}

.input-date-picker input, .input-date-picker label{display: block; width: 100%; appearance: none;}

.unit-display{
  display: block;
  padding: 12px 15px;
  font-size: 16px;
  font-family: Accord, Arial, sans-serif;
height: 44px;
  background: #f0f0f0;
  border: none;
  border-bottom: 1px solid var(--accent-dark);
  outline: none;
}
/* Error */

.input-error {
  border-bottom-color: #e53935;
  background-color: #f0e5e5;
}
.input-container.input-error input.input-error {
  border-color: #e53935;
  background-color: #f0e5e5;
}
.input-container.input-error input.input-error:checked {
  
  background-color: var(--accent);
}
.input-container.input-error label, .input-container.input-error label a {
  color: #e53935;
}

.error-msg {
  position: absolute;
  bottom: 0;
  left: 0;
  font-size: 10px;
  color: #e53935;
}


/* ==========================================================
   9. UNIT TOGGLE
   ========================================================== */

.unit-toggle {
  display: flex;
  justify-content: center;
}

.unit-toggle button {
  padding: 14px 44px;
  font-size: larger;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
}

.unit-toggle button:first-child {
  border-radius: 8px 0 0 8px;
}

.unit-toggle button:last-child {
  border-radius: 0 8px 8px 0;
}

.unit-toggle button.active {
  background: var(--accent);
  color: #fff;
}


/* ==========================================================
   10. MULTI
   ========================================================== */

.multi-list {
  max-height: 160px;
  padding: 8px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.multi-item {
  padding: 8px;
  margin-bottom: 8px;
  border-radius: 6px;
  cursor: pointer;
}

.multi-item.selected {
  background: #e6f4ff;
  border: 1px solid #bfe4ff;
}


/* ==========================================================
   11. MODAL / LEGALES
   ========================================================== */

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9999;
}

.modal.hidden {
  display: none;
}

.modal-inner {
  width: 100%;
  max-width: 980px;
  max-height: 100vh;
  padding: 20px;
  overflow: auto;
  background: #fff;
  border-radius: 10px;
}

.btn-close {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 22px;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.legal-content {
  color: #222;
}

.checkbox-row {
  display: flex;
  gap: 8px;
  margin: 12px 0;
}

.checkbox-row label {
  display: flex;
  gap: 8px;
}


/* ==========================================================
   12. RESPONSIVE
   ========================================================== */

@media (max-width: 520px) {
  main {
    border-radius: 0;
  }

  .modal-inner {
    height: 100vh;
    border-radius: 0;
  }
}
