/* base.css — Tokens y componentes compartidos (público y admin) */

:root {
  --black: #050608;
  --ink: #0b0e14;
  --panel: #131822;
  --panel-2: #1a2130;
  --line: #29313f;
  --blue: #1f4fff;
  --blue-dark: #1638c4;
  --blue-light: #7c9bff;
  --white: #ffffff;
  --text: #e6e9f0;
  --muted: #9aa4b8;
  --ok: #2fbf71;
  --warn: #e0a82e;
  --bad: #ef5a5f;
  --display: 'Saira Condensed', 'Arial Narrow', Impact, sans-serif;
  --body: 'Barlow', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --radius: 4px;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--ink);
  color: var(--text);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.55;
  min-height: 100vh;
}
img { display: block; max-width: 100%; }
a { color: var(--blue-light); }

h1, h2, h3 {
  font-family: var(--display);
  font-style: italic;
  font-weight: 800;
  line-height: 1.05;
  color: var(--white);
  text-transform: uppercase;
}

:focus-visible { outline: 3px solid var(--blue-light); outline-offset: 2px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 44px; padding: .6rem 1.25rem;
  font: 800 1.05rem/1 var(--display); font-style: italic; text-transform: uppercase; letter-spacing: .04em;
  text-decoration: none; color: var(--white);
  background: transparent; border: 2px solid transparent; border-radius: var(--radius);
  cursor: pointer; transition: background-color .15s, border-color .15s;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn--primary { background: var(--blue); }
.btn--primary:hover:not(:disabled) { background: var(--blue-dark); }
.btn--outline { border-color: var(--line); }
.btn--outline:hover { border-color: var(--white); }
.btn--ghost { color: var(--text); border-color: var(--line); }
.btn--ghost:hover { background: var(--panel-2); }
.btn--danger { background: var(--bad); color: var(--black); }
.btn--danger:hover:not(:disabled) { background: #ff7a7e; }
.btn--small { min-height: 36px; padding: .4rem .8rem; font-size: .95rem; }

.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center;
  background: none; border: 0; color: var(--muted); font-size: 1.6rem; line-height: 1; cursor: pointer;
  border-radius: var(--radius);
}
.icon-btn:hover { color: var(--white); background: var(--panel-2); }

/* Formularios */
.field { display: grid; gap: .4rem; margin-bottom: 1.1rem; }
.field label, .field legend { font-weight: 600; color: var(--white); font-size: .95rem; }
.field__hint { color: var(--muted); font-size: .85rem; }

input[type="text"], input[type="password"], input[type="number"], input[type="date"],
input[type="time"], input[type="url"], select {
  width: 100%; min-height: 46px; padding: .6rem .8rem;
  font: inherit; color: var(--white);
  background: var(--black); border: 1px solid var(--line); border-radius: var(--radius);
}
input:focus, select:focus { outline: none; border-color: var(--blue-light); box-shadow: 0 0 0 2px rgba(124, 155, 255, .35); }
input[type="date"], input[type="time"] { color-scheme: dark; }
input[type="file"] { color: var(--muted); font: inherit; max-width: 100%; }

fieldset.field { border: 0; padding: 0; min-width: 0; }

.choice-group { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span {
  display: grid; place-items: center; min-height: 48px; text-align: center;
  background: var(--black); border: 1px solid var(--line); border-radius: var(--radius);
  font-weight: 600; cursor: pointer;
}
.choice input:checked + span { background: var(--blue); border-color: var(--blue); color: var(--white); }
.choice input:focus-visible + span { outline: 3px solid var(--blue-light); outline-offset: 2px; }

.form-error {
  margin: 0 1.25rem 1rem; padding: .7rem .9rem; border-left: 4px solid var(--bad);
  background: rgba(239, 90, 95, .12); color: #ffb3b6; font-size: .95rem;
}
.form-error--inline { margin: 0 0 1rem; }

/* Etiquetas de estado */
.badge {
  display: inline-block; padding: .15rem .6rem; border: 1px solid var(--line); border-radius: 999px;
  font-size: .8rem; font-weight: 600; color: var(--text); white-space: nowrap;
}
.badge--programado { border-color: var(--blue-light); color: var(--blue-light); }
.badge--finalizado { border-color: var(--ok); color: var(--ok); }
.badge--aplazado { border-color: var(--warn); color: var(--warn); }
.badge--cancelado { border-color: var(--bad); color: var(--bad); }

/* Estados vacíos */
.empty {
  padding: 2rem 1.25rem; text-align: center; color: var(--muted);
  border: 1px dashed var(--line); border-radius: var(--radius);
}
.empty strong { display: block; color: var(--white); margin-bottom: .25rem; }

/* Modales */
.modal {
  width: min(520px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem);
  padding: 0; color: var(--text); background: var(--panel);
  border: 1px solid var(--line); border-top: 4px solid var(--blue); border-radius: var(--radius);
  margin: auto; overflow: auto;
}
.modal::backdrop { background: rgba(0, 0, 0, .75); }
.modal__head { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem .25rem; }
.modal__head h2 { font-size: 1.7rem; }
.modal__body { padding: 1rem 1.25rem .25rem; }
.modal__text { margin-bottom: 1rem; }
.modal__foot { display: flex; justify-content: flex-end; gap: .75rem; padding: .75rem 1.25rem 1.25rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }

/* Notificaciones */
.toasts { position: fixed; right: 1rem; bottom: 1rem; z-index: 1000; display: grid; gap: .5rem; max-width: calc(100vw - 2rem); }
.toast {
  padding: .8rem 1.1rem; background: var(--panel-2); color: var(--white);
  border: 1px solid var(--line); border-left: 5px solid var(--ok); border-radius: var(--radius);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .5); animation: toast-in .2s ease-out;
}
.toast--error { border-left-color: var(--bad); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
@media (max-width: 480px) {
  .field-row { grid-template-columns: 1fr; }
  .modal__foot { flex-direction: column-reverse; }
  .modal__foot .btn { width: 100%; }
}
