/* =====================================================================
   Career Assessment System - NWSSU San Jorge Campus
   Clean, minimal white/green UI (Devin-inspired)
   ===================================================================== */
:root {
  --green-900: #0f5132;
  --green-700: #177a4c;
  --green-600: #1e9e63;
  --green-500: #22b573;
  --green-100: #e7f5ee;
  --green-50:  #f2faf6;
  --ink:       #1c2b24;
  --muted:     #667a70;
  --line:      #e3ede7;
  --bg:        #f7faf8;
  --white:     #ffffff;
  --danger:    #c0392b;
  --shadow:    0 1px 2px rgba(16,40,28,.06), 0 8px 24px rgba(16,40,28,.06);
  --radius:    14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--green-700); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Layout ---------- */
.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 720px; margin: 0 auto; padding: 0 20px; }

/* ---------- Top bar ---------- */
.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 40;
}
.topbar .inner {
  display: flex; align-items: center; gap: 14px;
  height: 66px; max-width: 1080px; margin: 0 auto; padding: 0 20px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand img, .brand .logo-fallback { width: 42px; height: 42px; border-radius: 50%; object-fit: contain; }
.logo-fallback {
  display: grid; place-items: center; font-weight: 800; color: #fff;
  background: radial-gradient(circle at 30% 30%, var(--green-500), var(--green-900));
  font-size: 13px;
}
.brand .title { font-weight: 700; font-size: 15px; line-height: 1.15; }
.brand .sub { font-size: 12px; color: var(--muted); }
.topbar .spacer { flex: 1; }
.topbar nav a { margin-left: 18px; font-size: 14px; color: var(--muted); font-weight: 500; }
.topbar nav a:hover { color: var(--green-700); text-decoration: none; }

/* ---------- Hero ---------- */
.hero { padding: 64px 0 28px; }
.hero .eyebrow {
  display: inline-block; background: var(--green-100); color: var(--green-700);
  font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 999px; letter-spacing: .3px;
}
.hero h1 { font-size: 40px; line-height: 1.1; margin: 18px 0 10px; letter-spacing: -.5px; }
.hero p.lead { font-size: 17px; color: var(--muted); max-width: 640px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  border: 1px solid transparent; border-radius: 10px; padding: 11px 18px;
  font-size: 14px; font-weight: 600; cursor: pointer; transition: .15s ease;
  background: var(--green-600); color: #fff;
}
.btn:hover { background: var(--green-700); text-decoration: none; }
.btn.secondary { background: var(--white); color: var(--green-700); border-color: var(--line); }
.btn.secondary:hover { border-color: var(--green-500); background: var(--green-50); }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.danger { background: var(--danger); }
.btn.block { width: 100%; }
.btn.lg { padding: 14px 24px; font-size: 15px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- Cards ---------- */
.card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px;
}
.card + .card { margin-top: 18px; }
.card h2 { margin: 0 0 4px; font-size: 20px; }
.card .card-sub { color: var(--muted); font-size: 14px; margin-bottom: 18px; }

.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 760px){ .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; } }

/* ---------- Feature cards ---------- */
.feature { padding: 22px; }
.feature .ic {
  width: 40px; height: 40px; border-radius: 10px; background: var(--green-100);
  display: grid; place-items: center; color: var(--green-700); font-size: 20px; margin-bottom: 12px;
}
.feature h3 { margin: 0 0 6px; font-size: 16px; }
.feature p { margin: 0; color: var(--muted); font-size: 14px; }

/* ---------- Forms ---------- */
.form-row { margin-bottom: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 620px){ .form-grid { grid-template-columns: 1fr; } }
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--ink); }
label .opt { color: var(--muted); font-weight: 400; }
input[type=text], input[type=email], input[type=tel], input[type=number],
input[type=password], select, textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 14px; font-family: inherit; background: var(--white); color: var(--ink); transition: .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--green-500); box-shadow: 0 0 0 3px rgba(34,181,115,.15);
}
textarea { resize: vertical; min-height: 90px; }
.help { font-size: 12px; color: var(--muted); margin-top: 5px; }

