:root {
  --primary: #e60000;
  --primary-glow: rgba(230, 0, 0, 0.4);
  --success: #00cc66;
  --warning: #ffcc00;
  --danger: #ff3333;
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Light Theme Defaults */
  --bg-color: #f5f5f5;
  --bg-texture: none;
  /* Can add subtle noise later */
  --surface: rgba(255, 255, 255, 0.7);
  --surface-hover: rgba(255, 255, 255, 0.9);
  --text-primary: #111111;
  --text-secondary: #555555;
  --border: rgba(0, 0, 0, 0.1);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] {
  --primary: #ff3333;
  --primary-glow: rgba(255, 51, 51, 0.5);
  --bg-color: #0a0a0a;
  --bg-texture: radial-gradient(circle at top right, rgba(255, 51, 51, 0.05), transparent 40%),
    radial-gradient(circle at bottom left, rgba(255, 51, 51, 0.05), transparent 40%);
  --surface: rgba(30, 30, 30, 0.6);
  --surface-hover: rgba(45, 45, 45, 0.8);
  --text-primary: #ffffff;
  --text-secondary: #aaaaaa;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-color);
  background-image: var(--bg-texture);
  color: var(--text-primary);
  min-height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Glassmorphism Classes */
.glass-panel {
  background: var(--surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.glass-panel:hover {
  background: var(--surface-hover);
}

/* Layout Utilities */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.min-h-screen {
  min-height: 100vh;
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-4 {
  gap: 1rem;
}

.gap-8 {
  gap: 2rem;
}

.p-8 {
  padding: 2rem;
}

.mt-8 {
  margin-top: 2rem;
}

.mb-8 {
  margin-bottom: 2rem;
}

.text-center {
  text-align: center;
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 72px;
  display: flex;
  align-items: center;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.logo {
  font-size: 1.25rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
  text-decoration: none;
}

.logo-img {
  height: 100px;
  width: auto;
  display: block;
}

/* Show light logo by default (light theme), hide dark logo */
.logo-img-dark {
  display: none;
}

.logo-img-light {
  display: block;
}

/* In dark theme, show dark logo, hide light logo */
[data-theme="dark"] .logo-img-dark {
  display: block;
}

[data-theme="dark"] .logo-img-light {
  display: none;
}

/* Hero page logo */
.hero-logo {
  height: 54px;
  width: auto;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  text-decoration: none;
  font-family: var(--font-main);
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px var(--primary-glow);
  background-color: #ff4d4d;
}

.btn-secondary {
  background-color: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background-color: var(--surface-hover);
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-icon:hover {
  background: var(--surface-hover);
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
  text-align: left;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.form-input {
  width: 100%;
  padding: 14px 16px;
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 1rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

[data-theme="dark"] .form-input {
  background: rgba(0, 0, 0, 0.2);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

/* Phone Input with Country Code */
.phone-input-wrapper {
  display: flex;
  align-items: stretch;
  border-radius: 8px;
  overflow: visible;
  border: 1px solid var(--border);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  position: relative;
}

.phone-input-wrapper:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

/* Custom Dropdown Trigger */
.country-code-dropdown {
  position: relative;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
}

.country-code-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 10px 14px 14px;
  background: rgba(0, 0, 0, 0.03);
  border: none;
  cursor: pointer;
  font-family: var(--font-main);
  font-size: 0.95rem;
  color: var(--text-primary);
  height: 100%;
  transition: background 0.2s ease;
  white-space: nowrap;
}

[data-theme="dark"] .country-code-trigger {
  background: rgba(255, 255, 255, 0.04);
}

.country-code-trigger:hover {
  background: rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .country-code-trigger:hover {
  background: rgba(255, 255, 255, 0.08);
}

.cc-flag {
  font-size: 1.2rem;
  line-height: 1;
}

.cc-code {
  font-weight: 600;
  font-size: 0.9rem;
}

.cc-chevron {
  opacity: 0.5;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.country-code-dropdown.open .cc-chevron {
  transform: rotate(180deg);
}

/* Dropdown List Panel */
.country-code-list-container {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: -1px;
  width: 320px;
  max-height: 320px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);
  z-index: 200;
  overflow: hidden;
  flex-direction: column;
  animation: dropdownFadeIn 0.15s ease;
}

[data-theme="dark"] .country-code-list-container {
  background: #1a1a1a;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 4px 12px rgba(0, 0, 0, 0.3);
}

.country-code-dropdown.open .country-code-list-container {
  display: flex;
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Search Input */
.country-search-input {
  width: 100%;
  padding: 12px 14px;
  border: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  background: transparent;
  font-family: var(--font-main);
  font-size: 0.9rem;
  color: var(--text-primary);
  outline: none;
}

[data-theme="dark"] .country-search-input {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.country-search-input::placeholder {
  color: var(--text-secondary);
  opacity: 0.7;
}

/* Country List */
.country-code-list {
  list-style: none;
  margin: 0;
  padding: 4px 0;
  overflow-y: auto;
  max-height: 260px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}

[data-theme="dark"] .country-code-list {
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.country-code-list::-webkit-scrollbar {
  width: 6px;
}

.country-code-list::-webkit-scrollbar-track {
  background: transparent;
}

.country-code-list::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 3px;
}

[data-theme="dark"] .country-code-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
}

.country-code-list li {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-primary);
  transition: background 0.15s ease;
  gap: 2px;
}

.country-code-list li:hover {
  background: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .country-code-list li:hover {
  background: rgba(255, 255, 255, 0.06);
}

.country-code-list li.selected {
  background: rgba(230, 0, 0, 0.06);
  color: var(--primary);
  font-weight: 600;
}

[data-theme="dark"] .country-code-list li.selected {
  background: rgba(255, 51, 51, 0.1);
}

.country-code-list li.cc-hidden {
  display: none;
}

.cc-val {
  margin-left: auto;
  font-weight: 600;
  opacity: 0.6;
  font-size: 0.85rem;
  flex-shrink: 0;
}

/* Phone Number Input */
.phone-number-input {
  border: none !important;
  border-radius: 0 !important;
  flex: 1;
  min-width: 0;
}

.phone-number-input:focus {
  box-shadow: none !important;
  border: none !important;
}

/* Utilities */
.hidden {
  display: none !important;
}

.fade-in {
  animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

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

/* Responsive */
@media (max-width: 768px) {
  .p-8 {
    padding: 1.5rem;
  }

  .container {
    padding: 0 16px;
  }

  .logo-img {
    height: 70px;
  }

  .hero-logo {
    height: 40px;
  }
}