/* BŞEÜ Yoklama — ortak stil (bseu.edu.tr ve Ortak Giriş Sistemi görünümü) */

:root {
  --bordo: #A6192E;
  --bordo-dark: #85121F;
  --lacivert: #0F3A6B;
  --lacivert-dark: #0B2C52;
  --turuncu: #F7941D;
  --turuncu-dark: #DD7F0E;
  --mavi: #1677FF;
  --mavi-dark: #0F5FD6;
  --bg: #EEF1F3;
  --surface: #FFFFFF;
  --text: #1F2933;
  --muted: #6B7785;
  --border: #D9DEE3;
  --border-soft: #EDF0F2;
  --success: #1E8E3E;
  --success-bg: #E8F5EC;
  --error-bg: #FBEBED;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(15, 58, 107, .06), 0 4px 16px rgba(15, 58, 107, .06);
  --font: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
}

h1, h2, h3, h4 { margin: 0 0 12px; line-height: 1.25; font-weight: 800; }
h2 { font-size: 20px; }
h3 { font-size: 17px; color: var(--lacivert); }
h4 { font-size: 15px; }
p { margin: 0 0 12px; }

a { color: var(--mavi); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Header ---------- */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--bordo);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
}
.header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand img { width: 56px; height: 56px; flex-shrink: 0; }
.brand-title {
  color: var(--bordo);
  font-weight: 800;
  font-size: 20px;
  line-height: 1.15;
}
.brand-sub { display: block; color: var(--muted); font-size: 13px; font-weight: 600; }

.header-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; }
.user-name { font-weight: 700; color: var(--lacivert); }
.logout { font-weight: 700; color: var(--bordo); }

/* ---------- Main ---------- */

.page {
  flex: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}
.page-narrow { max-width: 480px; }
.page-title { color: var(--lacivert); margin-bottom: 16px; }

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}

/* ---------- Form ---------- */

label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 12px;
}
input, select {
  display: block;
  width: 100%;
  margin: 6px 0 12px;
  padding: 11px 12px;
  font: inherit;
  font-size: 16px; /* iOS zoom'u engeller */
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: border-color .15s, box-shadow .15s;
}
label input, label select { margin-bottom: 0; }
input[type="checkbox"] { display: inline-block; width: 18px; height: 18px; margin: 0; padding: 0; accent-color: var(--lacivert); }
details > summary { cursor: pointer; font-weight: 700; margin: 8px 0; }
input::placeholder { color: #A3ACB6; }
input:focus, select:focus {
  outline: none;
  border-color: var(--mavi);
  box-shadow: 0 0 0 3px rgba(22, 119, 255, .15);
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }

/* ---------- Buttons ---------- */

button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  font: inherit;
  font-weight: 700;
  font-size: 16px;
  color: #fff;
  background: var(--mavi);
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color .15s, border-color .15s;
}
button:hover { background: var(--mavi-dark); }
button:focus-visible { outline: 3px solid rgba(22, 119, 255, .35); outline-offset: 2px; }

.btn-secondary { background: var(--turuncu); }
.btn-secondary:hover { background: var(--turuncu-dark); }
.btn-outline { background: var(--surface); color: var(--bordo); border-color: var(--bordo); }
.btn-outline:hover { background: var(--error-bg); }
.btn-small { padding: 7px 12px; font-size: 14px; }
.btn-block { width: 100%; }

.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
  color: var(--muted);
  font-size: 14px;
}
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border-soft); }

/* ---------- Messages ---------- */

#msg, .msg-box {
  margin: 0 0 16px;
  padding: 10px 14px;
  border-radius: 6px;
  border-left: 4px solid var(--bordo);
  background: var(--error-bg);
  color: var(--bordo-dark);
  font-weight: 600;
  white-space: pre-wrap;
}
#msg:empty, .msg-box:empty { display: none; }
#msg.ok, .msg-box.ok { border-left-color: var(--success); background: var(--success-bg); color: var(--success); }
#msg.err { border-left-color: var(--bordo); background: var(--error-bg); color: var(--bordo-dark); }

/* ---------- Tables ---------- */

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; margin-bottom: 16px; font-size: 15px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border-soft); }
th {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  background: #F7F9FA;
}

.bound, .unbound {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.bound { color: var(--success); }
.unbound { color: var(--bordo); }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--lacivert);
  border-top: 3px solid var(--turuncu);
  color: rgba(255, 255, 255, .85);
  font-size: 14px;
}
.footer-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 18px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 24px;
}
.footer-brand { display: flex; align-items: center; gap: 10px; }
.footer-brand strong { color: #fff; letter-spacing: .03em; }

/* ---------- Giriş sayfası (Ortak Giriş Sistemi) ---------- */

.auth-page { justify-content: center; align-items: center; padding: 32px 16px; }
.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.auth-head {
  padding: 22px 24px 18px;
  text-align: center;
  border-bottom: 1px solid var(--border-soft);
}
.auth-head img { width: 88px; height: 88px; margin-bottom: 10px; }
.auth-head h1 {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text);
}
.auth-head p { margin: 0; color: var(--muted); font-weight: 600; }
.auth-body { padding: 22px 24px 24px; }
.auth-body #msg, .auth-body .msg-box { margin: 16px 0 0; }
.link-row { margin: 10px 0 0; text-align: center; font-size: 14px; }
.btn-link {
  padding: 0;
  background: none;
  color: var(--mavi);
  font-size: 14px;
  font-weight: 600;
}
.btn-link:hover { background: none; text-decoration: underline; }
.btn-link:disabled { color: var(--muted); cursor: default; text-decoration: none; }
#verifyStep { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border-soft); }
.auth-foot { margin-top: 16px; color: var(--muted); font-size: 14px; text-align: center; }

