/* ── Reset & Variables ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f0f4f8;
  --surface: #fff;
  --border: #e2e8f0;
  --primary: #1e40af;
  --primary-hover: #1d3a9e;
  --primary-light: #dbeafe;
  --accent: #0ea5e9;
  --danger: #ef4444;
  --success: #22c55e;
  --text: #0f172a;
  --text2: #475569;
  --text3: #94a3b8;
  --shadow: 0 1px 3px rgba(0,0,0,.08);
  --shadow-lg: 0 20px 60px rgba(0,0,0,.12), 0 8px 24px rgba(0,0,0,.08);
  --radius: 12px;
  --radius-sm: 8px;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Center wrap (lock / error pages) ─────────────────────────────────────── */
.sim-center-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.sim-dark-bg {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
}

/* ── Cards ─────────────────────────────────────────────────────────────────── */
.sim-card {
  background: #fff;
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
}
.sim-card-sm { padding: 40px 36px; max-width: 400px; width: 100%; }
.sim-text-center { text-align: center; }

.sim-card h2 {
  font-family: 'Sora', sans-serif;
  font-size: 22px; font-weight: 700;
  margin-bottom: 10px;
}
.sim-card p { color: var(--text2); font-size: 14px; line-height: 1.6; }

.sim-icon-wrap {
  width: 68px; height: 68px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
}
.sim-icon-wrap svg { width: 32px; height: 32px; }
.sim-icon-danger { background: #fee2e2; color: var(--danger); }

/* ── Lock page ─────────────────────────────────────────────────────────────── */
.sim-lock-card {
  background: #fff;
  border-radius: 18px;
  padding: 40px 36px;
  max-width: 400px; width: 100%;
  box-shadow: var(--shadow-lg);
}
.sim-lock-icon {
  width: 60px; height: 60px; border-radius: 14px;
  background: linear-gradient(135deg, #1e40af, #0ea5e9);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px; color: #fff;
}
.sim-lock-icon svg { width: 26px; height: 26px; }
.sim-lock-title {
  font-family: 'Sora', sans-serif;
  font-size: 20px; font-weight: 700;
  text-align: center; margin-bottom: 6px;
}
.sim-lock-sub {
  color: var(--text2); font-size: 13.5px;
  text-align: center; margin-bottom: 24px;
  line-height: 1.5;
}

/* ── Form elements ─────────────────────────────────────────────────────────── */
.sim-field { margin-bottom: 0; }
.sim-label {
  display: block;
  font-size: 13px; font-weight: 600;
  color: var(--text2); margin-bottom: 6px;
  letter-spacing: .2px;
}
.sim-label span { color: var(--danger); }
.sim-input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px; font-family: inherit;
  color: var(--text); background: #fff;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.sim-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30,64,175,.12);
}
.sim-input::placeholder { color: var(--text3); }
.sim-input.sim-error { border-color: var(--danger); }
.sim-field-error {
  font-size: 12px; color: var(--danger);
  font-weight: 500; margin-top: 4px;
  min-height: 18px;
}

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.sim-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 700; font-family: inherit;
  cursor: pointer; border: none; outline: none;
  transition: all .2s; white-space: nowrap;
}
.sim-btn-primary {
  background: linear-gradient(135deg, #1e40af, #1d4ed8);
  color: #fff;
  box-shadow: 0 2px 8px rgba(30,64,175,.35);
}
.sim-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(30,64,175,.4);
}
.sim-btn-primary:disabled { opacity: .65; cursor: not-allowed; transform: none; }
.sim-btn-full { width: 100%; justify-content: center; padding: 13px 20px; font-size: 15px; }

/* ── Student Form Page ─────────────────────────────────────────────────────── */
.sim-form-page {
  min-height: 100vh;
  background: linear-gradient(160deg, #f0f4f8 0%, #e8f0fe 100%);
  padding: 48px 20px;
}
.sim-form-inner {
  width: 100%; max-width: 620px;
  margin: 0 auto;
}
.sim-form-header { margin-bottom: 28px; }
.sim-form-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: #dbeafe; color: #1e40af;
  padding: 5px 12px; border-radius: 20px;
  font-size: 12px; font-weight: 700; letter-spacing: .3px;
  margin-bottom: 12px;
}
.sim-form-title {
  font-family: 'Sora', sans-serif;
  font-size: 28px; font-weight: 700;
  margin-bottom: 6px; color: var(--text);
}
.sim-form-sub { color: var(--text2); font-size: 14px; }

.sim-form-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.sim-form-card-head {
  background: linear-gradient(135deg, #1e40af, #1d4ed8);
  padding: 24px 28px; color: #fff;
  display: flex; align-items: center; gap: 14px;
}
.sim-form-card-icon {
  width: 46px; height: 46px; border-radius: 12px;
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sim-form-card-title {
  font-family: 'Sora', sans-serif;
  font-size: 17px; font-weight: 700;
}
.sim-form-card-sub { font-size: 13px; opacity: .75; margin-top: 2px; }

.sim-form-body { padding: 28px; }
.sim-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.sim-field-full { grid-column: 1 / -1; }
.sim-form-divider { height: 1px; background: var(--border); margin: 20px 0; }

/* ── Alert ─────────────────────────────────────────────────────────────────── */
.sim-alert {
  padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 500; margin-bottom: 16px;
}
.sim-alert-error { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }

/* ── Success view ──────────────────────────────────────────────────────────── */
.sim-success-view { text-align: center; padding: 20px 10px; }
.sim-success-icon {
  width: 64px; height: 64px; border-radius: 50%;
  background: #dcfce7; color: #16a34a;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
}
.sim-success-view h3 {
  font-family: 'Sora', sans-serif;
  font-size: 20px; font-weight: 700; margin-bottom: 8px;
}
.sim-success-view p { color: var(--text2); font-size: 14px; line-height: 1.6; }

/* ── Animations ────────────────────────────────────────────────────────────── */
@keyframes simFadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
.sim-fadeup { animation: simFadeUp .45s ease both; }

/* ── Spinner ───────────────────────────────────────────────────────────────── */
.sim-spinner-inline {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: simSpin .6s linear infinite;
  vertical-align: middle;
}
@keyframes simSpin { to { transform: rotate(360deg); } }

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 580px) {
  .sim-form-grid { grid-template-columns: 1fr; }
  .sim-form-page { padding: 28px 16px; }
  .sim-form-title { font-size: 22px; }
}
