/* ================================================
   FaceAttend — Shared Styles
   ================================================ */

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

:root {
  --bg:       #08090f;
  --bg1:      #0f1018;
  --bg2:      #141520;
  --card:     #111220;
  --border:   rgba(255,255,255,0.07);
  --border2:  rgba(99,102,241,0.35);
  --primary:  #6366f1;
  --primary2: #818cf8;
  --green:    #00e676;
  --red:      #ff1744;
  --yellow:   #ffd740;
  --text:     #f0f0f8;
  --text2:    #9090b0;
  --text3:    #555570;
  --glow:     0 0 20px rgba(99,102,241,0.25);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", sans-serif;
  min-height: 100vh;
  line-height: 1.6;
}

/* ─── Shared Nav ─────────────────────────────── */

.landing-nav {
  padding: 1.2rem 3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(8,9,15,0.92);
  backdrop-filter: blur(12px);
  z-index: 100;
}

.landing-logo {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--text);
}

.landing-logo span { color: var(--primary2); }

.landing-nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.landing-nav-links a {
  color: var(--text2);
  text-decoration: none;
  font-size: 0.88rem;
  transition: color 0.2s ease;
}

.landing-nav-links a:hover { color: var(--text); }

/* ─── Buttons ─────────────────────────────────── */

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  border: none;
  padding: 0.65rem 1.4rem;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  font-family: "Inter", sans-serif;
}

.btn-primary:hover {
  background: var(--primary2);
  box-shadow: var(--glow);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--text2);
  border: 1px solid var(--border2);
  padding: 0.65rem 1.4rem;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  font-family: "Inter", sans-serif;
}

.btn-outline:hover {
  border-color: var(--primary2);
  color: var(--text);
}

.btn-large { padding: 0.85rem 2rem; font-size: 0.95rem; }

.btn-danger {
  background: rgba(255,23,68,0.15);
  color: var(--red);
  border: 1px solid rgba(255,23,68,0.3);
}

.btn-danger:hover { background: rgba(255,23,68,0.25); }

.btn-success {
  background: rgba(0,230,118,0.15);
  color: var(--green);
  border: 1px solid rgba(0,230,118,0.3);
}

/* ─── Landing Hero ───────────────────────────── */

.landing-hero {
  text-align: center;
  padding: 6rem 2rem 5rem;
  max-width: 900px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-block;
  background: rgba(99,102,241,0.12);
  border: 1px solid rgba(99,102,241,0.3);
  color: var(--primary2);
  padding: 0.35rem 1rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  margin-bottom: 1.5rem;
}

.landing-hero h1 {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2.2rem, 6vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 1.2rem;
}

.highlight { color: var(--primary2); }

.landing-hero p {
  font-size: 1.1rem;
  color: var(--text2);
  max-width: 600px;
  margin: 0 auto 2.5rem;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 4rem;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
  flex-wrap: wrap;
  padding-top: 3rem;
  border-top: 1px solid var(--border);
}

.stat-num {
  font-family: "Space Grotesk", sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary2);
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text3);
  letter-spacing: 0.05em;
  margin-top: 0.2rem;
}

/* ─── Features ───────────────────────────────── */

.features-section {
  padding: 5rem 2rem;
  max-width: 1100px;
  margin: 0 auto;
}

.features-section h2 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 3rem;
  letter-spacing: -0.02em;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.2rem;
}

.feature-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.8rem;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.feature-card:hover {
  border-color: var(--border2);
  transform: translateY(-3px);
}

.feature-icon {
  color: var(--primary2);
  margin-bottom: 1rem;
}

.feature-card h3 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.feature-card p {
  font-size: 0.85rem;
  color: var(--text2);
  line-height: 1.65;
}

/* ─── CTA Section ─────────────────────────────── */

.cta-section {
  text-align: center;
  padding: 5rem 2rem;
  background: linear-gradient(135deg, rgba(99,102,241,0.06), transparent);
  border-top: 1px solid var(--border);
}

.cta-section h2 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.8rem;
}

.cta-section p {
  color: var(--text2);
  margin-bottom: 2rem;
}

/* ─── Footer ─────────────────────────────────── */

.landing-footer {
  padding: 2rem 3rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.landing-footer p { font-size: 0.82rem; color: var(--text3); }

/* ─── App Pages Shared Layout ─────────────────── */

.app-nav {
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid var(--border);
  background: rgba(8,9,15,0.95);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.app-nav a {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.app-nav a span { color: var(--primary2); }

.app-nav-links {
  display: flex;
  gap: 0.75rem;
  margin-left: auto;
  flex-wrap: wrap;
}

.app-nav-links a {
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--text2);
  text-decoration: none;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.app-nav-links a:hover,
.app-nav-links a.active {
  background: rgba(99,102,241,0.12);
  color: var(--primary2);
}

.app-body { padding: 2rem; max-width: 1200px; margin: 0 auto; }

/* ─── Cards ───────────────────────────────────── */

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
}

.card-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 1.2rem;
  color: var(--text);
}

.section-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
}

