/* ═══════════════════════════════════════════════════
   LANA — Original Green Theme + Light/Dark Mode
   ═══════════════════════════════════════════════════ */

/* ─── Light Mode (Default — Original Green) ─── */
:root {
  --lana-bg: #FFFFFF;
  --lana-blue: #27ae60;
  --lana-dark: #27ae60;
  --lana-medium: #2ecc71;
  --lana-light: #82e0aa;
  --lana-lightest: #e8f8f5;
  --card-bg: #FFFFFF;
  --card-border: #27ae60;
  --card-shadow: rgba(124, 184, 124, 0.4);
  --input-bg: #f8f9fa;
  --text-primary: #27ae60;
  --text-body: #333;
  --text-secondary: #2ecc71;
  --text-muted: #888;
  --border: #e0e0e0;
  --modal-bg: #fff;
  --danger: #e74c3c;
  --warning: #F57F17;
  --radius: 15px;
  --radius-sm: 12px;
  --radius-xs: 10px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --hub-icon-bg: #E0F0E0;
  --hub-text-bg: #FFFFFF;
  --post-hover-bg: #f0faf0;
}

@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateY(15px);
  }

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

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.animate-slide-up {
  animation: slideUpFade 0.4s cubic-bezier(0, 0, 0.2, 1) both;
}

.animate-scale-in {
  animation: scaleIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* Accessibility: Reduce Motion */
@media (prefers-reduced-motion: reduce) {

  *,
  ::before,
  ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.reduce-motion *,
.reduce-motion ::before,
.reduce-motion ::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
  scroll-behavior: auto !important;
}

/* ─── Dark Mode ─── */
[data-theme="dark"] {
  --lana-bg: #1a2e1a;
  --lana-lightest: #1e3a1e;
  --lana-light: #2a5a2a;
  --card-bg: #223322;
  --card-border: #2ecc71;
  --card-shadow: rgba(46, 204, 113, 0.2);
  --input-bg: #2a3d2a;
  --text-primary: #82e0aa;
  --text-body: #d4e8d4;
  --text-secondary: #82e0aa;
  --text-muted: #7a9a7a;
  --border: #3a5a3a;
  --modal-bg: #223322;
  --hub-icon-bg: #2a4a2a;
  --hub-text-bg: #223322;
  --post-hover-bg: #2a3d2a;
}

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

html {
  height: -webkit-fill-available;
  width: 100%;
  overflow-x: hidden;
}

body {
  background-color: var(--lana-bg);
  font-family: 'Cairo', sans-serif;
  color: var(--text-body);
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow-x: hidden;
  transition: background-color 0.4s ease, color 0.4s ease;
}

/* ─── Premium Soft UI background (Only for Dashboard) ─── */
body.dashboard-active::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(1000px 600px at 10% 10%, rgba(46, 204, 113, 0.12), transparent 70%),
    radial-gradient(800px 500px at 90% 80%, rgba(39, 174, 96, 0.1), transparent 70%),
    linear-gradient(135deg, #f0faf4 0%, #e8f8f5 100%);
}

[data-theme="dark"] body.dashboard-active::before {
  background:
    radial-gradient(1000px 600px at 10% 10%, rgba(46, 204, 113, 0.15), transparent 70%),
    radial-gradient(800px 500px at 90% 80%, rgba(39, 174, 96, 0.12), transparent 70%),
    linear-gradient(135deg, #0d1a0d 0%, #1a2e1a 100%);
}

/* ─── Soft UI & Glassmorphism Utilities ─── */
.glass {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.dark-glass {
  background: rgba(26, 46, 26, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.soft-shadow {
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.03);
}

.premium-card {
  background: #fff;
  border-radius: 32px;
  border: 1px solid rgba(0, 0, 0, 0.04);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.02);
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.premium-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.05);
}

/* ─── Theme Toggle ─── */
.theme-toggle {
  position: fixed;
  top: 0.75rem;
  left: 1.5rem;
  right: auto;
  bottom: auto;
  z-index: 9000;
  background: var(--card-bg);
  border: 3px solid var(--card-border);
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  font-size: 1.3rem;
  box-shadow: 4px 4px 0px var(--card-shadow);
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.theme-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 6px 6px 0px var(--card-shadow);
}

/* Dashboard override: Theme Toggle bottom left */
.dashboard-active .theme-toggle {
  top: auto;
  bottom: 1.5rem;
  left: 1.5rem;
  right: auto;
}

@media (max-width: 768px) {
  .dashboard-active .theme-toggle {
    top: 1rem;
    bottom: auto;
    left: 1rem;
    padding: 0.3rem 0.6rem;
    font-size: 1.1rem;
  }
}

/* ─── Loading ─── */
#loading-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.7);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

[data-theme="dark"] #loading-overlay {
  background: rgba(26, 46, 26, 0.7);
}

#loading-overlay.show {
  display: flex;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid var(--lana-lightest);
  border-top: 5px solid var(--lana-dark);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ─── Screens ─── */
.screen {
  display: none;
  width: 100%;
}

.screen.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ═══════════════════════════════════════════════════
   LOGIN PAGE (Original Green Style)
   ═══════════════════════════════════════════════════ */
.lana-container {
  width: 100%;
  max-width: 1200px;
  padding: 2rem 1rem;
  text-align: center;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-grow: 1;
  justify-content: center;
}

.lana-header {
  width: 100%;
  padding: 2rem 0;
}

.lana-header h1 {
  font-size: clamp(2rem, 8vw, 4rem);
  font-weight: 900;
  color: var(--text-primary);
  margin-bottom: 0.9rem;
  line-height: 1.2;
  text-shadow: 2px 2px 4px rgba(124, 184, 124, 0.3);
}

.lana-header p {
  font-size: 1.05em;
  color: var(--text-muted);
  margin-bottom: 2.2rem;
  line-height: 1.8;
}

.lana-subtitle {
  max-width: 680px;
  margin: 0 auto 2.2rem auto;
}

.cards-container {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 2rem;
  flex-wrap: wrap;
  width: 100%;
}

.login-card {
  flex: 1;
  min-width: 300px;
  max-width: 350px;
  background: var(--card-bg);
  border-radius: 28px;
  padding: 1.6rem 1.6rem 1.4rem;
  box-shadow: 10px 10px 0px var(--card-shadow);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 4px solid var(--card-border);
  position: relative;
  overflow: hidden;
  color: var(--text-primary);
}

.login-card::before {
  content: "";
  position: absolute;
  inset: -2px;
  background: radial-gradient(600px 220px at 50% 0%, rgba(46, 204, 113, 0.18), transparent 60%);
  pointer-events: none;
}

.login-card>* {
  position: relative;
  z-index: 1;
}

.login-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 18px 40px rgba(112, 128, 113, 0.18);
}

