/* ── Portal del Alumno FFIS — Estilos compartidos ──
   Colores de la identidad FFIS (azul #004679 y carmesí #CD003B), los mismos
   que catalogo.css. Todos los textos cumplen un contraste mínimo de 4,5:1. */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --azul:      #004679;
  --azul-med:  #004679;
  --azul-hover:#1f6f9d;
  --azul-light:#eaf1f6;
  --verde:     #22c55e;
  --rojo:      #ef4444;
  --naranja:   #f59e0b;
  --gris:      #5b6270;
  --gris-light:#f1f5f9;
  --border:    #e2e8f0;
  --text:      #1e293b;
  --text-sub:  #5b6270;
  --radius:    4px;
  --shadow:    none;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #eef2f6;
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.5;
}

/* ── Header ── */
.p-header {
  background: var(--azul);
  color: #fff;
  padding: 0 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.p-header-inner {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 54px;
}
.p-header-title { font-size: 15px; font-weight: 700; flex: 1; }
.p-header-user  { font-size: 13px; color: #93c5fd; }
.p-header a     { color: #93c5fd; text-decoration: none; font-size: 13px; white-space: nowrap; }
.p-header a:hover { color: #fff; }
.p-header-sep   { color: #374151; }
/* Logo FFIS en la cabecera de registro y confirmación, sobre una pastilla blanca, enlazado al catálogo. */
.p-header-logo {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 4px;
  padding: 4px 8px;
  flex-shrink: 0;
}
.p-header-logo img { display: block; height: 24px; width: auto; }

/* ── Main content ── */
.p-main {
  max-width: 860px;
  margin: 0 auto;
  padding: 16px;
}

/* ── Cards ── */
.p-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}
.p-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--azul);
  margin-bottom: 16px;
}

/* ── Forms ── */
.p-form-group { margin-bottom: 14px; }
.p-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 5px;
}
.p-input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: 4px;
  font-size: 14px;
  color: var(--text);
  background: #fff;
  transition: border-color .2s;
  outline: none;
  -webkit-appearance: none;
}
.p-input:focus { border-color: var(--azul-med); box-shadow: 0 0 0 3px rgba(0,70,121,.18); }
.p-input::placeholder { color: #6b7280; }

/* Foco visible con teclado en enlaces y botones */
a:focus-visible, button:focus-visible, summary:focus-visible, [role="button"]:focus-visible {
  outline: 3px solid var(--azul-hover);
  outline-offset: 2px;
}

/* ── Buttons ── */
.p-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 20px;
  background: var(--azul-med);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background .2s;
  width: 100%;
}
.p-btn:hover { background: var(--azul-hover); }
.p-btn-sec {
  background: var(--gris-light);
  color: var(--gris);
}
.p-btn-sec:hover { background: var(--border); }
.p-btn-sm {
  width: auto;
  padding: 8px 16px;
  font-size: 13px;
}

/* ── Alerts ── */
.p-alert {
  padding: 12px 14px;
  border-radius: 4px;
  font-size: 13px;
  margin-bottom: 14px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.p-alert-error  { background: #fef2f2; border: 1px solid #fca5a5; color: #dc2626; }
.p-alert-ok     { background: #f0fdf4; border: 1px solid #86efac; color: #166534; }
.p-alert-info   { background: var(--azul-light); border: 1px solid #bfdbfe; color: #1e40af; }
.p-alert-warn   { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }

/* ── Badges ── */
.p-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

/* ── Curso card ── */
.p-curso {
  background: #fff;
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--border);
}
.p-curso.apto       { border-left-color: var(--verde); }
.p-curso.noapto     { border-left-color: var(--rojo); }
.p-curso.matriculado{ border-left-color: var(--azul-med); }
.p-curso.inscrito   { border-left-color: var(--naranja); }
.p-curso-nombre {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.4;
}
.p-curso-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.p-curso-estados {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

/* ── Info rows ── */
.p-info-row {
  display: flex;
  flex-direction: column;
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
  gap: 2px;
}
.p-info-row:last-child { border-bottom: none; }
.p-info-label { color: var(--text-sub); font-size: 13px; font-weight: 600; }
.p-info-value { color: var(--text); font-weight: 500; }

/* ── Section title ── */
.p-section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin: 20px 0 8px;
}

/* ── Login page ── */
.p-login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: #eef2f6;
}
.p-login-card {
  background: #fff;
  border-radius: 4px;
  padding: 32px 24px;
  width: 100%;
  max-width: 400px;
  border: 1px solid #e5e7eb;
}
.p-login-logo { text-align: center; margin-bottom: 24px; }
.p-login-title { font-size: 20px; font-weight: 700; color: var(--azul); margin-top: 10px; }
.p-login-sub   { font-size: 13px; color: var(--text-sub); margin-top: 4px; }

/* ── Headers de rol ── */
.p-rol-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

/* ── Responsive (tablet/desktop) ── */
@media (min-width: 600px) {
  .p-main { padding: 24px 20px; }
  .p-card { padding: 24px; }
  .p-info-row { flex-direction: row; gap: 0; }
  .p-info-label { width: 160px; flex-shrink: 0; font-size: 13px; text-transform: none; letter-spacing: 0; }
  .p-btn { width: auto; }
  .p-curso-nombre { font-size: 15px; }
  .p-rol-header { font-size: 15px; gap: 10px; }
}
@media (min-width: 900px) {
  .p-header-inner { height: 58px; }
  .p-main { padding: 28px 0; }
}
