/* Center360 — main stylesheet */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --brand:       #D85A30;
  --brand-dark:  #993C1D;
  --teal:        #1D9E75;
  --teal-dark:   #0F6E56;
  --purple:      #7F77DD;
  --bg:          #f5f5f5;
  --surface:     #ffffff;
  --border:      rgba(0,0,0,0.1);
  --text:        #1a1a1a;
  --text-muted:  #6b7280;
  --radius:      10px;
  --radius-sm:   6px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Auth pages ─────────────────────────────────────────────── */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1rem;
}

.auth-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 0.5px solid var(--border);
  padding: 2rem 1.5rem;
  width: 100%;
  max-width: 360px;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 0.5rem;
}

.logo-icon { width: 36px; height: 36px; border-radius: 8px; }
.logo-name  { font-size: 18px; font-weight: 500; }

.auth-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 1.5rem;
}

.auth-form { display: flex; flex-direction: column; gap: 0; }

.field-group { margin-bottom: 1rem; }
.field-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 4px;
  color: var(--text);
}

.field-group input,
.field-group select,
.field-group textarea {
  width: 100%;
  padding: 9px 12px;
  border: 0.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color 0.15s;
}

.field-group input:focus,
.field-group select:focus,
.field-group textarea:focus {
  border-color: var(--teal);
}

.optional { color: var(--text-muted); font-weight: 400; }

.auth-links {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 1rem;
  font-size: 13px;
  color: var(--text-muted);
}
.auth-links a { color: var(--teal); text-decoration: none; }
.auth-note {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1rem;
}