.card-beneficiary {
  border: 4px solid var(--lana-light);
}

.login-card .icon-box {
  width: 74px;
  height: 74px;
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4em;
  margin-bottom: 1rem;
  animation: float 3s ease-in-out infinite;
  color: var(--text-secondary);
  border: 3px solid var(--card-border);
  background: var(--lana-lightest);
  box-shadow: 6px 6px 0px rgba(124, 184, 124, 0.22);
}

.card-beneficiary h2,
.card-family h2,
.card-doctor h2 {
  color: var(--text-primary);
  font-weight: 800;
  font-size: 1.55em;
  margin-bottom: 1.1rem;
}

.login-form-box {
  background: var(--card-bg);
  border-radius: 18px;
  padding: 1.2rem 1.1rem;
  width: 100%;
  border: 3px solid var(--card-border);
  margin-top: 1rem;
  box-shadow: 4px 4px 0px rgba(124, 184, 124, 0.14);
}

/* ─── Buttons (Original Style) ─── */
button.action-btn {
  width: auto;
  min-width: 140px;
  border-radius: 14px;
  padding: 0.65rem 1.4rem;
  font-family: 'Cairo', sans-serif;
  font-weight: 800;
  border: 3px solid var(--card-border);
  cursor: pointer;
  transition: var(--transition);
  font-size: 1.05rem;
  margin-top: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-yellow {
  background: var(--lana-lightest);
  color: var(--text-primary);
}

.btn-green {
  background: var(--lana-blue);
  color: white;
}

.btn-blue {
  background: var(--lana-dark);
  color: white;
}

button.action-btn:hover {
  transform: translateY(-3px);
  box-shadow: 4px 4px 0px var(--card-border);
}

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

/* Small button for post actions */
.btn-sm {
  padding: 0.3rem 0.8rem;
  font-size: 0.85rem;
  min-width: auto;
  margin: 0;
  border-width: 2px;
}

.btn-ghost-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 42px;
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(241,248,244,0.96));
  color: var(--text-primary);
  border: 1px solid rgba(45, 106, 79, 0.14);
  border-radius: 999px;
  padding: 0.45rem 1rem;
  font-size: 0.9rem;
  cursor: pointer;
  font-family: 'Cairo';
  font-weight: 800;
  transition: var(--transition);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.btn-ghost-sm:hover {
  border-color: rgba(45, 106, 79, 0.24);
  background: linear-gradient(180deg, rgba(255,255,255,1), rgba(233,248,239,1));
  transform: translateY(-2px);
}

