:root {
  /* Ultra-Modern Dark Theme Palette */
  --bg: #0b0f19;
  --bg-grid: #111827;
  --card-bg: rgba(17, 24, 39, 0.7);
  --card-bg-hover: rgba(31, 41, 55, 0.8);
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.15);
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.16);
  --success: #10b981;
  --gold: #f59e0b;

  /* Modern Tokens */
  --radius: 16px;
  --radius-sm: 12px;
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 30px rgba(99, 102, 241, 0.1);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --transition: all 0.3s var(--ease);
}

/* Global Reset & Futuristic Grid Background */
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
  font-family: 'Inter', 'Hind Siliguri', -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg);
  /* Pure CSS Adaptive Grid Pattern */
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: center;
  color: var(--text);
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* Layout Containers */
.container {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(16px, 5vw, 32px);
}

.center-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  animation: fadeIn 0.6s var(--ease);
}

h1,
h2,
h3 {
  margin: 0 0 12px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
}

/* Glassmorphism Bento Cards */
.card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.card:hover {
  transform: translateY(-2px);
  background: var(--card-bg-hover);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-lg);
}

.card.premium {
  border: 1px solid rgba(245, 158, 11, 0.25);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.03) 0%, var(--card-bg) 100%);
  position: relative;
  overflow: hidden;
}

.card.premium::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), #fcd34d);
}

/* Cyberpunk Input Fields */
label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 16px 0 8px;
  color: var(--text-muted);
}

input,
select,
textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  background: rgba(15, 23, 42, 0.6);
  color: var(--text);
  transition: var(--transition);
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  background: rgba(15, 23, 42, 0.9);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

/* Style options dropdown cleanly for dark mode */
select option {
  background: var(--bg-grid);
  color: var(--text);
}

textarea {
  resize: vertical;
  min-height: 100px;
}

/* Interactive Neon Buttons */
button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px 24px;
  font-size: 15px;
  font-weight: 600;
  background: var(--primary);
  color: #fff;
  margin-top: 16px;
  transition: var(--transition);
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

button:hover,
.btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
}

button:active,
.btn:active {
  transform: translateY(1px);
}

button:disabled {
  background: #334155;
  color: #64748b;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-hover);
  box-shadow: none;
}

.btn-google {
  background: #ffffff;
  color: #0f172a;
  border: none;
  gap: 12px;
}

.btn-google:hover {
  background: #f1f5f9;
  box-shadow: 0 8px 20px rgba(255, 255, 255, 0.1);
}

.btn-danger {
  background: #ef4444;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
  background: #dc2626;
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.4);
}

.btn-full {
  width: 100%;
}

/* Micro-Chips */
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.chip {
  padding: 8px 18px;
  border: 1px solid var(--border);
  border-radius: 100px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
  transition: var(--transition);
  user-select: none;
}

.chip:hover {
  border-color: var(--border-hover);
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.chip.selected {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 8px 20px var(--primary-glow);
}

/* Sticky Glass Topbar */
nav.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: rgba(11, 15, 25, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

nav.topbar .logo {
  font-weight: 800;
  color: #ffffff;
  font-size: 20px;
  letter-spacing: -0.03em;
  background: linear-gradient(to right, #ffffff, var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

nav.topbar .actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* Responsive Glass Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  background: rgba(17, 24, 39, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.3);
}

.bottom-nav a {
  flex: 1;
  text-align: center;
  padding: 14px 4px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.bottom-nav a.active {
  color: var(--primary);
  font-weight: 600;
}

.page-body {
  padding-bottom: calc(90px + env(safe-area-inset-bottom, 0px));
}

/* Modern Dark Theme Badges */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 100px;
  margin-left: 8px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-verified {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
}

.badge-premium {
  background: rgba(245, 158, 11, 0.15);
  color: #fde047;
}

/* 
/* Profile page */
.profile-header {
  display: flex;
  align-items: center;
  gap: 16px;
}

.profile-avatar-lg {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.profile-avatar-lg-fallback {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary, #6366f1);
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  flex-shrink: 0;
}

.profile-header-info h3 {
  margin: 0 0 4px 0;
}

.profile-header-info p {
  margin: 0;
}

/* Poster avatar on tuition cards */
.poster-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.poster-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--primary, #6366f1);
  flex-shrink: 0;
}

.poster-avatar-fallback {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary, #6366f1);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.poster-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted, #a1a1aa);
}

/* Profile button in topbar */
.profile-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px 8px;
  margin: 0;
  border-radius: 20px;
  font-size: inherit;
  font-weight: inherit;
  box-shadow: none;
}

.profile-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: none;
  box-shadow: none;
}

.profile-btn img,
.profile-btn .avatar-fallback {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.profile-btn .avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary, #6366f1);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}

.profile-btn .profile-btn-name {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

/* Dashboard List Components */
.tuition-card {
  border-left: 4px solid var(--primary);
  cursor: pointer;
}

.tuition-card.premium {
  border-left: 4px solid var(--gold);
}

.tuition-card .meta {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 6px;
}

.tuition-card .amount {
  font-weight: 700;
  color: var(--success);
  font-size: 18px;
}

/* Utility Messaging */
.error-text {
  color: #ef4444;
  font-size: 13px;
  margin-top: 8px;
  animation: shake 0.4s ease;
}

.hint-text {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 8px;
}

/* Horizontal Mobile Filter Bar */
.filter-bar {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 12px 24px;
  background: rgba(17, 24, 39, 0.4);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  scrollbar-width: none;
}

.filter-bar::-webkit-scrollbar {
  display: none;
}

.filter-bar select {
  width: auto;
  min-width: 135px;
  padding: 10px 14px;
}

.applicant-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.applicant-row:last-child {
  border-bottom: none;
}

#recaptcha-container {
  margin-top: 16px;
  display: flex;
  justify-content: center;
}

/* Keyframe Core Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-4px);
  }

  75% {
    transform: translateX(4px);
  }
}

/* Laptop Optimization Viewport rules */
@media (min-width: 1024px) {
  .card:hover {
    transform: translateY(-4px);
  }

  .bottom-nav {
    display: none;
    /* Safely hides mobile tray on wide desktop setups */
  }

  .page-body {
    padding-bottom: 40px;
  }
}