/* ---------- Alerts ---------- */
.alert { padding: 12px 16px; border-radius: 10px; font-size: 14px; margin-bottom: 16px; border: 1px solid; }
.alert.error { background: #fdeceb; border-color: #f5c6c2; color: #a5281c; }
.alert.success { background: var(--green-50); border-color: #bfe6d1; color: var(--green-700); }
.alert.info { background: #eef4ff; border-color: #cfe0ff; color: #274690; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); }
th { background: var(--green-50); font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fbfdfc; }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.green { background: var(--green-100); color: var(--green-700); }
.badge.gray { background: #eef1ef; color: var(--muted); }
.badge.blue { background: #e7effd; color: #274690; }

/* ---------- Footer ---------- */
.footer { text-align: center; color: var(--muted); font-size: 13px; padding: 40px 0 30px; }

/* ---------- Admin shell (light sidebar) ---------- */
.admin-layout { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar { background: var(--white); color: var(--ink); border-right: 1px solid var(--line); padding: 20px 14px;
  position: sticky; top: 0; align-self: start; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; }
.sidebar .brand { padding: 0 6px; }
.sidebar .brand .title { color: var(--ink); }
.sidebar .brand .sub { color: var(--muted); }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sidebar nav .nav-section.signout-section { margin-top: auto; }
.nav-section { margin-top: 22px; }
.nav-label {
  font-size: 11px; letter-spacing: .7px; text-transform: uppercase; color: #9aa8a0;
  font-weight: 700; padding: 0 12px; margin-bottom: 6px;
}
.sidebar nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 9px;
  color: #46564e; font-size: 14px; font-weight: 500;
}
.sidebar nav a svg { width: 18px; height: 18px; flex: none; stroke-width: 2; }
.sidebar nav a:hover { background: var(--green-50); text-decoration: none; color: var(--green-700); }
.sidebar nav a.active { background: var(--green-100); color: var(--green-700); font-weight: 600; }
.sidebar nav a.signout { color: #b64a3f; }
.sidebar nav a.signout:hover { background: #fdeceb; color: #a5281c; }

.admin-main { padding: 22px 32px 40px; background: var(--bg); }
.admin-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px;
  padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.admin-head h1 { font-size: 22px; margin: 0; }
.admin-head .user { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--green-600); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 14px; }
@media (max-width: 820px){ .admin-layout { grid-template-columns: 1fr; } .sidebar { display: none; } }

/* ---------- Stat cards (icon tile) ---------- */
.stat { padding: 20px; }
.stat .stat-ic { width: 44px; height: 44px; border-radius: 12px; background: var(--green-100);
  color: var(--green-700); display: grid; place-items: center; margin-bottom: 14px; }
.stat .stat-ic svg { width: 22px; height: 22px; stroke-width: 2; }
.stat .num { font-size: 30px; font-weight: 800; color: var(--green-700); line-height: 1.1; }
.stat .lbl { color: var(--muted); font-size: 13px; margin-top: 2px; }

/* ---------- Exam ---------- */
.exam-topbar {
  position: fixed; top: 0; left: 0; right: 0; height: 60px; background: var(--white);
  border-bottom: 1px solid var(--line); display: flex; align-items: center; z-index: 50;
}
.exam-topbar .inner { display: flex; align-items: center; width: 100%; max-width: 900px; margin: 0 auto; padding: 0 20px; gap: 14px; }
.timer { font-weight: 700; font-variant-numeric: tabular-nums; background: var(--green-100); color: var(--green-700); padding: 8px 14px; border-radius: 10px; }
.timer.warning { background: #fdeceb; color: var(--danger); }
.exam-body { max-width: 820px; margin: 88px auto 60px; padding: 0 20px; }
.progress-track { height: 6px; background: var(--green-100); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--green-500); width: 0; transition: width .3s; }

.question-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px; margin-bottom: 18px; }
.question-card .qno { color: var(--green-600); font-weight: 700; font-size: 13px; }
.question-card .qtext { font-size: 18px; font-weight: 600; margin: 4px 0 16px; }
.question-card img.q-img { max-width: 100%; border-radius: 10px; margin-bottom: 16px; border: 1px solid var(--line); }
.choice {
  display: flex; align-items: center; gap: 12px; padding: 13px 16px; border: 1px solid var(--line);
  border-radius: 11px; margin-bottom: 10px; cursor: pointer; transition: .12s;
}
.choice:hover { border-color: var(--green-500); background: var(--green-50); }
.choice input { width: 18px; height: 18px; accent-color: var(--green-600); }
.choice.selected { border-color: var(--green-600); background: var(--green-50); }

.warning-flash {
  position: fixed; inset: 0; background: rgba(192,57,43,.96); color: #fff; z-index: 999;
  display: none; align-items: center; justify-content: center; flex-direction: column; text-align: center; padding: 30px;
}
.warning-flash h1 { font-size: 30px; }

/* ---------- Result ---------- */
.ref-box { background: var(--green-900); color: #fff; border-radius: var(--radius); padding: 26px; text-align: center; }
.ref-box .lbl { font-size: 13px; color: #9dccb4; letter-spacing: .5px; text-transform: uppercase; }
.ref-box .ref { font-size: 34px; font-weight: 800; letter-spacing: 2px; }
.course-item { display: flex; gap: 16px; align-items: flex-start; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; margin-bottom: 12px; }
.course-item .rank { width: 40px; height: 40px; border-radius: 10px; background: var(--green-600); color: #fff; display: grid; place-items: center; font-weight: 800; flex: none; }
.course-item.top .rank { background: var(--green-900); }
.course-item h3 { margin: 0 0 3px; font-size: 16px; }
.course-item .code { color: var(--muted); font-size: 13px; }
.course-item p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }

/* ---------- Auth / Login ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-hero {
  position: relative; overflow: hidden; color: #eafaf1; padding: 54px 48px;
  background: radial-gradient(1200px 500px at -10% -10%, var(--green-600), transparent 60%),
              linear-gradient(160deg, var(--green-900) 0%, #0b3f27 60%, #093521 100%);
  display: flex; flex-direction: column; justify-content: space-between;
}
.auth-hero::after {
  content: ""; position: absolute; right: -120px; bottom: -120px; width: 340px; height: 340px;
  border-radius: 50%; background: rgba(255,255,255,.05);
}
.auth-hero .hero-top { display: flex; align-items: center; gap: 14px; }
.auth-hero .hero-logo { width: 54px; height: 54px; border-radius: 50%; background: #fff; padding: 4px; object-fit: contain; }
.auth-hero .hero-logo-fallback { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255,255,255,.15); color: #fff; font-weight: 800; }
.auth-hero .hero-uni { font-weight: 700; font-size: 15px; line-height: 1.2; }
.auth-hero .hero-uni small { display: block; font-weight: 400; color: #9dccb4; font-size: 12px; margin-top: 2px; }
.auth-hero h1 { font-size: 34px; line-height: 1.15; margin: 0 0 12px; letter-spacing: -.5px; position: relative; z-index: 1; }
.auth-hero p.tag { color: #b9dcc9; font-size: 15px; max-width: 420px; position: relative; z-index: 1; }
.auth-hero .hero-list { list-style: none; padding: 0; margin: 22px 0 0; position: relative; z-index: 1; }
.auth-hero .hero-list li { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 14px; color: #daf0e6; }
.auth-hero .hero-list .tick { width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,.16);
  display: grid; place-items: center; font-size: 12px; flex: none; }
.auth-hero .hero-foot { color: #7fb79a; font-size: 12px; position: relative; z-index: 1; }

.auth-form-side { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--bg); }
.auth-card { width: 100%; max-width: 380px; }
.auth-card .auth-badge { width: 52px; height: 52px; border-radius: 14px; background: var(--green-100);
  color: var(--green-700); display: grid; place-items: center; margin-bottom: 16px; }
.auth-card .auth-badge svg { width: 26px; height: 26px; stroke-width: 2; }
.auth-card h2 { font-size: 24px; margin: 0 0 4px; }
.auth-card .auth-sub { color: var(--muted); font-size: 14px; margin-bottom: 24px; }
.input-icon { position: relative; }
.input-icon svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px;
  stroke-width: 2; color: #9aa8a0; pointer-events: none; }
.input-icon input { padding-left: 40px; }
.input-icon .toggle-pass { position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; color: #9aa8a0; padding: 4px; display: grid; place-items: center; }
.input-icon .toggle-pass svg { position: static; transform: none; width: 18px; height: 18px; }
.auth-hint { text-align: center; margin-top: 18px; font-size: 13px; color: var(--muted); }
.auth-hint code { background: var(--green-50); border: 1px solid var(--line); padding: 2px 7px; border-radius: 6px; color: var(--green-700); }
@media (max-width: 860px){ .auth-wrap { grid-template-columns: 1fr; } .auth-hero { display: none; } }

/* ---------- Modal (post-registration popup) ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15,40,28,.55); z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fadeIn .2s ease;
}
.modal-box {
  background: #fff; border-radius: 18px; padding: 34px 30px; max-width: 440px; width: 100%;
  text-align: center; box-shadow: 0 20px 60px rgba(16,40,28,.25); animation: popIn .25s ease;
}
.modal-box h2 { margin: 8px 0 2px; font-size: 22px; }
.modal-check {
  width: 64px; height: 64px; margin: 0 auto; border-radius: 50%;
  background: var(--green-100); color: var(--green-600);
  display: grid; place-items: center; font-size: 34px; font-weight: 700;
}
.modal-ref {
  background: var(--green-900); color: #fff; border-radius: 12px; padding: 12px;
  font-size: 24px; font-weight: 800; letter-spacing: 2px; margin: 12px 0;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { transform: scale(.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.print-only { display: none; }
@media print {
  .no-print { display: none !important; }
  .print-only { display: block; }
  body { background: #fff; }
}