/* Universal .btn (used in app3/app4) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  padding: 0.6rem 1.5rem;
  font-family: 'Cairo', sans-serif;
  font-weight: 800;
  border: 3px solid var(--card-border);
  cursor: pointer;
  transition: var(--transition);
  font-size: 1rem;
  margin-top: 0.5rem;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 4px 4px 0px var(--card-shadow);
}

.btn-primary {
  background: var(--lana-blue);
  color: #fff;
  border-color: var(--lana-dark);
}

.btn-primary:hover {
  background: var(--lana-medium);
}

.btn-ghost {
  background: var(--card-bg);
  color: var(--text-primary);
  border-color: var(--card-border);
}

.btn-ghost:hover {
  background: var(--lana-lightest);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

.btn.btn-sm {
  padding: 0.35rem 1rem;
  font-size: 0.85rem;
  margin: 0;
  border-width: 2px;
}

/* ─── Inputs (Original Style) ─── */
input,
textarea,
select {
  background: var(--input-bg) !important;
  border: 2px solid var(--card-border) !important;
  border-radius: 12px !important;
  color: var(--text-body) !important;
  margin-bottom: 1rem;
  font-family: 'Cairo', sans-serif;
  height: 3rem !important;
  padding: 0 1rem !important;
  font-size: 1rem !important;
  width: 100%;
  transition: var(--transition);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

input:focus,
textarea:focus {
  border-color: var(--lana-medium) !important;
  outline: none;
  box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.2);
}

textarea {
  height: auto !important;
  resize: vertical;
  min-height: 100px;
  padding: 1rem !important;
}

/* ─── PIN (Original Style) ─── */
.pin-display-embedded {
  background: var(--card-bg);
  border-radius: 12px;
  height: 50px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2em;
  margin-bottom: 1rem;
  color: var(--text-primary);
  letter-spacing: 5px;
  border: 2px solid var(--card-border);
  box-shadow: inset 0 0 0 2px rgba(46, 204, 113, 0.06);
}

.pin-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.pin-row {
  display: flex;
  flex-direction: row-reverse;
  gap: 8px;
  width: 100%;
}

.pin-num {
  flex: 1;
  background: var(--lana-lightest);
  border: 2px solid var(--card-border);
  border-radius: 10px;
  font-size: 1.2em;
  font-weight: bold;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  cursor: pointer;
  padding: 0;
  font-family: 'Cairo', sans-serif;
  transition: var(--transition);
}

.pin-num:hover {
  background: var(--lana-dark);
  color: white;
  transform: translateY(-2px);
}

.pin-num:active {
  transform: scale(0.95);
}

/* ─── Messages ─── */
.error-message {
  color: var(--text-primary);
  background: var(--lana-lightest);
  padding: 0.8rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  display: none;
  font-weight: 600;
  border: 1px solid var(--card-border);
}

.error-message.show {
  display: block;
}

.success-message {
  color: #388e3c;
  background: #e8f5e9;
  padding: 0.8rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  display: none;
  font-weight: 600;
}

.error-message.show,
.success-message.show {
  animation: fadeIn 0.25s ease-out;
}

.success-message.show {
  display: block;
}

/* ─── Form ─── */
.form-group {
  text-align: right;
  margin-bottom: 0.5rem;
}

.form-group label {
  display: block;
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 0.95em;
}

.terms-checkbox {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 1rem 0 1.5rem 0;
  justify-content: flex-end;
  color: var(--text-secondary);
}

