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

/* ═══════════════════════════════════════════════════════════════
   ROOT TOKENS — untouched
═══════════════════════════════════════════════════════════════ */
:root {
  /* ── Dashboard tokens — updated to match login page theme ── */
  --bg:       #07071a;
  --surface:  rgba(14, 8, 38, 0.85);
  --surface2: rgba(22, 12, 55, 0.80);
  --text:     rgba(240, 230, 255, 0.92);
  --text-muted: rgba(180, 140, 255, 0.55);
  --accent:      #a855f7;
  --accent-hover:#c084fc;
  --success: #3fb950;
  --warning: #d29922;
  --danger:  #f85149;
  --radius:  10px;
  --font:    'DM Sans', 'Segoe UI', system-ui, sans-serif;

  /* Auth palette — logo purple + gold, matches lava bg */
  --auth-purple:  #7c3aed;
  --auth-violet:  #a855f7;
  --auth-magenta: #c026d3;
  --auth-gold:    #f5c518;
  --auth-glass:   rgba(8, 3, 22, 0.70);
  --auth-border:  rgba(168, 85, 247, 0.20);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 55% at 50% -5%, rgba(124,58,237,0.28) 0%, transparent 65%),
    radial-gradient(ellipse 40% 30% at 85% 95%, rgba(147,51,234,0.14) 0%, transparent 60%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

.container { max-width: 960px; margin: 0 auto; padding: 1rem; }

/* ── Header ── */
#main-header {
  background: rgba(8, 3, 22, 0.88); padding: 0.75rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 0.5rem;
  border-bottom: 1px solid rgba(168, 85, 247, 0.18);
  backdrop-filter: blur(16px);
}
#main-header { display: none; }
body:has(#dashboard-section.visible) #main-header { display: flex; }
header h1 { margin: 0; font-size: 1.2rem; font-weight: 700; font-family: 'Sora', sans-serif; color: rgba(240,230,255,0.92); letter-spacing: 0.04em; }
header .user-info { display: flex; align-items: center; gap: 0.75rem; font-size: 0.875rem; color: rgba(180,140,255,0.65); }
header button {
  background: rgba(124,58,237,0.15); color: rgba(240,230,255,0.85); border: 1px solid rgba(168,85,247,0.30);
  padding: 0.4rem 0.9rem; border-radius: var(--radius); cursor: pointer; font-size: 0.875rem;
  font-family: var(--font); transition: background 0.18s, border-color 0.18s;
}
header button:hover { background: rgba(124,58,237,0.28); border-color: rgba(168,85,247,0.55); color: #fff; }

/* ═══════════════════════════════════════════════════════════════
   AUTH — VISUAL ONLY, NO LOGIC TOUCHED
═══════════════════════════════════════════════════════════════ */
#login-section {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 2rem;
  overflow: hidden;
  background: #04020e;
}

/* Canvas host */
#login-section .auth-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

#auth-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Vignette — keeps card readable */
#login-section .auth-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 50%,
    transparent 15%,
    rgba(2, 0, 10, 0.60) 70%,
    rgba(2, 0, 10, 0.85) 100%
  );
  z-index: 3;
  pointer-events: none;
}

/* Subtle noise grain */
#login-section .auth-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  opacity: 0.032;
  z-index: 4;
  pointer-events: none;
}

/* ── Card wrapper ── */
#login-section .auth-cards {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 420px;
  animation: cardReveal 0.9s cubic-bezier(.22,1,.36,1) both;
}

