/* =========================================
   Modern Trust - Design Tokens
   Based on README/UI_BRANDING.md
========================================= */
:root {
  /* Primary Branding */
  --color-primary-500: #0078D4;
  --color-primary-600: #005A9E;
  --color-secondary-500: #00BFA5;
  --color-secondary-100: #E0F2F1;

  /* Neutrals & Backgrounds (Light Mode) */
  --color-surface-ground: #FFFFFF;
  --color-surface-card: #F8FAFC;
  --color-surface-border: #E2E8F0;
  --color-text-main: #1E293B;
  --color-text-body: #475569;
  --color-text-muted: #94A3B8;

  /* Form Elements */
  --input-bg: #FFFFFF;
  --input-border: #CBD5E1;
  --input-focus: #0078D4;


  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-16: 64px;

  /* Radius */
  --mt-radius-sm: 4px;
  --mt-radius-md: 8px;
  --mt-radius-lg: 16px;
  --mt-radius-full: 9999px;

  /* Shadows */
  --mt-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --mt-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --mt-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);

  /* Typography */
  --font-family-primary: 'Cairo', 'IBM Plex Sans', sans-serif;
  --font-size-display: 48px;
  --font-size-h1: 36px;
  --font-size-h2: 30px;
  --font-size-h3: 24px;
  --font-size-body-l: 18px;
  --font-size-body-m: 16px;
  --font-size-small: 14px;
}

/* Dark Mode Tokens */
[data-theme="dark"] {
  --color-primary-500: #3B8FD9;
  --color-primary-600: #6CA9E6;
  --color-secondary-500: #00D9BD;
  --color-secondary-100: #004D40;

  --color-surface-ground: #0B1120;
  --color-surface-card: #151E32;
  --color-surface-border: #2D3A54;
  --color-text-main: #F1F5F9;
  --color-text-body: #94A3B8;
  --color-text-muted: #64748B;

  --input-bg: #1E293B;
  --input-border: #334155;
  --input-focus: #3B8FD9;
}

/* =========================================
   Global Resets & Utilities
========================================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  overflow-x: hidden;
}

body {
  font-family: var(--font-family-primary);
  background-color: var(--color-surface-ground);
  color: var(--color-text-main);
  /* direction is driven by <html dir="rtl|ltr"> — do not set it here */
  line-height: 1.5;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
  /* Prevent blob overflow */
  width: 100%;
}

/* Font switching based on dir attribute */
[dir="rtl"] body, [dir="rtl"] .hb-text {
  font-family: 'Cairo', 'IBM Plex Sans', sans-serif;
}
[dir="ltr"] body, [dir="ltr"] .hb-text {
  font-family: 'IBM Plex Sans', 'Cairo', sans-serif;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.2s ease;
}

ul {
  list-style: none;
}

.container {
  width: 100%;
  margin-inline: auto;
  padding-inline: var(--space-4);
}

img {
  max-width: 100%;
  height: auto;
}

/* Breakpoints & Container Widths */
@media (min-width: 768px) {
  .container {
    max-width: 720px;
  }
}

@media (min-width: 1024px) {
  .container {
    max-width: 960px;
  }
}

@media (min-width: 1440px) {
  .container {
    max-width: 1320px;
  }
}

/* Base utility to prevent horizontal scrolling */
body, html {
  max-width: 100vw;
  overflow-x: hidden;
}

/* =========================================
   Typography Classes
========================================= */
.text-display {
  font-size: var(--font-size-display);
  font-weight: 700;
  line-height: 1.2;
}

.text-h1 {
  font-size: var(--font-size-h1);
  font-weight: 600;
  line-height: 1.3;
}

.text-h2 {
  font-size: var(--font-size-h2);
  font-weight: 600;
  line-height: 1.3;
}

.text-h3 {
  font-size: var(--font-size-h3);
  font-weight: 500;
  line-height: 1.4;
}

.text-body-l {
  font-size: var(--font-size-body-l);
  font-weight: 400;
  line-height: 1.6;
}

