/* app/estilos/controles.css — desplegables, calendario y horas propios (app/controles.js) */

/* El control nativo se queda en la página (valor, formularios) pero no se ve */
.ctl-nativo {
  position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: 0 !important;
  opacity: 0 !important; pointer-events: none !important; overflow: hidden !important; clip-path: inset(50%) !important; border: 0 !important;
}

/* Botón que sustituye al control: hereda las clases y el estilo del original; esto es solo el aspecto por defecto */
:where(.ctl) {
  min-height: 36px; padding: 7px 12px; border: 1px solid var(--line-2); border-radius: 12px;
  background: var(--glass-2); color: inherit; font-size: 14px; max-width: 100%;
}
.ctl.ctl { display: inline-flex; align-items: center; gap: 8px; text-align: left; cursor: pointer; min-width: 0; font-family: inherit; }
.ctl:disabled { cursor: not-allowed; opacity: 0.55; }
.ctl:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.ctl__txt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctl.is-vacio .ctl__txt { opacity: 0.6; }
.ctl i { display: inline-flex; flex: none; font-style: normal; }
.ctl i .ico { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ctl__ico { opacity: 0.65; }
.ctl__flecha { margin-left: auto; opacity: 0.6; transition: transform 0.25s var(--ease); transform: rotate(90deg); }
.ctl[aria-expanded="true"] .ctl__flecha { transform: rotate(-90deg); }
.field .ctl { width: 100%; min-height: 44px; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--glass-2); font-size: 16px; }
.field .ctl[aria-expanded="true"] { border-color: var(--text); }