/* ---------- Öğrenci ---------- */

.greeting { font-size: 18px; color: var(--lacivert); }
.hint { color: var(--muted); font-size: 15px; }
#reader { width: 100%; border-radius: var(--radius); overflow: hidden; }
#reader:not(:empty) { margin: 4px 0 16px; border: 1px solid var(--border); }
#reader video { width: 100% !important; height: auto !important; display: block; }

/* ---------- Hoca ---------- */

#active { display: none; border-top: 4px solid var(--turuncu); }
#endInfo { font-size: 18px; font-weight: 700; color: var(--lacivert); }
#roster h4 { color: var(--bordo); margin-top: 8px; }

/* ---------- Projeksiyon ---------- */

.projection { height: 100vh; overflow: hidden; }
.projection .header-inner { max-width: none; padding: 10px 24px; }
.projection .brand img { width: 48px; height: 48px; }
#sessionTimer {
  font-size: 22px;
  font-weight: 800;
  color: var(--lacivert);
  font-variant-numeric: tabular-nums;
}
#listToggle { font-size: 16px; }
.proj-main {
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
}
.proj-qr {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: var(--surface);
  text-align: center;
}
#heading { font-size: 28px; color: var(--bordo); margin-bottom: 8px; }
#qr { background: #fff; line-height: 0; }
#qr img { display: block; background: #fff; filter: none; }
#qrTimer {
  margin: 14px 0 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
#ended { font-size: 40px; font-weight: 800; color: var(--bordo); }

.proj-list {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(560px, 90vw);
  padding: 24px;
  overflow-y: auto;
  background: var(--bg);
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.15);
}
.proj-list[hidden] { display: none; }
.proj-list h2 { font-size: 22px; color: var(--lacivert); }
#count { color: var(--bordo); }
.proj-list table { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); font-size: 17px; }

.projection .footer-inner { max-width: none; padding: 10px 24px; }
#status { font-weight: 700; color: #fff; }

/* ---------- Admin ---------- */

.page-wide { max-width: 1080px; }
.header-meta { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }

.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 2px solid var(--border);
  overflow-x: auto;
}
.tabs button {
  flex-shrink: 0;
  background: none;
  color: var(--muted);
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  margin-bottom: -2px;
  padding: 10px 14px;
}
.tabs button:hover { background: none; color: var(--lacivert); }
.tabs button[aria-selected="true"] { color: var(--bordo); border-bottom-color: var(--bordo); }

.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.inline-form input, .inline-form select { flex: 1 1 180px; width: auto; margin: 0; }
.inline-form button { flex-shrink: 0; }

.actions { display: flex; flex-wrap: wrap; gap: 6px; }
.btn-ghost { background: var(--surface); color: var(--lacivert); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg); }
.btn-small.btn-ghost, .btn-small.btn-outline { padding: 5px 10px; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  background: var(--bg);
  color: var(--muted);
  white-space: nowrap;
}
.badge.on { background: var(--success-bg); color: var(--success); }
.badge.off { background: var(--error-bg); color: var(--bordo); }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 2px 4px 2px 0;
  padding: 2px 4px 2px 10px;
  border-radius: 999px;
  background: #E8EEF6;
  color: var(--lacivert);
  font-size: 13px;
  font-weight: 700;
}
.chip button { padding: 0 6px; font-size: 14px; line-height: 1.4; background: none; color: var(--muted); }
.chip button:hover { background: none; color: var(--bordo); }

.secret-box {
  margin: 0 0 16px;
  padding: 14px 16px;
  border: 2px dashed var(--turuncu);
  border-radius: var(--radius);
  background: #FFF7EC;
}
.secret-box code {
  display: block;
  margin: 6px 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: .08em;
  color: var(--lacivert);
}
.muted { color: var(--muted); font-size: 14px; }
.empty { color: var(--muted); padding: 12px 0; }
td.nowrap { white-space: nowrap; }
tr.fail td { background: #FFF5F6; }

/* ---------- Mobil ---------- */

@media (max-width: 860px) {
  .projection { height: auto; overflow: visible; }
  .proj-list { position: fixed; top: auto; height: 60vh; width: 100vw; }
}

@media (max-width: 560px) {
  .brand img { width: 44px; height: 44px; }
  .brand-title { font-size: 17px; }
  .card { padding: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .btn-row button { flex: 1 1 auto; }
  .page { padding-top: 16px; }
  #heading { font-size: 26px; }
}

.browser-note { color: var(--muted); font-size: 13px; line-height: 1.4; margin: 12px 0 0; }
.delay-slow { opacity: 0.45; }
.countdown { font-weight: 700; font-size: 18px; text-align: center; margin: 8px 0 12px; font-variant-numeric: tabular-nums; }
.pending-note { color: var(--muted); font-size: 15px; margin-top: 8px; }
.attempt-summary { margin: 12px 0; }
.stat-row { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 8px; }
.stat { display: flex; flex-direction: column; min-width: 90px; }
.stat strong { font-size: 22px; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 13px; }

.zoom { display: flex; align-items: center; gap: 10px; margin: 10px 0; font-weight: 700; color: var(--lacivert); }
.zoom[hidden] { display: none; }
.zoom input { flex: 1; }
