/* =======================
   Reset & Base
   ======================= */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell,
               "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  color: #0f172a; /* slate-900 */
  background: #f8fafc; /* slate-50 */
  line-height: 1.5;
}
img, svg { max-width: 100%; display: block; }
:where(a, button, input, select, textarea):focus {
  outline: 3px solid #2563eb; /* blue-600 */
  outline-offset: 2px;
}

/* =======================
   Hero (pantallas login/signup)
   ======================= */
.hero {
  background: radial-gradient(1000px 300px at 20% -50%, #334155 0, transparent 60%),
              linear-gradient(180deg, #0f172a 0%, #111827 100%);
  color: #fff;
  padding: 48px 16px;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.hero .intro h1 {
  margin: 0 0 8px;
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: .3px;
}
.hero .intro .subtitle {
  margin: 0;
  color: #cbd5e1; /* slate-300 */
  font-size: clamp(14px, 2.5vw, 16px);
}

/* =======================
   Layout contenedor (login/signup)
   ======================= */
.container { max-width: 880px; margin: 0 auto; padding: 20px 16px; }
.login-section {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 24px;
  margin-top: -24px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(15,23,42,.06);
}
.login-section h2 { margin: 0 0 12px; font-size: 22px; }

/* =======================
   Formulario
   ======================= */
.login-form { display: grid; gap: 12px; margin-top: 8px; }
.login-form input[type="text"],
.login-form input[type="email"],
.login-form input[type="password"],
.login-form input[type="date"],
.login-form select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #fff;
  color: #0f172a;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.login-form input::placeholder { color: #94a3b8; }
.login-form input:hover,
.login-form select:hover { border-color: #94a3b8; }
.login-form input:focus,
.login-form select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .15);
}

/* Botón principal */
.login-form button[type="submit"], button.primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 16px; border: 0; border-radius: 12px;
  background: #0f172a; color: #fff; cursor: pointer; font-weight: 600;
  transition: transform .04s, filter .15s, box-shadow .15s;
  box-shadow: 0 6px 16px rgba(15, 23, 42, .15);
}
.login-form button[type="submit"]:hover { filter: brightness(1.06); }
.login-form button[type="submit"]:active { transform: translateY(1px); }

/* Botón/enlace secundario */
a.btn-secondary, .btn-secondary {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: 10px; color: #0f172a;
  background: #e2e8f0; text-decoration: none; border: 1px solid #cbd5e1;
  transition: background .15s, border-color .15s, transform .04s;
}
a.btn-secondary:hover { background: #cbd5e1; }
a.btn-secondary:active { transform: translateY(1px); }

/* Alertas */
.alert { border-radius: 12px; padding: 12px 14px; font-size: 0.95rem; }
.alert.error { background: #fee2e2; border: 1px solid #fecaca; color: #7f1d1d; }
.alert.success { background: #dcfce7; border: 1px solid #bbf7d0; color: #14532d; }

/* Utilidades */
.text-center { text-align: center; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }

/* Responsive */
@media (min-width: 640px) { .login-section { padding: 28px; } .login-form { gap: 14px; } }
@media (min-width: 920px) { .container { padding: 28px 16px; } .login-section { margin-top: -32px; } }

/* =======================
   Mathclass · Index (dashboard tipo tarjetas)
   ======================= */
:root {
  --header-h: 64px;
  --radius: 14px;
  --brand: #0f172a;
  --accent: #f97316;   /* naranja (títulos) */
  --accent2: #7c3aed;  /* violeta (botón +) */
}

.app { margin: 0; background:#f3f4f6; color:#0f172a; }

/* Header del index */
.app-header {
  height: var(--header-h);
  display:flex; align-items:center; justify-content:space-between;
  padding: 0 16px; background: var(--brand); color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.app-header .brand { font-weight: 700; letter-spacing: .2px; }
.app-header .user-chip { display: flex; align-items: center; gap: .75rem; }
.app-header .logout {
  color: #fff; text-decoration: none; padding: .35rem .7rem;
  border: 1px solid rgba(255,255,255,.25); border-radius: 999px;
}
.app-header .logout:hover { background: rgba(255,255,255,.08); }

/* Lienzo y rejilla */
.dash-canvas {
  height: calc(100vh - var(--header-h));
  padding: 24px 16px;
  overflow: auto;
  background: #f3f4f6;
}
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  align-content: start;
  min-height: 100%;
}

/* Tarjetas (estilo “burbujas-panel”) */
.card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  box-shadow: 0 2px 4px rgba(0,0,0,.04), 0 16px 28px rgba(15,23,42,.06);
  padding: 18px 18px 16px;
  display: flex;
  flex-direction: column;
  min-height: 180px;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.card-header h3 { margin: 0; font-size: 20px; font-weight: 700; color: var(--accent); }
.card-action {
  width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px; text-decoration: none; font-size: 22px; line-height: 1;
  color: #fff; background: var(--accent2);
  box-shadow: 0 6px 18px rgba(124,58,237,.28);
}
.card-action:hover { filter: brightness(1.08); }
.card-body { margin-top: 6px; }
.card-body .muted { margin: .2rem 0 .6rem; color: #6b7280; }

/* Chips (pills) */
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  display: inline-flex; align-items: center; padding: 6px 10px;
  background: #f59e0b22; color: #9a3412; border: 1px solid #f59e0b55;
  border-radius: 999px; font-size: .92rem;
}
.pill-all { background: #111827; color: #fff; border-color: #111827; }