/* Ventana de cristal (capa superior: también por encima de los modales) */
.ctl-pop {
  position: fixed; inset: auto; margin: 0; padding: 6px; overflow: visible;
  color: var(--text); font-family: var(--font);
  background: color-mix(in srgb, var(--float) 80%, transparent);
  -webkit-backdrop-filter: blur(24px) saturate(1.4); backdrop-filter: blur(24px) saturate(1.4);
  border: 1px solid var(--line-2); border-radius: 20px; box-shadow: var(--shadow-pop);
}
.ctl-pop .ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Lista (desplegables y horas) */
.ctl-pop--list { max-width: min(420px, 100vw - 24px); }
.ctl-list { display: grid; gap: 2px; max-height: min(340px, 60vh); overflow: auto; scrollbar-width: thin; }
.ctl-pop--horas { min-width: 140px !important; }
.ctl-group { padding: 12px 12px 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.ctl-opt {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 12px;
  text-align: left; font-size: 13.5px; font-weight: 600; color: var(--text); background: none; border: 0; cursor: pointer;
}
.ctl-opt--sub { padding-left: 22px; }
.ctl-opt:hover, .ctl-opt:focus-visible { background: var(--well); outline: none; }
.ctl-opt[aria-selected="true"] { background: var(--well); font-weight: 700; }
.ctl-opt:disabled { opacity: 0.4; cursor: default; }
.ctl-tick { margin-left: auto; display: inline-flex; color: #f06a5d; }

/* Calendario */
.ctl-pop--cal { width: 360px; max-width: calc(100vw - 24px); padding: 20px; border-radius: 24px; }
.cal__top { display: flex; align-items: center; justify-content: space-between; }
.cal__tabs { display: flex; gap: 4px; padding: 4px; border-radius: 10px; background: var(--well); }
.cal__tabs button { padding: 4px 16px; border-radius: 7px; font-size: 12px; font-weight: 600; color: var(--muted); transition: color 0.2s, background 0.2s; }
.cal__tabs button:hover { color: var(--text); }
.cal__tabs button[aria-selected="true"] { background: var(--text); color: var(--bg); font-weight: 700; box-shadow: 0 2px 8px #0000002e; }
.cal__hoy, .cal__borrar { padding: 7px 12px; border-radius: 10px; font-size: 12px; font-weight: 700; color: var(--text); background: var(--well); transition: background 0.2s; }
.cal__hoy:hover, .cal__borrar:hover { background: var(--line-2); }
.cal__head { display: flex; align-items: center; justify-content: space-between; margin: 24px 0; }
.cal__mes { margin: 0; font-size: 34px; font-weight: 700; letter-spacing: -0.02em; line-height: 1; text-transform: capitalize; }
.cal__mes small { font-size: 14px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.cal__nav { display: flex; gap: 8px; }
.cal__nav button { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: var(--muted); transition: background 0.2s, color 0.2s; }
.cal__nav button:hover { background: var(--well); color: var(--text); }
.cal__tira { display: flex; gap: 16px; overflow-x: auto; margin: 0 -20px; padding: 2px 20px 6px; scrollbar-width: none; }
.cal__tira::-webkit-scrollbar { display: none; }
.cal__col { display: flex; flex-direction: column; align-items: center; gap: 8px; flex-shrink: 0; }
.cal__col span, .cal__grid span { font-size: 12px; font-weight: 700; color: var(--faint); }
.cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px 4px; justify-items: center; }
.cal__dia {
  position: relative; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  font-size: 14px; font-weight: 600; color: var(--text); transition: background 0.2s, transform 0.2s;
}
.cal__dia:hover:not(:disabled) { background: var(--well); }
.cal__dia:focus-visible { outline: 2px solid var(--text); outline-offset: 1px; }
.cal__dia.is-sel { background: linear-gradient(135deg, #ec4899, #fb923c); color: #fff; box-shadow: 0 8px 18px -6px #ec489999; }
.cal__dia.is-hoy:not(.is-sel)::after { content: ''; position: absolute; bottom: 3px; width: 4px; height: 4px; border-radius: 50%; background: #f472b6; }
.cal__dia:disabled { opacity: 0.3; cursor: default; }
.cal__pie { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.cal__elegida { font-size: 13px; font-weight: 600; color: var(--muted); }

@media (prefers-reduced-motion: reduce) { .ctl__flecha, .cal__dia { transition: none; } }

/* Casillas y opciones: también propias (las .check del original ya lo son) */
input[type="checkbox"]:not(.check), input[type="radio"] {
  appearance: none; -webkit-appearance: none; flex: none; display: inline-grid; place-items: center;
  width: 18px; height: 18px; margin: 0; vertical-align: middle; cursor: pointer;
  border: 1.5px solid color-mix(in srgb, currentColor 38%, transparent); border-radius: 6px; background: transparent;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
input[type="radio"] { border-radius: 50%; }
input[type="checkbox"]:not(.check):active, input[type="radio"]:active { transform: scale(0.9); }
input[type="checkbox"]:not(.check):checked, input[type="radio"]:checked { background: linear-gradient(135deg, #ec4899, #fb923c); border-color: transparent; }
input[type="checkbox"]:not(.check):checked::after { content: ''; width: 9px; height: 4.5px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg) translate(1px, -1px); }
input[type="radio"]:checked::after { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #fff; }
input[type="checkbox"]:not(.check):focus-visible, input[type="radio"]:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
input[type="checkbox"]:disabled, input[type="radio"]:disabled { opacity: 0.45; cursor: not-allowed; }

/* Barras deslizantes (p. ej. «Atenuar» del fondo): propias, no las del navegador */
input[type="range"] { -webkit-appearance: none; appearance: none; height: 6px; border-radius: 999px; background: var(--line-2); cursor: pointer; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: linear-gradient(135deg, var(--fucsia, #ec4899), var(--ambar, #fb923c)); border: 2px solid #fff; box-shadow: 0 2px 8px #0000004d; }
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: linear-gradient(135deg, var(--fucsia, #ec4899), var(--ambar, #fb923c)); border: 2px solid #fff; }
input[type="range"]:focus-visible { outline: 2px solid var(--text); outline-offset: 4px; }