.text-body-m {
  font-size: var(--font-size-body-m);
  font-weight: 400;
  line-height: 1.5;
}

.text-small {
  font-size: var(--font-size-small);
  font-weight: 400;
  line-height: 1.5;
}

.text-muted {
  color: var(--color-text-muted);
}

.text-primary {
  color: var(--color-primary-500);
}

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

/* Responsive Type */
@media (max-width: 768px) {
  .text-display {
    font-size: 32px;
  }

  .text-h1 {
    font-size: 28px;
  }

  .text-h2 {
    font-size: 24px;
  }
}

/* =========================================
   Animations
========================================= */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

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

@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }

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

@keyframes float {
  0% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-10px);
  }

  100% {
    transform: translateY(0px);
  }
}

@keyframes pulse-glow {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 120, 212, 0.4);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(0, 120, 212, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(0, 120, 212, 0);
  }
}

@keyframes gradient-xy {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

@keyframes rotate-blob {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }

  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@keyframes popIn {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  70% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.reveal-on-scroll {
  opacity: 1;
  transform: none;
}

html.js .reveal-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

html.js .reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.stagger-1 {
  transition-delay: 100ms;
}

.stagger-2 {
  transition-delay: 200ms;
}

.stagger-3 {
  transition-delay: 300ms;
}

/* Text Gradient Animation */
.animate-text-gradient {
  background: linear-gradient(to right,
      var(--color-primary-500),
      var(--color-secondary-500),
      var(--color-primary-600));
  background-size: 200% auto;
  color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  animation: gradient-xy 3s linear infinite;
}

/* Navbar Entrance */
.navbar {
  animation: slideDown 0.8s ease-out forwards;
}

/* Pulsing Button */
.btn-pulse {
  animation: pulse-glow 2s infinite;
}

/* =========================================
   Components: Buttons
========================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  border-radius: var(--mt-radius-full);
  font-weight: 600;
  font-size: var(--font-size-body-m);
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid transparent;
  gap: var(--space-2);
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary-500) 0%, var(--color-primary-600) 100%);
  color: #FFFFFF;
  box-shadow: 0 4px 15px rgba(0, 120, 212, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 120, 212, 0.4);
}

.btn-secondary {
  background-color: transparent;
  border-color: var(--color-primary-500);
  color: var(--color-primary-500);
}

.btn-secondary:hover {
  background-color: rgba(0, 120, 212, 0.05);
  transform: translateY(-2px);
}

/* =========================================
   Layout: Navbar
========================================= */
.navbar {
  background-color: var(--color-surface-ground);
  border-bottom: 1px solid var(--color-surface-border);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: var(--space-4) 0;
}

.navbar-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.navbar-brand {
  font-weight: 700;
  font-size: 24px;
  color: var(--color-primary-500);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.navbar-menu {
  display: flex;
  gap: var(--space-8);
  align-items: center;
}

.navbar-link {
  color: var(--color-text-body);
  font-weight: 500;
}

.navbar-link:hover {
  color: var(--color-primary-500);
}

.navbar-actions {
  display: flex;
  gap: var(--space-4);
  align-items: center;
}

/* Mobile Nav */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--color-text-main);
  font-size: 24px;
  cursor: pointer;
}

@media (max-width: 768px) {
  .navbar-container {
    position: relative;
  }

  /* Hide the top navbar login/register buttons on mobile, as they are in the bottom nav now */
  .navbar-actions .btn {
    display: none;
  }

  .navbar-menu {
    display: none;
    position: absolute;
    top: 100%;
    inset-inline-start: 0;
    width: 100%;
    background-color: var(--color-surface-ground);
    flex-direction: column;
    padding: var(--space-4);
    border-bottom: 1px solid var(--color-surface-border);
    box-shadow: var(--mt-shadow-lg);
    animation: slideDown 0.3s ease-out;
  }

  .navbar-menu.is-active {
    display: flex;
  }

  .navbar-menu li {
    width: 100%;
    text-align: center;
    padding: var(--space-2) 0;
  }

  .mobile-menu-btn {
    display: none; /* Removed in favor of bottom nav */
  }
}

/* =========================================
   Mobile Nav Glass Island
========================================= */
.mobile-nav-glass {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: 92%;
  max-width: 400px;
  height: 65px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 35px;
  display: flex;
  justify-content: space-between; /* Better spread for 4 elements */
  align-items: center;
  padding: 0 16px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

[data-theme="dark"] .mobile-nav-glass {
  background: rgba(30, 41, 59, 0.75);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
}

.mobile-nav-item {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  text-decoration: none;
  color: var(--color-text-muted);
  width: 45px;
  height: 45px;
  border-radius: 25px;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  z-index: 1;
  flex-shrink: 0; /* Prevent icons from crushing */
}

.mobile-nav-item i {
  font-size: 20px;
  transition: all 0.3s;
}

.mobile-nav-item.active {
  color: #ffffff !important;
  width: min(130px, max-content + 40px); /* Responsive active width */
  padding: 0 16px;
  background: linear-gradient(135deg, var(--color-primary-500) 0%, var(--color-primary-600) 100%);
  box-shadow: 0 8px 15px rgba(0, 120, 212, 0.3);
}

.mobile-nav-item.active i {
  margin-inline-start: 8px; /* space between icon and label, respects dir */
}

.mobile-nav-item .text {
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  width: 0;
  overflow: hidden;
  transition: all 0.4s;
  white-space: nowrap;
}

.mobile-nav-item.active .text {
  opacity: 1;
  width: max-content;
}

/* Hide on desktop */
@media (min-width: 769px) {
  .mobile-nav-glass {
    display: none !important;
  }
}

/* Add padding to the bottom of the page on mobile so content isn't covered by the floating nav */
@media (max-width: 768px) {
  body {
    padding-bottom: 90px;
  }
}

/* =========================================
   Modern Theme Toggle (Day/Night Switch)
========================================= */
.theme-toggle {
  position: relative;
  width: 64px;
  height: 32px;
  background: linear-gradient(to bottom, #4FABD9 0%, #76D1F6 100%);
  /* Day Sky */
  border-radius: 999px;
  border: 4px solid #F0F0F0;
  /* Soft outer rim */
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), inset 0 -2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  padding: 0;
  display: block;
}

/* Dark Mode State: Night Sky */
.theme-toggle.is-dark {
  background: linear-gradient(to bottom, #1B2944 0%, #2D4367 100%);
  border-color: #33425E;
}

/* The Sun / Moon Circle */
.toggle-circle {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #FFD54F;
  /* Sun Yellow */
  border-radius: 50%;
  box-shadow: inset -2px -2px 4px rgba(255, 160, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94), background 0.5s ease;
  z-index: 10;
}

/* Moon State */
.theme-toggle.is-dark .toggle-circle {
  transform: translateX(32px);
  background: #E0E0E0;
  /* Moon Grey */
  box-shadow: inset -2px -2px 4px rgba(0, 0, 0, 0.2),
    inset 2px 2px 0px white,
    1px 1px 4px rgba(0, 0, 0, 0.3);
}

/* Moon Craters (Pseudo-elements) */
.theme-toggle.is-dark .toggle-circle::before {
  content: '';
  position: absolute;
  top: 5px;
  left: 9px;
  width: 4px;
  height: 4px;
  background: #BDBDBD;
  border-radius: 50%;
  box-shadow: -6px 6px 0 -1px #BDBDBD, -2px 8px 0 -1px #BDBDBD;
}

/* Clouds for Day Mode */
.toggle-clouds {
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  transition: transform 0.5s ease;
}

.cloud {
  position: absolute;
  background: #FFFFFF;
  border-radius: 50%;
}

.cloud-1 {
  width: 24px;
  height: 24px;
  bottom: 0;
  left: 8px;
}

.cloud-2 {
  width: 32px;
  height: 32px;
  bottom: -8px;
  right: 6px;
}

/* Hide Clouds in Dark Mode */
.theme-toggle.is-dark .toggle-clouds {
  transform: translateY(20px);
}

/* Stars for Night Mode */
.toggle-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.star {
  position: absolute;
  background: white;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.3s ease 0.1s;
}

.star-1 {
  width: 2px;
  height: 2px;
  top: 8px;
  left: 30px;
}

.star-2 {
  width: 3px;
  height: 3px;
  top: 14px;
  left: 24px;
}

.star-3 {
  width: 1px;
  height: 1px;
  top: 10px;
  left: 16px;
}

/* Show Stars in Dark Mode */
.theme-toggle.is-dark .star {
  opacity: 1;
}

/* Hover Effect */
.theme-toggle:hover {
  transform: scale(1.05);
}

/* =========================================
   Layout: Hero Section
========================================= */
.hero {
  padding: var(--space-16) 0;
  background: radial-gradient(circle at top left, var(--color-secondary-100) 0%, transparent 40%),
    radial-gradient(circle at bottom right, rgba(0, 120, 212, 0.05) 0%, transparent 40%),
    var(--color-surface-ground);
  position: relative;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-12);
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  animation: fadeInUp 1s ease-out;
}

/* Modern Hero Image Wrapper */
.hero-image-wrapper {
  position: relative;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
}

.blob-backdrop {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 120%;
  height: 120%;
  background: linear-gradient(135deg, rgba(0, 120, 212, 0.1), rgba(0, 191, 165, 0.1));
  border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  animation: rotate-blob 20s linear infinite;
  z-index: 0;
}

.hero-main-img {
  position: relative;
  border-radius: 24px;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.15);
  z-index: 1;
  width: 100%;
  border: 4px solid var(--color-surface-card);
}

.floating-badge {
  position: absolute;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  padding: 12px 20px;
  border-radius: 16px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 2;
  border: 1px solid rgba(255, 255, 255, 0.5);
  transition: transform 0.3s ease;
}

[data-theme="dark"] .floating-badge {
  background: rgba(21, 30, 50, 0.9);
  border-color: rgba(255, 255, 255, 0.1);
}

.badge-top-right {
  top: 40px;
  right: -30px;
  animation: popIn 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards, float 6s ease-in-out infinite 0.8s;
}

.badge-bottom-left {
  bottom: 40px;
  left: -30px;
  animation: popIn 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.3s backwards, float 6s ease-in-out infinite 1.1s;
}

.badge-text span {
  display: block;
  font-size: 12px;
  color: var(--color-text-muted);
}

.badge-text strong {
  display: block;
  font-size: 14px;
  color: var(--color-text-main);
}

.badge-icon-blue,
.badge-icon-yellow {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.badge-icon-blue {
  background-color: #E3F2FD;
  color: #1976D2;
}

[data-theme="dark"] .badge-icon-blue {
  background-color: #0D2745;
}

.badge-icon-yellow {
  background-color: #FFF9C4;
  color: #FBC02D;
}

[data-theme="dark"] .badge-icon-yellow {
  background-color: #423506;
}

@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

@media (max-width: 768px) {
  @keyframes popInMobile {
    0% { transform: scale(0); opacity: 0; }
    70% { transform: scale(0.6); }
    100% { transform: scale(0.5); opacity: 1; }
  }

  .floating-badge {
    transform: scale(0.5);
  }
  .badge-top-right {
    top: 0px;
    right: -35px; /* Adjust slightly based on scale */
    animation: popInMobile 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards, float 6s ease-in-out infinite 0.8s;
  }
  .badge-bottom-left {
    bottom: 0px;
    left: -35px;
    animation: popInMobile 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.5s backwards, float 6s ease-in-out infinite 1.3s;
  }
  .hero-image-wrapper {
    /* make sure it does not exceed body width */
    max-width: 90vw;
  }
}

/* =========================================
   Layout: Features Section
========================================= */
.features {
  padding: var(--space-16) 0;
}

.features-header {
  text-align: center;
  margin-bottom: var(--space-12);
  max-width: 700px;
  margin-inline: auto;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-8);
}

.feature-card {
  background-color: var(--color-surface-card);
  padding: var(--space-8);
  border-radius: var(--mt-radius-lg);
  border: 1px solid var(--color-surface-border);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.feature-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
  border-color: transparent;
}

.feature-icon {
  width: 56px;
  height: 56px;
  background: var(--color-secondary-100);
  color: var(--color-secondary-500);
  border-radius: var(--mt-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: var(--space-6);
  transition: transform 0.3s ease;
}

.feature-card:hover .feature-icon {
  transform: scale(1.1) rotate(5deg);
  background: var(--color-primary-500);
  color: white;
}

@media (max-width: 1024px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .features-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================
   Layout: How It Works
========================================= */
.how-it-works {
  padding: var(--space-16) 0;
  background-color: var(--color-surface-card);
}

.steps-container {
  display: flex;
  justify-content: space-between;
  gap: var(--space-8);
  margin-top: var(--space-12);
}

.step-card {
  flex: 1;
  text-align: center;
  z-index: 1;
}

.step-number {
  width: 40px;
  height: 40px;
  background-color: var(--color-primary-500);
  color: white;
  border-radius: var(--mt-radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  margin: 0 auto var(--space-4);
}

@media (max-width: 768px) {
  .steps-container {
    flex-direction: column;
    gap: var(--space-12);
  }
}

/* =========================================
   Layout: CTA Section
========================================= */
.cta-section {
  padding: var(--space-16) 0;
}

.cta-banner {
  background-color: #0F172A;
  /* Slate 900 */
  border-radius: 32px;
  padding: var(--space-16) var(--space-8);
  text-align: center;
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-6);
  position: relative;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Top-Start Blue Accent */
.cta-banner::before {
  content: '';
  position: absolute;
  top: 0;
  inset-inline-start: 0;
  width: 100px;
  height: 100px;
  background: transparent;
  border-top: 6px solid #3B82F6;
  /* Blue 500 */
  border-inline-start: 6px solid #3B82F6;
  border-start-start-radius: 32px;
  filter: drop-shadow(0 0 10px rgba(59, 130, 246, 0.6));
}

/* Bottom-End Purple Accent */
.cta-banner::after {
  content: '';
  position: absolute;
  bottom: 0;
  inset-inline-end: 0;
  width: 100px;
  height: 100px;
  background: transparent;
  border-bottom: 6px solid #D946EF;
  /* Fuchsia 500 */
  border-inline-end: 6px solid #D946EF;
  border-end-end-radius: 32px;
  filter: drop-shadow(0 0 10px rgba(217, 70, 239, 0.6));
}

/* Ensure content stays on top of any potential background effects */
.cta-banner>* {
  position: relative;
  z-index: 2;
}

.btn-white {
  background-color: white;
  color: #0F172A;
  border: none;
}

.btn-white:hover {
  background-color: #F8FAFC;
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}


.cta-banner h2,
.cta-banner p {
  color: white;
}

.btn-white {
  background-color: white;
  color: var(--color-primary-500);
}

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

/* =========================================
   Layout: Footer
========================================= */
.footer {
  padding: var(--space-16) 0 var(--space-8);
  background-color: var(--color-surface-ground);
  border-top: 1px solid var(--color-surface-border);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-8);
  margin-bottom: var(--space-12);
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: var(--space-6);
  }
}

.footer-col h4 {
  margin-bottom: var(--space-4);
  color: var(--color-text-main);
}

.footer-links li {
  margin-bottom: var(--space-2);
  word-break: break-all;
  overflow-wrap: break-word;
}

.footer-links a {
  color: var(--color-text-body);
}

.footer-links a:hover {
  color: var(--color-primary-500);
}

.footer-bottom {
  text-align: center;
  padding-top: var(--space-8);
  border-top: 1px solid var(--color-surface-border);
  color: var(--color-text-muted);
}

/* =========================================
   Auth Pages & Forms
========================================= */
.auth-wrapper {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8) 0;
}

.auth-card {
  background: var(--color-surface-card);
  border: 1px solid var(--color-surface-border);
  border-radius: var(--mt-radius-lg);
  padding: var(--space-8);
  width: 100%;
  max-width: 480px;
  box-shadow: var(--mt-shadow-lg);
  position: relative;
  overflow: hidden;
}

/* Decorative top bar */
.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 6px;
  background: linear-gradient(90deg, var(--color-primary-500), var(--color-secondary-500));
}