.terms-checkbox input {
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  color: var(--text-primary);
  cursor: pointer;
  margin-bottom: 1.5rem;
  min-height: 44px;
  padding: 0.55rem 1rem;
  font-size: 0.95rem;
  font-weight: 800;
  transition: var(--transition);
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(241,248,244,0.96));
  border: 1px solid rgba(45, 106, 79, 0.14);
  border-radius: 999px;
  font-family: 'Cairo';
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.back-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(45, 106, 79, 0.24);
  background: linear-gradient(180deg, rgba(255,255,255,1), rgba(233,248,239,1));
}

/* Make back button feel like a pill on auth screens */
.screen:not(#dashboard-overlay) .back-btn {
  background: var(--card-bg);
  border: 1px solid rgba(45, 106, 79, 0.18);
  padding: 0.55rem 1rem;
  border-radius: 999px;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.screen:not(#dashboard-overlay) .back-btn:hover {
  transform: translateY(-2px);
}

/* ═══════════════════════════════════════════════════
   LANA THEMED SWEETALERT2
   ═══════════════════════════════════════════════════ */

/* Popup container */
.lana-swal-popup {
  font-family: 'Cairo', sans-serif !important;
  border-radius: 24px !important;
  border: 3px solid var(--card-border) !important;
  background: var(--card-bg) !important;
  color: var(--text-body) !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(46, 204, 113, 0.08) !important;
  padding: 2rem 1.5rem 1.5rem !important;
  max-width: 420px !important;
}

/* Backdrop */
.swal2-backdrop-show {
  background: rgba(0, 0, 0, 0.45) !important;
  backdrop-filter: blur(4px) !important;
  -webkit-backdrop-filter: blur(4px) !important;
}

/* Title */
.lana-swal-title {
  font-family: 'Cairo', sans-serif !important;
  font-weight: 900 !important;
  color: var(--text-primary) !important;
  font-size: 1.35rem !important;
  line-height: 1.5 !important;
}

/* HTML Content */
.lana-swal-html {
  font-family: 'Cairo', sans-serif !important;
  color: var(--text-body) !important;
  font-size: 1.05rem !important;
  line-height: 1.7 !important;
  font-weight: 600 !important;
}

/* Icon tweaks */
.lana-swal-icon {
  border-width: 3px !important;
  margin: 0 auto 1rem !important;
}

.lana-swal-popup .swal2-icon.swal2-success {
  border-color: var(--lana-medium) !important;
  color: var(--lana-blue) !important;
}

.lana-swal-popup .swal2-icon.swal2-success .swal2-success-ring {
  border-color: rgba(46, 204, 113, 0.3) !important;
}

.lana-swal-popup .swal2-icon.swal2-success .swal2-success-line-tip,
.lana-swal-popup .swal2-icon.swal2-success .swal2-success-line-long {
  background-color: var(--lana-blue) !important;
}

.lana-swal-popup .swal2-icon.swal2-error {
  border-color: var(--danger) !important;
}

.lana-swal-popup .swal2-icon.swal2-warning {
  border-color: var(--warning) !important;
  color: var(--warning) !important;
}

.lana-swal-popup .swal2-icon.swal2-info {
  border-color: var(--lana-medium) !important;
  color: var(--lana-medium) !important;
}

/* Actions */
.lana-swal-actions {
  gap: 0.8rem !important;
  margin-top: 1.2rem !important;
}

/* Confirm button */
.lana-swal-confirm {
  font-family: 'Cairo', sans-serif !important;
  font-weight: 800 !important;
  font-size: 1rem !important;
  padding: 0.7rem 2rem !important;
  border-radius: 14px !important;
  border: 3px solid var(--card-border) !important;
  background: var(--lana-blue) !important;
  color: #fff !important;
  cursor: pointer !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  min-width: 120px !important;
}

.lana-swal-confirm:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 20px rgba(39, 174, 96, 0.35) !important;
  background: var(--lana-medium) !important;
}

.lana-swal-confirm:active {
  transform: translateY(0) !important;
}

/* Cancel button */
.lana-swal-cancel {
  font-family: 'Cairo', sans-serif !important;
  font-weight: 700 !important;
  font-size: 1rem !important;
  padding: 0.7rem 2rem !important;
  border-radius: 14px !important;
  border: 3px solid var(--border) !important;
  background: var(--card-bg) !important;
  color: var(--text-primary) !important;
  cursor: pointer !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  min-width: 100px !important;
}

