:root {
  --primary: #2e63d9;
  --primary-dark: #234fb3;
  --accent: #ffb347;
  --bg: #f4f6fb;
  --card: rgba(255, 255, 255, 0.9);
  --text: #141820;
  --muted: #5b6472;
  --border: #e3e7ef;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  margin: 0;
  padding: 0;
  background: radial-gradient(circle at 20% 20%, rgba(46, 99, 217, 0.12), transparent 25%),
              radial-gradient(circle at 80% 0%, rgba(255, 179, 71, 0.16), transparent 28%),
              var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

header {
  background: linear-gradient(120deg, #1f4c8f 0%, #2e63d9 60%, #6aa9ff 100%);
  color: #fff;
  padding: 32px 20px;
  box-shadow: 0 10px 30px rgba(32, 83, 166, 0.25);
}

.auth-body header { position: relative; overflow: hidden; }
.auth-body header::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), transparent 45%);
  pointer-events: none;
}

main { padding: 32px 20px 48px; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 8px; }

h1, h2, h3 { margin: 0 0 8px; color: inherit; }
.subtitle { margin: 8px 0 0; max-width: 640px; color: rgba(255,255,255,0.86); font-weight: 400; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-weight: 700; font-size: 12px; margin: 0 0 6px; color: rgba(255,255,255,0.8); }

.card {
  background: var(--card);
  border-radius: 16px;
  padding: 20px 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.auth-card { max-width: 520px; width: 100%; margin-left: auto; }
.glass { background: linear-gradient(160deg, rgba(255,255,255,0.82), rgba(255,255,255,0.68)); }
.highlight { border: 1px solid rgba(46, 99, 217, 0.18); }
.card-heading { margin-bottom: 12px; }

.auth-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  align-items: stretch;
}

.btn {
  padding: 12px 16px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  background: #1f4c8f;
  color: #fff;
  font-weight: 700;
  width: 100%;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  box-shadow: 0 10px 20px rgba(31, 76, 143, 0.22);
}

.btn.primary { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); }
.btn.secondary { background: #888; box-shadow: none; }
.btn.danger { background: #c62828; box-shadow: none; }
.btn.success { background: #2e7d32; box-shadow: none; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 14px 28px rgba(31, 76, 143, 0.25); }
.btn:focus-visible { outline: 3px solid rgba(46, 99, 217, 0.3); outline-offset: 2px; }

.table { width: 100%; border-collapse: collapse; border-radius: 12px; overflow: hidden; }
.table th, .table td { border: 1px solid #e6eaf2; padding: 10px; text-align: center; }
.table th { background: #f7f9fc; font-weight: 600; }

.alert { padding: 12px 14px; border-radius: 12px; margin-bottom: 12px; border: 1px solid transparent; font-weight: 600; }
.alert.success { background: #e8f5e9; color: #2e7d32; border-color: #c8e6c9; }
.alert.error { background: #ffebee; color: #c62828; border-color: #ffcdd2; }

.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.calendar .day { background: #fff; border: 1px solid #e0e0e0; border-radius: 10px; min-height: 90px; padding: 10px; position: relative; cursor: pointer; transition: transform 0.15s ease, box-shadow 0.2s ease; }
.calendar .day:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.08); }
.calendar .day .date { font-weight: 700; }
.present { background: #e8f5e9 !important; border-color: #c8e6c9; }
.absent { background: #ffebee !important; border-color: #ffcdd2; }
.planned { background: #fff8e1 !important; border-color: #ffe082; }
.excused { background: #e3f2fd !important; border-color: #90caf9; }
.legend { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0; }
.legend span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; background: #fff; border-radius: 10px; border: 1px solid #e8ebf1; }
.legend .box { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }

.modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); align-items: center; justify-content: center; padding: 20px; }
.modal.active { display: flex; }
.modal .modal-content { background: #fff; padding: 22px; border-radius: 14px; width: 420px; max-width: 100%; box-shadow: var(--shadow); }

.grid-scroll { overflow-x: auto; }

.form-group { margin-bottom: 14px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 600; color: var(--text); }
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 12px 12px;
  border: 1px solid #cfd7e3;
  border-radius: 10px;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(46, 99, 217, 0.18);
  outline: none;
}

.stack { display: flex; flex-direction: column; gap: 8px; }
.muted { color: var(--muted); margin: 0; }
.form-footer { text-align: center; color: var(--muted); font-size: 14px; margin: 12px 0 0; }
.form-footer a { color: var(--primary); font-weight: 600; }

nav a { color: #fff; margin-right: 12px; text-decoration: none; font-weight: 600; }
nav a:hover { text-decoration: underline; }

.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.status-chip { background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.25); padding: 10px 14px; border-radius: 999px; font-weight: 700; letter-spacing: 0.02em; }

.badge { display: inline-block; padding: 8px 12px; background: rgba(46,99,217,0.12); color: #1f4c8f; border-radius: 999px; font-weight: 700; margin-bottom: 10px; }
.pill-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pill { padding: 8px 10px; background: #f1f4fb; border-radius: 12px; color: #1f2a3d; font-weight: 600; border: 1px solid #e1e6f0; }

@media (max-width: 768px) {
  header { padding: 24px 16px; }
  main { padding: 24px 16px 36px; }
  .header-inner { flex-direction: column; align-items: flex-start; }
  .status-chip { align-self: flex-start; }
  .card { padding: 18px 16px; }
}

@media (max-width: 480px) {
  body { background-position: 30% 10%, 70% 0%, center; }
  .container { padding: 0 4px; }
  .btn { padding: 12px 14px; font-size: 16px; }
  .subtitle { font-size: 15px; }
}