@keyframes cardReveal {
  from { opacity: 0; transform: translateY(30px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

/* ── Glassmorphism card ── */
.auth-card {
  background: var(--auth-glass);
  backdrop-filter: blur(36px) saturate(180%);
  -webkit-backdrop-filter: blur(36px) saturate(180%);
  border: 1px solid var(--auth-border);
  border-radius: 24px;
  padding: 2.25rem 2.25rem 2rem;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04) inset,
    0 0 70px rgba(124, 58, 237, 0.18),
    0 8px 48px rgba(0, 0, 0, 0.65);
  width: 100%;
  animation: none;
  position: relative;
  overflow: hidden;
}

/* Gold top accent line */
.auth-card::before {
  content: '';
  position: absolute;
  top: 0; left: 10%; right: 10%;
  height: 1.5px;
  background: linear-gradient(90deg,
    transparent,
    rgba(245,197,24,0.45) 25%,
    rgba(168,85,247,0.75) 50%,
    rgba(245,197,24,0.45) 75%,
    transparent
  );
  border-radius: 999px;
}

/* Ambient glow bleed behind card */
.auth-card::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 24px;
  background: transparent;
  box-shadow: 0 0 40px rgba(168,85,247,0.12);
  pointer-events: none;
  z-index: -1;
}

/* ── Logo ── */
.auth-logo { text-align: center; margin-bottom: 0.75rem; }

.auth-logo .logo-circle {
  width: 64px; height: 64px;
  margin: 0 auto 0.6rem;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  box-shadow:
    0 0 0 2px rgba(168,85,247,0.40),
    0 0 0 5px rgba(168,85,247,0.10),
    0 6px 24px rgba(0,0,0,0.50);
  animation: logoRing 3.5s ease-in-out infinite;
}
@keyframes logoRing {
  0%,100% { box-shadow: 0 0 0 2px rgba(168,85,247,0.40), 0 0 0 5px rgba(168,85,247,0.08), 0 6px 24px rgba(0,0,0,0.55); }
  50%      { box-shadow: 0 0 0 2px rgba(245,197,24,0.60), 0 0 0 8px rgba(168,85,247,0.14), 0 6px 28px rgba(0,0,0,0.55); }
}

.auth-logo .logo-text {
  display: block;
  font-family: 'Sora', sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: rgba(220, 190, 255, 0.58);
  text-transform: uppercase;
}

/* ── Headings ── */
.auth-welcome,
.auth-heading {
  margin: 0 0 1.25rem;
  font-family: 'Sora', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.04em;
  color: rgba(240, 230, 255, 0.95);
}

/* ── Form ── */
.auth-form { display: flex; flex-direction: column; gap: 1rem; }

.auth-form .input-wrap { position: relative; display: flex; align-items: center; }

.auth-form .input-wrap input {
  width: 100%;
  padding: 0.78rem 1rem 0.78rem 2.75rem;
  border: 1px solid rgba(168,85,247,0.18);
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  color: rgba(240,230,255,0.92);
  font-family: var(--font);
  font-size: 0.93rem;
  transition: border-color 0.22s, box-shadow 0.22s, background 0.22s;
}
.auth-form .input-wrap input::placeholder { color: rgba(180,140,255,0.30); }
.auth-form .input-wrap input:focus {
  outline: none;
  border-color: rgba(168,85,247,0.60);
  background: rgba(255,255,255,0.07);
  box-shadow: 0 0 0 3px rgba(168,85,247,0.12);
}

.auth-form .input-icon {
  position: absolute; left: 1rem; top: 50%; transform: translateY(-50%);
  color: rgba(168,85,247,0.50); pointer-events: none;
  display: flex; align-items: center; justify-content: center;
}

.auth-form .input-wrap:has(.input-toggle-pw) input { padding-right: 2.75rem; }
.auth-form .input-wrap.has-toggle-pw input { padding-right: 2.75rem; }

.auth-form .input-toggle-pw {
  position: absolute; right: 0.5rem; top: 50%; transform: translateY(-50%);
  background: none; border: none; padding: 0.35rem;
  cursor: pointer; color: rgba(168,85,247,0.40);
  display: flex; align-items: center; border-radius: 6px; transition: color 0.2s;
}
.auth-form .input-toggle-pw:hover { color: var(--auth-violet); }

/* ── Submit button ── */
.btn-auth {
  width: 100%; padding: 0.88rem 1rem;
  border: none; border-radius: 12px;
  font-family: 'Sora', sans-serif;
  font-size: 0.92rem; font-weight: 600; letter-spacing: 0.05em;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
  position: relative; overflow: hidden;
}

.btn-primary-auth {
  background: linear-gradient(135deg, #5b21b6 0%, #7c3aed 45%, #9333ea 100%);
  color: #fff;
  margin-top: 0.25rem;
  box-shadow: 0 4px 24px rgba(124,58,237,0.45);
}
/* Shimmer on hover */
.btn-primary-auth::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 35%, rgba(255,255,255,0.18) 50%, transparent 65%);
  transform: translateX(-100%);
  transition: transform 0.55s;
}
.btn-primary-auth:hover {
  box-shadow: 0 6px 32px rgba(124,58,237,0.60);
  transform: translateY(-2px);
}
.btn-primary-auth:hover::after { transform: translateX(100%); }
.btn-primary-auth:active { transform: scale(0.99); }