.info-box {
  background: #f0fdf4;
  border: 0.5px solid #86efac;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 12px;
  color: #166534;
  margin-bottom: 1rem;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: 0.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: opacity 0.15s;
}
.btn:hover { opacity: 0.85; }
.btn-primary  { background: var(--teal);   color: #fff; border-color: var(--teal-dark); }
.btn-coral    { background: var(--brand);  color: #fff; border-color: var(--brand-dark); }
.btn-purple   { background: var(--purple); color: #fff; border-color: #534AB7; }
.btn-outline  { background: transparent; border-color: var(--border); }
.btn-full     { width: 100%; }

/* ── Alerts ──────────────────────────────────────────────────── */
.alert {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 1rem;
}
.alert-error   { background: #fef2f2; color: #b91c1c; border: 0.5px solid #fca5a5; }
.alert-success { background: #f0fdf4; color: #166534; border: 0.5px solid #86efac; }

/* ── Check-in page ───────────────────────────────────────────── */
.checkin-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1rem;
  background: var(--bg);
}

.checkin-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 0.5px solid var(--border);
  padding: 2.5rem 1.5rem;
  width: 100%;
  max-width: 320px;
  text-align: center;
}

.checkin-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-size: 32px;
  font-weight: 500;
}
.checkin-icon.success { background: #dcfce7; color: #16a34a; }
.checkin-icon.error   { background: #fee2e2; color: #dc2626; }

.checkin-title  { font-size: 20px; font-weight: 500; margin-bottom: 4px; }
.checkin-course { color: var(--text-muted); font-size: 14px; }
.checkin-time   { color: var(--text-muted); font-size: 13px; margin-bottom: 1.5rem; }

.credits-summary {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: left;
}
.credit-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 4px 0;
  border-bottom: 0.5px solid var(--border);
}
.credit-row:last-child { border-bottom: none; }
.credit-row span:first-child { color: var(--text-muted); }

/* ── Spinner ─────────────────────────────────────────────────── */
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Navigation (mobile bottom bar) ─────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 0.5px solid var(--border);
  display: flex;
  z-index: 100;
}
.nav-item {
  flex: 1;
  padding: 8px 4px;
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.nav-item.active { color: var(--teal); }
.nav-item svg { width: 20px; height: 20px; }

/* ── Cards + layout ──────────────────────────────────────────── */
.page-wrap  { padding: 1rem 1rem 5rem; max-width: 480px; margin: 0 auto; }
.page-title { font-size: 17px; font-weight: 500; margin-bottom: 1rem; }

.card {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
}

.metric-grid { display: grid; gap: 8px; margin-bottom: 1rem; }
.metric-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.metric-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }

.metric {
  background: #f9fafb;
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
}
.metric-val   { font-size: 22px; font-weight: 500; margin: 4px 0 0; }
.metric-label { font-size: 11px; color: var(--text-muted); }

.list-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 0;
  border-bottom: 0.5px solid var(--border);
  font-size: 13px;
}
.list-row:last-child { border-bottom: none; }

.badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 500;
}
.badge-green  { background: #dcfce7; color: #15803d; }
.badge-amber  { background: #fef3c7; color: #92400e; }
.badge-red    { background: #fee2e2; color: #b91c1c; }
.badge-purple { background: #ede9fe; color: #5b21b6; }

/* ── Manager sidebar layout ──────────────────────────────────── */
.manager-layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 200px;
  background: var(--surface);
  border-right: 0.5px solid var(--border);
  flex-shrink: 0;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar-logo {
  padding: 1rem;
  border-bottom: 0.5px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar-logo img { width: 24px; height: 24px; border-radius: 5px; }
.sidebar-logo span { font-size: 14px; font-weight: 500; }

.sidebar-nav { padding: 8px 0; }
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  transition: background 0.1s;
}
.sidebar-link:hover  { background: var(--bg); color: var(--text); }
.sidebar-link.active { background: var(--bg); color: var(--teal); font-weight: 500; }
.sidebar-link svg    { width: 16px; height: 16px; flex-shrink: 0; }

.manager-main { margin-left: 200px; padding: 1.5rem 2rem; flex: 1; }

@media (max-width: 640px) {
  .sidebar        { display: none; }
  .manager-main   { margin-left: 0; padding: 1rem; }
}

/* Center360 front door */
.first-face-page {
  min-height: 100vh;
  background: #ffffff;
}

.first-face-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
}

.first-face-link {
  display: block;
  line-height: 0;
}

.first-face-icon {
  width: min(76vw, 520px);
  height: min(76vw, 520px);
  border-radius: min(15vw, 104px);
  box-shadow: 0 28px 80px rgba(7,20,47,0.14);
}

.door-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 12%, rgba(216,90,48,0.13), transparent 30%),
    linear-gradient(135deg, #ffffff 0%, #f7faf8 42%, #eef6f4 100%);
  color: #07142f;
}

.door-shell {
  width: min(100%, 760px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  justify-content: center;
}

.door-hero {
  width: 100%;
  display: grid;
  justify-items: center;
  gap: 18px;
  text-align: center;
}

.door-poster {
  width: min(82vw, 430px);
  max-height: 72vh;
  object-fit: contain;
  border-radius: 8px;
}

.door-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.door-icon {
  width: clamp(76px, 18vw, 118px);
  height: clamp(76px, 18vw, 118px);
  border-radius: 24px;
  box-shadow: 0 18px 50px rgba(7,20,47,0.14);
}

.door-icon-main {
  width: clamp(220px, 42vw, 420px);
  height: clamp(220px, 42vw, 420px);
  border-radius: clamp(44px, 8vw, 88px);
  box-shadow: 0 24px 70px rgba(7,20,47,0.16);
}

.door-title {
  font-size: clamp(36px, 10vw, 74px);
  line-height: 0.95;
  font-weight: 750;
  letter-spacing: 0;
}

.door-byline {
  margin-top: -4px;
  font-size: clamp(14px, 3.8vw, 20px);
  color: #d85a30;
  font-weight: 650;
}

.door-banner {
  width: 100%;
  max-height: 330px;
  object-fit: contain;
  object-position: left center;
  border-radius: 8px;
}

.door-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 18px;
}

.door-enter {
  min-height: 46px;
  padding-inline: 24px;
  background: #07142f;
  border-color: #07142f;
}

.door-secondary {
  color: #0f6e56;
  font-weight: 650;
  text-decoration: none;
}

@media (max-width: 560px) {
  .door-shell {
    align-items: flex-start;
    padding-top: max(42px, env(safe-area-inset-top));
  }

  .door-brand {
    align-items: flex-start;
    flex-direction: column;
  }

  .door-icon-main {
    width: min(72vw, 320px);
    height: min(72vw, 320px);
  }

  .door-actions {
    display: grid;
    gap: 12px;
  }
}
