/* ============================================================
   Solicitudes de Baja Cursos CEF — Sistema de diseño (base.css)
   Color corporativo: #004d35
   Estilos compartidos por el formulario público y el panel admin.
   ============================================================ */

:root {
  /* --- Marca --- */
  --brand: #004d35;          /* Verde corporativo CEF */
  --brand-700: #00402c;
  --brand-800: #003322;
  --brand-600: #015c40;
  --brand-300: #4f9b82;
  --brand-100: #d7e7e1;
  --brand-050: #eef5f2;
  --brand-tint: #f5f9f7;

  /* --- Acento (uso muy puntual, dorado sobrio) --- */
  --accent: #c8a24b;
  --accent-100: #f4ecd6;

  /* --- Neutros --- */
  --ink: #14211c;            /* Texto principal */
  --ink-soft: #43534d;       /* Texto secundario */
  --muted: #6b7a74;          /* Texto terciario / placeholders */
  --line: #e2e8e5;           /* Bordes */
  --line-soft: #eef2f0;
  --surface: #ffffff;
  --surface-2: #f7faf9;
  --bg: #f1f5f3;

  /* --- Estado --- */
  --success: #1f7a4d;
  --success-bg: #e5f3ec;
  --danger: #b3261e;
  --danger-bg: #fbeae9;
  --warning: #9a6b00;
  --warning-bg: #fbf2dd;
  --info: #1b5e8a;
  --info-bg: #e6f0f6;

  /* --- Formas --- */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-pill: 999px;

  /* --- Sombras --- */
  --shadow-xs: 0 1px 2px rgba(16, 33, 28, .06);
  --shadow-sm: 0 2px 8px rgba(16, 33, 28, .08);
  --shadow-md: 0 8px 28px rgba(16, 33, 28, .12);
  --shadow-lg: 0 20px 50px rgba(16, 33, 28, .18);

  /* --- Tipografía --- */
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --fs-xs: .78rem;
  --fs-sm: .875rem;
  --fs-md: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.4rem;
  --fs-2xl: 1.85rem;

  --space: 16px;
  --container: 1180px;
  --transition: 180ms cubic-bezier(.4, 0, .2, 1);
}

/* ---------- Reset suave ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-md);
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.2; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
a { color: var(--brand-600); text-underline-offset: 2px; }
img, svg { max-width: 100%; display: block; }
button { font-family: inherit; }

/* ---------- Utilidades ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: clamp(16px, 4vw, 28px); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.hidden { display: none !important; }
.text-muted { color: var(--muted); }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-sm { gap: 8px; }

/* ---------- Marca / Logo ---------- */
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.brand__mark {
  width: 40px; height: 40px; border-radius: 11px; flex: 0 0 auto;
  background: linear-gradient(150deg, var(--brand-600), var(--brand-800));
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: .95rem;
  box-shadow: var(--shadow-sm); letter-spacing: .02em;
}
.brand__name { font-weight: 700; font-size: 1.02rem; line-height: 1.1; }
.brand__sub { display: block; font-size: var(--fs-xs); color: var(--muted); font-weight: 500; }

/* ---------- Botones ---------- */
.btn {
  --btn-bg: var(--brand);
  --btn-fg: #fff;
  appearance: none; border: 1px solid transparent; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: var(--radius-pill);
  font-size: var(--fs-sm); font-weight: 600; line-height: 1;
  background: var(--btn-bg); color: var(--btn-fg);
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  text-decoration: none; white-space: nowrap;
}
.btn:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 3px solid var(--brand-100); outline-offset: 2px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn--primary { --btn-bg: var(--brand); }
.btn--primary:hover { --btn-bg: var(--brand-700); }
.btn--ghost { --btn-bg: transparent; --btn-fg: var(--brand-700); border-color: var(--line); }
.btn--ghost:hover { --btn-bg: var(--brand-050); }
.btn--subtle { --btn-bg: var(--brand-050); --btn-fg: var(--brand-700); }
.btn--subtle:hover { --btn-bg: var(--brand-100); }
.btn--danger { --btn-bg: var(--danger); }
.btn--block { width: 100%; }
.btn--lg { padding: 14px 26px; font-size: var(--fs-md); }
.btn--sm { padding: 8px 14px; font-size: var(--fs-xs); }

/* ---------- Campos de formulario ---------- */
.field { margin-bottom: 18px; }
.field__label { display: block; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-soft); margin-bottom: 7px; }
.field__label .req { color: var(--danger); margin-left: 2px; }
.field__hint { font-size: var(--fs-xs); color: var(--muted); margin-top: 6px; }
.field__error { font-size: var(--fs-xs); color: var(--danger); margin-top: 6px; display: none; }
.field.is-invalid .field__error { display: block; }

.input, .select, .textarea {
  width: 100%; font: inherit; font-size: var(--fs-sm); color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--line);
  border-radius: var(--radius-sm); padding: 11px 13px;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
.input::placeholder, .textarea::placeholder { color: var(--muted); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--brand-300); }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-050);
}
.field.is-invalid .input,
.field.is-invalid .select,
.field.is-invalid .textarea { border-color: var(--danger); box-shadow: 0 0 0 4px var(--danger-bg); }
.textarea { resize: vertical; min-height: 96px; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7a74' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 38px; }

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

/* ---------- Chips de estado ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px;
  border-radius: var(--radius-pill); font-size: var(--fs-xs); font-weight: 600;
  background: var(--brand-050); color: var(--brand-700);
}
.chip--success { background: var(--success-bg); color: var(--success); }
.chip--danger { background: var(--danger-bg); color: var(--danger); }
.chip--warning { background: var(--warning-bg); color: var(--warning); }
.chip--info { background: var(--info-bg); color: var(--info); }
.chip--muted { background: var(--line-soft); color: var(--ink-soft); }

/* ---------- Tarjeta ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-xs);
}

/* ---------- Modal ---------- */
.modal {
  position: fixed; inset: 0; z-index: 80; display: grid; place-items: center;
  padding: 20px; background: rgba(16, 33, 28, .5); backdrop-filter: blur(3px);
  opacity: 0; visibility: hidden; transition: opacity var(--transition), visibility var(--transition);
}
.modal.is-open { opacity: 1; visibility: visible; }
.modal__dialog {
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 460px; padding: 30px 28px; text-align: center;
  transform: translateY(12px) scale(.98); transition: transform var(--transition);
}
.modal.is-open .modal__dialog { transform: none; }
.modal__icon {
  width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 18px;
  display: grid; place-items: center;
}
.modal__icon--success { background: var(--success-bg); color: var(--success); }
.modal__icon--error { background: var(--danger-bg); color: var(--danger); }
.modal__title { font-size: var(--fs-xl); }
.modal__text { color: var(--ink-soft); margin-bottom: 22px; }
.modal--wide .modal__dialog { max-width: 620px; text-align: left; }

/* ---------- Toast ---------- */
.toast-stack { position: fixed; bottom: 22px; right: 22px; z-index: 90; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--ink); color: #fff; padding: 12px 16px; border-radius: var(--radius);
  box-shadow: var(--shadow-md); font-size: var(--fs-sm); max-width: 340px;
  display: flex; align-items: center; gap: 10px; animation: toast-in var(--transition);
}
.toast--success { background: var(--success); }
.toast--error { background: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Spinner ---------- */
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, .35); border-top-color: #fff;
  animation: spin .7s linear infinite; display: inline-block;
}
.spinner--brand { border-color: var(--brand-100); border-top-color: var(--brand); }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