.auth-header {
  text-align: center;
  margin-bottom: var(--space-8);
}

.form-group {
  margin-bottom: var(--space-6);
}

.form-group label {
  display: block;
  margin-bottom: var(--space-2);
  color: var(--color-text-main);
  font-weight: 500;
  font-size: var(--font-size-body-m);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  background-color: var(--input-bg);
  border: 2px solid var(--input-border);
  border-radius: var(--mt-radius-md);
  font-size: var(--font-size-body-m);
  color: var(--color-text-main);
  transition: all 0.2s ease;
  font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--input-focus);
  box-shadow: 0 0 0 4px rgba(0, 120, 212, 0.1);
}

/* Red border on fields that have a sibling .field-error */
.form-group:has(.field-error) input,
.form-group:has(.field-error) select,
.form-group:has(.field-error) textarea {
  border-color: #DC2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.errorlist {
  list-style: none;
  margin-top: var(--space-2);
  color: #EF4444;
  font-size: var(--font-size-small);
}

.field-error {
  display: block;
  margin-top: 6px;
  color: #DC2626;
  font-size: var(--font-size-small);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 5px;
}

.field-error::before {
  content: '\f06a'; /* fa-circle-exclamation */
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 0.8rem;
  flex-shrink: 0;
}

/* Alerts */
.alert {
  padding: var(--space-4);
  border-radius: var(--mt-radius-md);
  margin-bottom: var(--space-6);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.alert-error,
.alert-danger {
  background-color: #FEF2F2;
  color: #B91C1C;
  border: 1px solid #FECACA;
}

.alert-success {
  background-color: #ECFDF5;
  color: #047857;
  border: 1px solid #A7F3D0;
}

.alert-info {
  background-color: #EFF6FF;
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
}

.alert-warning {
  background-color: #FFFBEB;
  color: #B45309;
  border: 1px solid #FDE68A;
}

/* Auth Selection Cards */
.auth-selection-grid {
  display: grid;
  gap: var(--space-4);
}

.selection-card {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--color-surface-ground);
  border: 2px solid var(--color-surface-border);
  border-radius: var(--mt-radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.selection-card:hover {
  border-color: var(--color-primary-500);
  background-color: rgba(0, 120, 212, 0.05);
  transform: translateY(-2px);
}

.selection-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--mt-radius-full);
  background: var(--color-secondary-100);
  color: var(--color-secondary-500);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.selection-info h3 {
  font-size: var(--font-size-body-l);
  font-weight: 600;
  margin-bottom: 4px;
}

.selection-info p {
  font-size: var(--font-size-small);
  color: var(--color-text-muted);
}

/* =========================================
   Loading Overlay (Full-Card Frosted Glass)
========================================= */
@keyframes orbit-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse-scale {

  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }

  50% {
    transform: translate(-50%, -50%) scale(1.18);
    opacity: 0.55;
  }
}