/* ─── Forms ───────────────────────────────────── */

.form-group { margin-bottom: 1.2rem; }

.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text2);
  margin-bottom: 0.4rem;
  letter-spacing: 0.03em;
}

.form-input {
  width: 100%;
  background: var(--bg1);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.7rem 1rem;
  border-radius: 8px;
  font-family: "Inter", sans-serif;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.form-input:focus { border-color: var(--primary); }

.form-select {
  width: 100%;
  background: var(--bg1);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.7rem 1rem;
  border-radius: 8px;
  font-family: "Inter", sans-serif;
  font-size: 0.9rem;
  outline: none;
  cursor: pointer;
}

/* ─── Status badges ───────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.7rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.badge-green  { background: rgba(0,230,118,0.12);  color: var(--green);  border: 1px solid rgba(0,230,118,0.25); }
.badge-red    { background: rgba(255,23,68,0.12);   color: var(--red);    border: 1px solid rgba(255,23,68,0.25); }
.badge-yellow { background: rgba(255,215,64,0.12);  color: var(--yellow); border: 1px solid rgba(255,215,64,0.25); }
.badge-blue   { background: rgba(99,102,241,0.12);  color: var(--primary2); border: 1px solid rgba(99,102,241,0.25); }

/* ─── Camera View ─────────────────────────────── */

.camera-container {
  position: relative;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 4/3;
  max-width: 640px;
}

.camera-container video,
.camera-container canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.camera-container canvas {
  pointer-events: none;
}

.camera-overlay-ui {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.camera-corner {
  position: absolute;
  width: 24px;
  height: 24px;
  border-color: var(--primary2);
  border-style: solid;
  border-width: 0;
  opacity: 0.7;
}

.camera-corner.tl { top: 12px; left: 12px; border-top-width: 2px; border-left-width: 2px; }
.camera-corner.tr { top: 12px; right: 12px; border-top-width: 2px; border-right-width: 2px; }
.camera-corner.bl { bottom: 12px; left: 12px; border-bottom-width: 2px; border-left-width: 2px; }
.camera-corner.br { bottom: 12px; right: 12px; border-bottom-width: 2px; border-right-width: 2px; }

.camera-status {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.75rem 1rem;
  background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
  font-size: 0.82rem;
  color: rgba(255,255,255,0.8);
}

/* ─── Toast ───────────────────────────────────── */

.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.9rem 1.2rem;
  font-size: 0.85rem;
  min-width: 260px;
  max-width: 360px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  animation: slideInRight 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.toast.success { border-color: rgba(0,230,118,0.3); }
.toast.error   { border-color: rgba(255,23,68,0.3); }
.toast.info    { border-color: rgba(99,102,241,0.3); }

.toast-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.toast.success .toast-dot { background: var(--green); }
.toast.error   .toast-dot { background: var(--red); }
.toast.info    .toast-dot { background: var(--primary2); }

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ─── Loading ─────────────────────────────────── */

.loader-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 3rem;
}

.loader-ring {
  width: 40px;
  height: 40px;
  border: 2px solid rgba(99,102,241,0.15);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loader-text {
  font-size: 0.85rem;
  color: var(--text2);
}

/* ─── Progress bar ────────────────────────────── */

.progress-wrap { margin-bottom: 0.4rem; }

.progress-bar-outer {
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-inner {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary2));
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* ─── Table ───────────────────────────────────── */

.table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

thead {
  background: var(--bg1);
  border-bottom: 1px solid var(--border);
}

th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text2);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

tr:last-child td { border-bottom: none; }

tr:hover td { background: rgba(255,255,255,0.02); }

/* ─── Stats row ───────────────────────────────── */

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.2rem;
}

.stat-card-num {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 0.3rem;
}

.stat-card-label {
  font-size: 0.72rem;
  color: var(--text2);
  letter-spacing: 0.05em;
}

/* ─── Grid layouts ────────────────────────────── */

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.three-col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

@media (max-width: 768px) {
  .two-col   { grid-template-columns: 1fr; }
  .three-col { grid-template-columns: 1fr; }
  .landing-nav { padding: 1rem 1.5rem; }
  .app-body  { padding: 1rem; }
  .hero-stats { gap: 1.5rem; }
  .landing-footer { flex-direction: column; text-align: center; }
}

/* ─── Attendance marked animation ─────────────── */

.marked-present {
  animation: flashGreen 0.5s ease;
}

@keyframes flashGreen {
  0%, 100% { background: transparent; }
  50%       { background: rgba(0,230,118,0.15); }
}

/* ─── Model loading overlay ───────────────────── */

.model-loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8,9,15,0.95);
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}

.model-loading-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
}

.model-loading-step {
  font-size: 0.85rem;
  color: var(--text2);
  min-height: 1.4em;
}