/* ── Links ── */
.auth-links { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; margin-top: 0.25rem; }
.auth-link { font-size: 0.875rem; color: rgba(245,197,24,0.72); text-decoration: none; transition: color 0.2s; }
.auth-link:hover { color: var(--auth-gold); text-decoration: underline; }
.auth-link.block { display: block; text-align: center; }

.auth-toggle {
  margin: 1rem 0 0; padding-top: 1rem;
  border-top: 1px solid rgba(168,85,247,0.12);
  text-align: center; font-size: 0.875rem; color: rgba(180,140,255,0.45);
}
.auth-toggle a { color: rgba(245,197,24,0.72); text-decoration: none; font-weight: 500; }
.auth-toggle a:hover { color: var(--auth-gold); text-decoration: underline; }

.auth-error { color: #f87171; font-size: 0.875rem; margin: -0.5rem 0 0; min-height: 1.25rem; }
#username-hint { color: rgba(180,140,255,0.42) !important; }

/* ═══════════════════════════════════════════════════════════════
   DASHBOARD — updated to match login page purple theme
═══════════════════════════════════════════════════════════════ */
#dashboard-section { display: none; padding: 1.5rem 1rem; }
#dashboard-section.visible { display: block; }
.dashboard-panel { display: none; background: rgba(14,8,38,0.80); border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.5rem; border: 1px solid rgba(168,85,247,0.18); backdrop-filter: blur(16px); box-shadow: 0 4px 24px rgba(0,0,0,0.40); }
.dashboard-panel.visible { display: block; }
.dashboard-panel h2 { margin: 0 0 1rem; font-size: 1.2rem; font-family: 'Sora', sans-serif; color: rgba(240,230,255,0.92); }
.dashboard-panel h3 { margin: 1.25rem 0 0.6rem; font-size: 0.95rem; font-family: 'Sora', sans-serif; color: rgba(200,170,255,0.75); letter-spacing: 0.04em; text-transform: uppercase; font-size: 0.78rem; }

.availability-list { list-style: none; padding: 0; margin: 0; }
.availability-list li { display: flex; align-items: center; justify-content: space-between; padding: 0.75rem 1rem; margin-bottom: 0.45rem; background: rgba(255,255,255,0.03); border-radius: var(--radius); border-left: 4px solid rgba(168,85,247,0.25); transition: background 0.15s; }
.availability-list li:hover { background: rgba(124,58,237,0.08); }
.availability-list li.status-available       { border-left-color: var(--success); }
.availability-list li.status-in_class        { border-left-color: var(--accent); }
.availability-list li.status-next_class      { border-left-color: var(--warning); }
.availability-list li.status-end_of_schedule { border-left-color: var(--text-muted); }
.availability-list li.status-unavailable     { border-left-color: var(--danger); }
.availability-list li.status-no_schedule     { border-left-color: var(--text-muted); }
.availability-list li.status-consultation    { border-left-color: #7B3F00; }
.availability-list .name    { font-weight: 600; color: rgba(240,230,255,0.90); }
.availability-list .message { color: var(--text-muted); font-size: 0.875rem; }
.availability-list a        { color: var(--auth-gold); font-size: 0.85rem; margin-left: 0.5rem; }
.availability-list a:hover  { color: #f5c518; }

.schedule-table { width: 100%; border-collapse: collapse; }
.schedule-table th, .schedule-table td { padding: 0.6rem 0.85rem; text-align: left; border-bottom: 1px solid rgba(168,85,247,0.10); }
.schedule-table th { color: var(--text-muted); font-weight: 600; font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; }
.schedule-table tbody tr:hover { background: rgba(124,58,237,0.06); }

.status-card { background: rgba(255,255,255,0.03); padding: 1rem 1.25rem; border-radius: var(--radius); margin-bottom: 1rem; border-left: 4px solid var(--accent); border: 1px solid rgba(168,85,247,0.15); }
.status-card .status-type    { font-weight: 700; text-transform: capitalize; color: var(--auth-violet); }
.status-card .status-message { color: var(--text-muted); margin-top: 0.25rem; font-size: 0.875rem; }

/* Buttons in dashboard */
.btn { padding: 0.5rem 1rem; border-radius: var(--radius); border: none; cursor: pointer; font-size: 0.875rem; font-family: var(--font); font-weight: 600; transition: opacity 0.18s, transform 0.12s; }
.btn:hover { opacity: 0.88; transform: translateY(-1px); }
.btn:active { transform: scale(0.98); }
.btn-primary   { background: linear-gradient(135deg, #5b21b6 0%, #7c3aed 45%, #9333ea 100%); color: #fff; box-shadow: 0 4px 16px rgba(124,58,237,0.35); }
.btn-primary:hover { box-shadow: 0 6px 24px rgba(124,58,237,0.50); opacity: 1; }
.btn-secondary { background: rgba(255,255,255,0.06); color: var(--text); border: 1px solid rgba(168,85,247,0.22); }
.btn-secondary:hover { background: rgba(124,58,237,0.12); border-color: rgba(168,85,247,0.40); }
.btn-danger    { background: rgba(248,81,73,0.15); color: var(--danger); border: 1px solid rgba(248,81,73,0.30); }
.btn-danger:hover { background: rgba(248,81,73,0.25); border-color: var(--danger); }

/* Admin tables */
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.admin-table th, .admin-table td { padding: 0.55rem 0.85rem; text-align: left; border-bottom: 1px solid rgba(168,85,247,0.10); }
.admin-table th { color: var(--text-muted); font-weight: 600; font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; background: rgba(124,58,237,0.08); }
.admin-table tbody tr:hover { background: rgba(124,58,237,0.06); }
.admin-table .actions { white-space: nowrap; }
.admin-table .actions button { margin-right: 0.3rem; }

/* Form rows inside dashboard */
.form-row { margin-bottom: 1rem; }
.form-row label { display: block; margin-bottom: 0.3rem; font-size: 0.84rem; color: var(--text-muted); font-weight: 500; }
.form-row input, .form-row select {
  width: 100%; padding: 0.55rem 0.85rem;
  border: 1px solid rgba(168,85,247,0.22);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.04);
  color: var(--text); font-family: var(--font); font-size: 0.875rem;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  outline: none;
}
.form-row input:focus, .form-row select:focus { border-color: rgba(168,85,247,0.55); background: rgba(255,255,255,0.06); box-shadow: 0 0 0 3px rgba(168,85,247,0.12); }
.form-row input::placeholder { color: rgba(180,140,255,0.30); }

/* Admin tabs */
.tabs { display: flex; gap: 0.25rem; margin-bottom: 1rem; border-bottom: 1px solid rgba(168,85,247,0.15); }
.tabs button { padding: 0.6rem 1rem; background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 0.9rem; font-family: var(--font); border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color 0.18s, border-color 0.18s; }
.tabs button.active { color: var(--auth-violet); border-bottom-color: var(--auth-violet); font-weight: 600; }
.tabs button:hover:not(.active) { color: var(--text); }

.poll-info { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.5rem; }
.hidden { display: none !important; }
.rfid-note { display: inline-block; color: var(--text-muted); font-size: 0.78rem; margin-left: 0.5rem; opacity: 0.65; cursor: default; vertical-align: middle; }