:root {
  --bg-dark: #090B10;
  --card-bg: rgba(18, 22, 33, 0.7);
  --glass-border: rgba(255, 255, 255, 0.08);
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.35);
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --radius: 16px;
  --font-family: 'Plus Jakarta Sans', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-family);
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

.bg-glow {
  position: fixed;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  height: 500px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.18) 0%, rgba(0, 0, 0, 0) 70%);
  pointer-events: none;
  z-index: 0;
}

.auth-body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  padding: 32px 24px;
  border-radius: var(--radius);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  position: relative;
  z-index: 1;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.5px;
  margin-bottom: 20px;
}

.logo-orb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a855f7, #6366f1);
  box-shadow: 0 0 12px var(--primary-glow);
  animation: orbPulse 3s infinite alternate;
}

@keyframes orbPulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  100% { transform: scale(1.1); opacity: 1; }
}

h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 6px; }
.subtitle { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 24px; }

.form-grid { display: flex; flex-direction: column; gap: 16px; }

.input-group { display: flex; flex-direction: column; gap: 6px; }
.input-group label { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; }

input, select, textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  padding: 12px 16px;
  border-radius: 10px;
  color: var(--text-main);
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s ease;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  background: rgba(255, 255, 255, 0.07);
}

.btn {
  padding: 12px 20px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:active { transform: scale(0.97); }

.pulse-btn:hover {
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.6);
}

.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { color: var(--text-main); background: rgba(255, 255, 255, 0.05); }

.alert {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.88rem;
  margin-bottom: 16px;
}
.alert-error { background: rgba(239, 68, 68, 0.15); border: 1px solid rgba(239, 68, 68, 0.3); color: #fca5a5; }
.alert-success { background: rgba(34, 197, 94, 0.15); border: 1px solid rgba(34, 197, 94, 0.3); color: #86efac; }

/* Dashboard layout */
.glass-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(12px);
  background: rgba(9, 11, 16, 0.75);
  border-bottom: 1px solid var(--glass-border);
}

.nav-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.main-content {
  max-width: 1000px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

.page-header {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 28px;
}

@media (min-width: 640px) {
  .page-header { flex-direction: row; justify-content: space-between; align-items: center; }
  .input-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
}

.tickets-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 768px) {
  .tickets-grid { grid-template-columns: repeat(2, 1fr); }
}

.glass-card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 20px;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.ticket-card:hover {
  transform: translateY(-4px);
  border-color: rgba(99, 102, 241, 0.4);
}

.ticket-header { display: flex; justify-content: space-between; margin-bottom: 12px; }
.ticket-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 8px; }
.ticket-excerpt { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 16px; line-height: 1.5; }

.ticket-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.meta-tag { font-size: 0.75rem; background: rgba(255, 255, 255, 0.05); padding: 4px 10px; border-radius: 20px; color: var(--text-muted); }

.badge { font-size: 0.75rem; font-weight: 700; padding: 4px 10px; border-radius: 20px; }
.badge-open { background: rgba(59, 130, 246, 0.15); color: #93c5fd; }
.badge-in-progress { background: rgba(234, 179, 8, 0.15); color: #fde047; }
.badge-resolved { background: rgba(34, 197, 94, 0.15); color: #86efac; }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
  transition: opacity 0.25s ease;
}

.modal-overlay.hidden { display: none; opacity: 0; pointer-events: none; }
.modal-content { width: 100%; max-width: 500px; }

.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.close-btn { background: none; border: none; color: var(--text-muted); font-size: 1.5rem; cursor: pointer; }

.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 10px; }

/* Keyframe Animations */
.animate-fade-up { animation: fadeUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.animate-fade-down { animation: fadeDown 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.animate-pop { animation: popIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-18px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

/* Hero & Search Styles */
.hero-section {
  text-align: center;
  padding: 60px 20px 40px;
  max-width: 800px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-block;
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 16px;
}

.hero-section h1 {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.8px;
  margin-bottom: 12px;
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 32px;
}

.search-box {
  position: relative;
  max-width: 550px;
  margin: 0 auto;
}

.search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  opacity: 0.6;
}

.search-box input {
  padding-left: 50px;
  height: 52px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(10px);
  font-size: 1rem;
}

/* Categories Grid */
.section-block {
  margin-bottom: 48px;
}

.section-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 20px;
}

.categories-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 640px) {
  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 992px) {
  .categories-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .hero-section h1 {
    font-size: 3rem;
  }
}

.category-card {
  transition: transform 0.25s ease, border-color 0.25s ease;
  cursor: pointer;
}

.category-card:hover {
  transform: translateY(-4px);
  border-color: rgba(99, 102, 241, 0.4);
}

.cat-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.category-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.category-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* FAQ Accordion */
.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  padding: 0;
  overflow: hidden;
}

.faq-trigger {
  width: 100%;
  background: transparent;
  border: none;
  padding: 20px;
  color: var(--text-main);
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
  cursor: pointer;
}

.faq-chevron {
  font-size: 1.4rem;
  transition: transform 0.25s ease;
  color: var(--text-muted);
}

.faq-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0, 1, 0, 1), padding 0.3s ease;
  padding: 0 20px;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.faq-item.active .faq-chevron {
  transform: rotate(45deg);
  color: var(--primary);
}

.faq-item.active .faq-content {
  max-height: 300px;
  padding: 0 20px 20px;
  transition: max-height 0.3s cubic-bezier(1, 0, 1, 0), padding 0.3s ease;
}

/* Call to Action Banner */
.cta-banner {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: flex-start;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(168, 85, 247, 0.08));
  border: 1px solid rgba(99, 102, 241, 0.25);
}

@media (min-width: 640px) {
  .cta-banner {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

/* App & Touch Behavior Adjustments */
html, body {
  touch-action: manipulation;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  padding-bottom: env(safe-area-inset-bottom);
}

input, textarea, select {
  -webkit-user-select: text;
  user-select: text;
}

/* App Bottom Navigation Bar */
.mobile-bottom-nav {
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(60px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(14, 18, 27, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--glass-border);
  z-index: 99;
  justify-content: space-around;
  align-items: center;
}

.nav-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 600;
  width: 100%;
  height: 100%;
  transition: color 0.2s ease;
}

.nav-tab svg {
  width: 22px;
  height: 22px;
  transition: transform 0.2s ease;
}

.nav-tab.active, .nav-tab:active {
  color: var(--primary);
}

.nav-tab:active svg {
  transform: scale(0.9);
}

@media (min-width: 768px) {
  .mobile-bottom-nav { display: none; }
  .desktop-only { display: flex; }
  .main-content { padding-bottom: 40px; }
}

@media (max-width: 767px) {
  .desktop-only { display: none; }
  .main-content { padding-bottom: 90px; }
}

/* Inline SVG Styles */
.search-icon-svg {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  stroke: var(--text-muted);
}

.cat-icon-wrapper {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.cat-icon-wrapper svg {
  width: 22px;
  height: 22px;
  stroke: var(--primary);
}

.faq-chevron-svg {
  width: 20px;
  height: 20px;
  stroke: var(--text-muted);
  transition: transform 0.3s ease;
}

.faq-item.active .faq-chevron-svg {
  transform: rotate(180deg);
  stroke: var(--primary);
}