:root{
  --primary-color: #0b5394;
  --accent-color: #f39c12;
  --text-color: #222;
  --muted: #666;
  --card-bg: #ffffff;
  --page-bg: #f4f7fb;
  --max-width: 920px;
  --radius: 10px;
  --shadow: 0 8px 28px rgba(14,30,37,0.10);
  --gap: 20px;
  font-size: 16px;
}

/* Botones principales y secundarios (panel admin) */
.mdl-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  color: #fff;
  background: #0b5394; /* azul oscuro coherente con gráfico */
  box-shadow: 0 4px 10px rgba(11,83,148,0.14);
  transition: transform .08s ease, box-shadow .12s ease, opacity .08s;
}

/* Variantes */
.mdl-button--accent {
  background: linear-gradient(180deg,#f39c12,#d87f07);
  color: #fff;
  border-color: rgba(0,0,0,0.06);
}
.mdl-button--secondary {
  background: #f4f7fb;
  color: #0b3b66;
  border-color: #e6eef8;
  box-shadow: none;
}

/* Icon buttons (download) */
.mdl-button--icon {
  padding: 6px 10px;
  background: transparent;
  color: #0b5394;
  border: 1px solid transparent;
  box-shadow: none;
}

/* Reset button */
.mdl-button[type="reset"], .mdl-button.reset {
  background: transparent;
  color: #6b7785;
  border: 1px solid #e6eef8;
  box-shadow: none;
}

/* Disabled / loading state */
.mdl-button[disabled], .mdl-button.disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Hover / focus */
.mdl-button:hover:not([disabled]) {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(11,83,148,0.12);
}
.mdl-button:focus {
  outline: 3px solid rgba(11,83,148,0.12);
  outline-offset: 2px;
}

/* Small text helper for buttons */
.mdl-button .btn-label {
  display:inline-block;
  vertical-align:middle;
}

/* Make file input and buttons align nicely */
input[type="file"] {
  display: inline-block;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #e6eef8;
  background: #fff;
}

/* Actions container spacing */
.actions { display:flex; gap:10px; align-items:center; }

/* Ensure anchor links styled as buttons look consistent */
a.mdl-button { display:inline-flex; }

/* Mobile adjustments */
@media (max-width:520px){
  .mdl-button { padding:10px 12px; font-size:0.92rem; }
  .actions { flex-direction:column; align-items:stretch; gap:8px; }
}
/* Reset y base */
*{box-sizing:border-box}
html,body{height:100%;margin:0;font-family:"Roboto", "Helvetica", Arial, sans-serif;color:var(--text-color);background:var(--page-bg);-webkit-font-smoothing:antialiased}
a{color:var(--primary-color);text-decoration:none}
img{max-width:100%;height:auto;display:block}

/* Contenedor principal */
.mdl-layout__content{
  display:block;
  max-width: calc(var(--max-width) + 40px);
  margin:0 auto;
  padding:0;
  background: transparent;
}

/* Wrapper centrado (se usa desde inline style como fallback) */
.center-wrapper{
  min-height: 100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 22px;
}

/* Card principal */
.page-card{
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  overflow: hidden;
  width: 100%;
  max-width: 720px;
}

/* Header: logo + titulo */
.header-row{
  display:flex;
  align-items:center;
  gap:16px;
  margin-bottom:12px;
}

/* --- Ajuste del logo: ahora responsivo y contenido ---
   Uso clamp() para que el logo tenga mínimo, tamaño preferido relativo y máximo.
   Además, se fuerza un max-height para evitar que estire el contenedor. */
.header-row img{
  width: clamp(56px, 10vw, 88px); /* mínimo 56px, ideal 10vw, máximo 88px */
  height: auto;
  max-height: 92px; /* evita que en pantallas muy altas quede gigante */
  border-radius:6px;
  box-shadow: 0 6px 18px rgba(11,83,148,0.06);
  flex: 0 0 auto;
  object-fit: contain;
}
.header-row h2{
  margin:0;
  font-size:24px;
  font-weight:500;
  color:var(--primary-color);
  letter-spacing:0.2px;
  line-height:1.1;
}

/* Subtexto */
.lead{
  color:var(--muted);
  margin:8px 0 18px 0;
  line-height:1.45;
}

/* Formulario */
.form-row{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  align-items:center;
  margin-top:8px;
}
.mdl-textfield{
  flex:1 1 280px;
  min-width:180px;
}
.mdl-textfield__input{
  font-size:16px;
  padding:12px 14px;
  border:1px solid #e1e6ef;
  border-radius:8px;
  outline:none;
  transition:box-shadow .15s, border-color .15s;
  background: #fff;
}
.mdl-textfield__input:focus{
  border-color: var(--primary-color);
  box-shadow: 0 6px 20px rgba(11,83,148,0.06);
}
.mdl-textfield__label{
  color:#999;
  margin-left:4px;
}

/* Botón principal */
.mdl-button--accent{
 /* --btn-bg: var(--accent-color); */
  background: linear-gradient(180deg, var(--btn-bg), #e08808);
  color:#fff;
  border: none;
 /* padding: 12px 18px;*/
  border-radius: 8px;
  box-shadow: 0 10px 26px rgba(243,156,18,0.12);
  cursor: pointer;
  font-weight:600;
  transition:transform .12s ease, box-shadow .12s ease, opacity .12s;
}
.mdl-button--accent:hover{ transform: translateY(-3px); opacity:0.98 }

/* Mensaje de resultado (cuando no hay beca o cuando hay) */
.result-card{
  margin-top:18px;
  background: linear-gradient(180deg,#fff,#fbfdff);
  border-radius:6px;
  padding:18px;
  border:1px solid #eef3fb;
}
.result-card p{margin:8px 0;color:#2a2a2a}
.result-card .small{color:var(--muted);font-size:0.95rem}

/* Highlight de la UF */
#becaUF{
  display:inline-block;
  background: linear-gradient(90deg, #fff7e8, #fffaf3);
  padding:6px 10px;
  border-radius:6px;
  border:1px solid rgba(243,156,18,0.14);
  color:var(--primary-color);
  font-weight:700;
  margin-left:6px;
}

/* Tooltip simple */
.mdl-tooltip{
  display:inline-block;
  margin-top:12px;
  font-size:0.95rem;
  color:var(--muted);
}

/* Footer / admin note */
.admin-note{ margin-top:16px;color:var(--muted);font-size:0.95rem }

/* Texto estilo "texto" */
texto, .texto{
  display:block;
  margin-top:18px;
  margin-bottom:18px;
  margin-right:10px;
  margin-left:10px;
  line-height:1.55;
  color: #222;
}

/* Responsive tweaks */
@media (max-width:920px){
  .page-card{padding:22px}
  .header-row h2{font-size:22px}
}
@media (max-width:720px){
  .header-row{gap:12px}
  .header-row img{width: clamp(48px, 12vw, 72px); max-height:72px;} /* más pequeño en pantallas pequeñas */
  .mdl-textfield{flex-basis:100%}
  .form-row{flex-direction:column;align-items:stretch}
  .mdl-button--accent{width:100%}
  .page-card{padding:18px}
}
@media (max-width:420px){
  .header-row img{width:64px}
  .header-row h2{font-size:18px}
}

/* Utilities */
.text-center{text-align:center}
.muted{color:var(--muted)}
.bold{font-weight:600}

/* Loading overlay */
.loading-overlay{
  position: fixed;
  inset: 0;
  display: none; /* se muestra con JS */
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.36);
  z-index: 9999;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

/* Caja blanca con el spinner y texto */
.loading-box{
  background: rgba(255,255,255,0.98);
  padding: 18px 22px;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.18);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-width: 220px;
}

/* Spinner */
.loader{
  width: 56px;
  height: 56px;
  border: 6px solid rgba(0,0,0,0.08);
  border-top-color: var(--accent-color, #f39c12);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Texto de carga */
.loading-text{
  font-weight: 600;
  color: var(--primary-color, #0b5394);
  font-size: 1rem;
  text-align: center;
}

/* Animación */
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Asegurar comportamiento en móviles */
@media (max-width: 420px){
  .loading-box { min-width: 160px; padding: 14px; }
  .loader { width: 44px; height: 44px; border-width: 5px; }
  .loading-text { font-size: 0.95rem; }
}