.form-loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
  z-index: 10;
  border-radius: var(--mt-radius-lg);
}

[data-theme="dark"] .form-loading-overlay {
  background: rgba(11, 17, 32, 0.88);
}

.auth-card.is-loading .form-loading-overlay {
  opacity: 1;
  visibility: visible;
}

/* Orbit spinner */
.orbit-spinner {
  width: 52px;
  height: 52px;
  position: relative;
}

.orbit-spinner .orbit-ring {
  position: absolute;
  inset: 0;
  border: 3px solid rgba(0, 120, 212, 0.12);
  border-radius: 50%;
}

[data-theme="dark"] .orbit-spinner .orbit-ring {
  border-color: rgba(59, 143, 217, 0.2);
}

.orbit-spinner .orbit-dot {
  position: absolute;
  inset: 0;
  animation: orbit-spin 1.1s linear infinite;
}

.orbit-spinner .orbit-dot::after {
  content: '';
  position: absolute;
  top: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 10px;
  background: linear-gradient(135deg, var(--color-primary-500), var(--color-secondary-500));
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 120, 212, 0.5);
}

.orbit-center-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--color-primary-500);
  font-size: 17px;
  animation: pulse-scale 1.6s ease-in-out infinite;
}

.overlay-loading-text {
  font-size: var(--font-size-small);
  font-weight: 600;
  color: var(--color-text-body);
}