.lana-swal-cancel:hover {
  transform: translateY(-2px) !important;
  border-color: var(--card-border) !important;
  background: var(--lana-lightest) !important;
}

/* Animations */
@keyframes lanaSwalShow {
  from {
    opacity: 0;
    transform: scale(0.85) translateY(20px);
  }

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

@keyframes lanaSwalHide {
  from {
    opacity: 1;
    transform: scale(1) translateY(0);
  }

  to {
    opacity: 0;
    transform: scale(0.85) translateY(20px);
  }
}

.lana-swal-show {
  animation: lanaSwalShow 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

.lana-swal-hide {
  animation: lanaSwalHide 0.2s ease-in !important;
}

/* Timer progress bar */
.lana-swal-popup .swal2-timer-progress-bar {
  background: var(--lana-medium) !important;
}

/* Close button */
.lana-swal-popup .swal2-close {
  color: var(--text-muted) !important;
  font-size: 1.5rem !important;
  transition: color 0.2s !important;
}

.lana-swal-popup .swal2-close:hover {
  color: var(--danger) !important;
}

/* ═══════════════════════════════════════════════════════════
   NEURODIVERGENT ACCESSIBILITY MODES
   Dyslexia · Calm (ASD/Anxiety) · Focus (ADHD)
   ═══════════════════════════════════════════════════════════ */

/* ─── Dyslexia Mode ──────────────────────────────────────── */
/* Improves readability with wider spacing, higher line-height,
   and a highly legible sans-serif font stack.                */
[data-a11y-dyslexia="true"] {
  --dyslexia-letter-spacing: 0.08em;
  --dyslexia-word-spacing: 0.16em;
  --dyslexia-line-height: 1.9;
}

[data-a11y-dyslexia="true"] body,
[data-a11y-dyslexia="true"] p,
[data-a11y-dyslexia="true"] span,
[data-a11y-dyslexia="true"] a,
[data-a11y-dyslexia="true"] li,
[data-a11y-dyslexia="true"] td,
[data-a11y-dyslexia="true"] th,
[data-a11y-dyslexia="true"] label,
[data-a11y-dyslexia="true"] button,
[data-a11y-dyslexia="true"] input,
[data-a11y-dyslexia="true"] textarea,
[data-a11y-dyslexia="true"] h1,
[data-a11y-dyslexia="true"] h2,
[data-a11y-dyslexia="true"] h3,
[data-a11y-dyslexia="true"] h4,
[data-a11y-dyslexia="true"] h5,
[data-a11y-dyslexia="true"] h6 {
  letter-spacing: var(--dyslexia-letter-spacing) !important;
  word-spacing: var(--dyslexia-word-spacing) !important;
  line-height: var(--dyslexia-line-height) !important;
}

[data-a11y-dyslexia="true"] p,
[data-a11y-dyslexia="true"] span,
[data-a11y-dyslexia="true"] a,
[data-a11y-dyslexia="true"] li,
[data-a11y-dyslexia="true"] td,
[data-a11y-dyslexia="true"] label,
[data-a11y-dyslexia="true"] input,
[data-a11y-dyslexia="true"] textarea {
  font-family: 'Cairo', 'Segoe UI', 'Tahoma', sans-serif !important;
}

/* Subtle underline for links to improve distinction */
[data-a11y-dyslexia="true"] a {
  text-decoration: underline !important;
  text-underline-offset: 4px !important;
}

/* ─── Calm Mode (ASD / Anxiety) ──────────────────────────── */
/* Replaces saturated colors with soft pastels and muted tones
   to reduce sensory overload. Avoids pure black-on-white.    */
[data-a11y-calm="true"] {
  --lana-bg: #f7f5f0;
  --lana-blue: #7ba896;
  --lana-dark: #7ba896;
  --lana-medium: #8fbfaa;
  --lana-light: #b8d8cc;
  --lana-lightest: #eef3f0;
  --card-bg: #faf9f6;
  --card-border: #b8d8cc;
  --card-shadow: rgba(139, 179, 163, 0.25);
  --input-bg: #f2f0eb;
  --text-primary: #5a7a6d;
  --text-body: #4a5548;
  --text-secondary: #7ba896;
  --text-muted: #8a9a90;
  --border: #d4ddd8;
  --modal-bg: #faf9f6;
  --danger: #c97a7a;
  --warning: #c9a96a;
  --hub-icon-bg: #e8ede9;
  --hub-text-bg: #faf9f6;
  --post-hover-bg: #f0f3f1;
}

[data-a11y-calm="true"] body::before {
  background:
    radial-gradient(900px 520px at 15% 10%, rgba(139, 179, 163, 0.12), transparent 60%),
    radial-gradient(700px 420px at 90% 20%, rgba(184, 216, 204, 0.10), transparent 60%),
    linear-gradient(180deg, rgba(247, 245, 240, 0.7), rgba(250, 249, 246, 0)) !important;
}

/* Calm + Dark mode */
[data-a11y-calm="true"][data-theme="dark"] {
  --lana-bg: #1e2420;
  --lana-lightest: #273029;
  --lana-light: #3a4f41;
  --card-bg: #242d26;
  --card-border: #5a7a6d;
  --card-shadow: rgba(90, 122, 109, 0.2);
  --input-bg: #2a3530;
  --text-primary: #a8c8b8;
  --text-body: #c0d0c4;
  --text-secondary: #a8c8b8;
  --text-muted: #6a8a78;
  --border: #3a5044;
  --modal-bg: #242d26;
  --hub-icon-bg: #2a3a2e;
  --hub-text-bg: #242d26;
  --post-hover-bg: #2a3530;
}

[data-a11y-calm="true"][data-theme="dark"] body::before {
  background:
    radial-gradient(900px 520px at 15% 10%, rgba(90, 122, 109, 0.10), transparent 60%),
    radial-gradient(700px 420px at 90% 20%, rgba(168, 200, 184, 0.06), transparent 60%),
    linear-gradient(180deg, rgba(30, 36, 32, 0.65), rgba(36, 45, 38, 0)) !important;
}

/* Soften gradients & bold colors inside calm mode */
[data-a11y-calm="true"] .stats-section,
[data-a11y-calm="true"] .hero-section {
  filter: saturate(0.55) !important;
}

[data-a11y-calm="true"] .bento-card.bento-dark {
  background: #3a4f41 !important;
}

/* ─── Focus Mode (ADHD) ──────────────────────────────────── */
/* Applies grayscale filter, reduces visual clutter, removes
   non-essential animations, and increases contrast.          */
[data-a11y-focus="true"] {
  --transition: none !important;
  --transition-slow: none !important;
  --transition-fast: none !important;
}

[data-a11y-focus="true"] *,
[data-a11y-focus="true"] *::before,
[data-a11y-focus="true"] *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
  scroll-behavior: auto !important;
}

/* Light grayscale overlay to reduce color distractions */
[data-a11y-focus="true"] body {
  filter: grayscale(0.6) contrast(1.08);
}

/* Keep interactive buttons and active element colorful */
[data-a11y-focus="true"] button:hover,
[data-a11y-focus="true"] button:focus-visible,
[data-a11y-focus="true"] a:hover,
[data-a11y-focus="true"] a:focus-visible,
[data-a11y-focus="true"] .nav-item.active,
[data-a11y-focus="true"] .mobile-nav-item.active {
  filter: grayscale(0) !important;
}

/* Hide purely decorative elements to reduce clutter */
[data-a11y-focus="true"] body::before,
[data-a11y-focus="true"] .hero-spline-bg,
[data-a11y-focus="true"] .helpyy-spline-bg,
[data-a11y-focus="true"] .helpyy-badge-ping,
[data-a11y-focus="true"] .auth-card-glow,
[data-a11y-focus="true"] .reg-card-glow {
  display: none !important;
}

/* Stronger borders for navigation separation */
[data-a11y-focus="true"] .dash-sidebar {
  border-left: 3px solid var(--border) !important;
}

[data-a11y-focus="true"] .bento-card {
  border: 2px solid var(--border) !important;
}

/* High-contrast text in focus mode */
[data-a11y-focus="true"] .text-muted,
[data-a11y-focus="true"] .bento-bar-label,
[data-a11y-focus="true"] .bento-progress-sub {
  color: var(--text-body) !important;
  opacity: 1 !important;
}

/* ─── Combined: Calm + Focus ─────────────────────────────── */
[data-a11y-calm="true"][data-a11y-focus="true"] body {
  filter: grayscale(0.5) contrast(1.05) saturate(0.6);
}
