@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #1a2236;
  --muted: #6b7489;
  --border: #e6e9f2;
  --accent: #2f6fed;
  --accent-2: #5b8ef7;
  --green: #18a957; --green-bg: #e8f8ee;
  --red: #e4453a; --red-bg: #fdeceb;
  --amber: #e2920f; --amber-bg: #fdf3e0;
  --radius: 16px;
  --shadow: 0 2px 10px rgba(26,34,54,.06);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { background: var(--bg); }
body {
  margin: 0; font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text); font-size: 15px;
}
a { color: inherit; text-decoration: none; }
.icon { display: inline-block; vertical-align: middle; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@keyframes rise { from { opacity:0; transform: translateY(10px);} to { opacity:1; transform: translateY(0);} }

.wrap { max-width: 480px; margin: 0 auto; min-height: 100vh; padding: 0 0 90px; position: relative; }
@media (min-width: 640px) { body { display:flex; justify-content:center; } .wrap { box-shadow: 0 0 0 1px var(--border); background: var(--bg); } }

.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-card { width: 100%; max-width: 360px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 30px 26px; animation: rise .4s ease both; }
.auth-card h1 { font-size: 20px; margin: 0 0 4px; }
.auth-card p.sub { color: var(--muted); margin: 0 0 24px; font-size: 14px; }
.field { margin-bottom: 16px; }
.field label { display:block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--muted); }
.field input, .field select { width: 100%; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 12px; font-size: 16px; font-family: inherit; background:#fff; color: var(--text); }
.field input:focus, .field select:focus { outline: none; border-color: var(--accent); }
.btn { display: inline-flex; align-items:center; justify-content:center; gap:8px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color:#fff; border:none; padding: 13px 18px; border-radius: 12px; font-size: 16px; font-weight: 700; cursor: pointer; }
.btn.block { width: 100%; }
.btn.secondary { background:#fff; color: var(--text); border: 1.5px solid var(--border); }
.msg { padding: 10px 14px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; }
.msg.error { background: var(--red-bg); color: var(--red); }
.msg.ok { background: var(--green-bg); color: var(--green); }

.topline { display:flex; align-items:center; justify-content:space-between; padding: 18px 18px 6px; }
.topline .person { display:flex; align-items:center; gap:10px; }
.avatar { width:38px; height:38px; border-radius:50%; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color:#fff; display:flex; align-items:center; justify-content:center; font-weight:700; font-size:14px; flex-shrink:0; }
.iconbtn { width:38px; height:38px; border-radius:50%; background:#fff; box-shadow: var(--shadow); display:flex; align-items:center; justify-content:center; color: var(--muted); }

.section { padding: 10px 18px; }
.section h2 { font-size: 15px; margin: 18px 0 10px; color: var(--muted); font-weight:700; text-transform: uppercase; letter-spacing: .03em; }

.class-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; margin-bottom: 12px; display:flex; align-items:center; justify-content:space-between; animation: rise .3s ease both; }
.class-card .name { font-weight: 700; font-size: 16px; }
.class-card .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }

.empty { text-align:center; padding: 40px 20px; color: var(--muted); }

.roster-row { background: var(--card); border-radius: 14px; box-shadow: var(--shadow); padding: 12px 14px; margin-bottom: 10px; display:flex; align-items:center; gap: 12px; animation: rise .25s ease both; }
.roster-row .name { flex:1; font-weight: 600; }
.seg { display:flex; background: var(--bg); border-radius: 999px; padding: 3px; gap: 2px; }
.seg label { cursor: pointer; }
.seg input { display:none; }
.seg span { display:flex; align-items:center; justify-content:center; width:38px; height:34px; border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--muted); }
.seg input:checked + span.present { background: var(--green); color: #fff; }
.seg input:checked + span.absent { background: var(--red); color: #fff; }
.seg input:checked + span.late { background: var(--amber); color: #fff; }

.submit-bar { position: fixed; bottom: 0; left: 0; right: 0; background: var(--card); border-top: 1px solid var(--border); padding: 14px 18px; display:flex; justify-content:center; z-index: 10; }
.submit-bar .inner { width: 100%; max-width: 480px; }

.tabbar { position: fixed; bottom: 0; left: 0; right: 0; background: var(--card); border-top: 1px solid var(--border); display:flex; z-index: 10; padding-bottom: env(safe-area-inset-bottom); }
.tabbar a { flex:1; display:flex; flex-direction:column; align-items:center; gap:3px; padding: 10px 0; color: var(--muted); font-size: 11px; font-weight: 600; }
.tabbar a.active { color: var(--accent); }
