/* =========================================
   Modern Trust - Design Tokens
   Based on docs/design/README.md (retired 'Modern Trust' palette: this file was
   never migrated to the Vital tokens in static/css/src/input.css)
========================================= */
: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-muted {
  color: var(--color-text-muted);
}

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

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

/* =========================================
   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;
}


/* =========================================
   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);
}

/* Reserves space for the fixed .v-tabbar (input.css §4) on mobile. accounts/base.html's
   <body> carries no pb-* utility, so this is the only bottom inset on all 73 pages that
   extend it — do not remove. (It used to name .mobile-nav-glass, the pre-Vital floating
   nav, which is gone.) */
@media (max-width: 768px) {
  body {
    padding-bottom: 90px;
  }
}

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

/* =========================================
   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);
}

/* =========================================
   Auth Pages & Forms
========================================= */
.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));
}

.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;
}

/* =========================================
   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; }

  /* Bottom inset for the fixed .v-tabbar; overrides the 90px set above. Do not remove. */
  body {
    padding-bottom: 100px; 
  }

  /* Glass/Aurora Cards for the Login/Register choice cards. .auth-card and .step-card
     still carry base definitions above; .feature-card lost its base with the Features
     section, so that selector is now inert and kept only to avoid churning the list. */
  .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;
  }
}