/* =========================================
   Mobile Aurora Design Overrides
   (Applies specifically to phones <= 768px)
========================================= */

@media (max-width: 768px) {
  /* Hide the old top-strip page transition skeleton auth elements on mobile */
  .skel-layout-auth .skel-nav { display: none; }

  /* Background adjustment to add padding for the floating navigation */
  body {
    padding-bottom: 100px; 
  }

  /* Aurora Background Glows */
  .aurora-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    pointer-events: none;
    z-index: 0;
  }
  
  .aurora-glow-1 {
    width: 250px;
    height: 250px;
    background: #38bdf8;
    top: -50px;
    right: -50px;
  }
  
  .aurora-glow-2 {
    width: 200px;
    height: 200px;
    background: #a78bfa;
    bottom: 20%;
    left: -50px;
  }

  [data-theme="dark"] .aurora-glow-1 { background: #3b82f6; opacity: 0.25; }
  [data-theme="dark"] .aurora-glow-2 { background: #8b5cf6; opacity: 0.25; }

  /* Glass/Aurora Cards specifically for Login/Register choice and Hero Feature cards */
  .auth-card,
  .choice-card,
  .feature-card,
  .step-card {
    background: rgba(255, 255, 255, 0.7) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 1) !important;
    box-shadow: 0 10px 30px rgba(14, 165, 233, 0.05) !important;
    border-radius: 24px !important;
    position: relative;
    z-index: 1;
    overflow: hidden;
  }

  [data-theme="dark"] .auth-card,
  [data-theme="dark"] .choice-card,
  [data-theme="dark"] .feature-card,
  [data-theme="dark"] .step-card {
    background: rgba(30, 41, 59, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
  }

  /* Inputs Aurora Style on Mobile */
  .form-group input {
    background: rgba(248, 250, 252, 0.8) !important;
    border: 1px solid rgba(226, 232, 240, 1) !important;
    border-radius: 16px !important;
    padding: 14px 16px !important;
    color: #1e293b !important;
    transition: all 0.3s ease;
  }

  .form-group input:focus {
    border-color: #0ea5e9 !important;
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.1) !important;
    background: #fff !important;
  }
  
  [data-theme="dark"] .form-group input {
    background: rgba(15, 23, 42, 0.6) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: white !important;
  }
  
  [data-theme="dark"] .form-group input:focus {
    border-color: #06b6d4 !important;
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.2) !important;
  }

  /* Button Aurora Style on Mobile */
  .btn-primary {
    background: linear-gradient(90deg, #0ea5e9, #3b82f6) !important;
    border-radius: 16px !important;
    box-shadow: 0 10px 20px rgba(14, 165, 233, 0.2) !important;
    border: none !important;
  }

  [data-theme="dark"] .btn-primary {
    background: linear-gradient(90deg, #06b6d4, #3b82f6) !important;
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.4) !important;
  }
}