/* ==========================================================================
   myMoney - Pure Standalone CSS
   Crafted without external CSS framework dependencies.
   Supports Light & Dark Modes, Responsive Layouts, and Micro-interactions.
   ========================================================================== */

/* Local Inter Variable Font */
@font-face {
  font-family: 'Inter Local';
  src: url('../assets/fonts/inter-variable.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-stretch: 75% 125%;
  font-display: swap;
  font-style: normal;
}

/* --- CSS Variables & Design Tokens --- */
:root {
  /* Color Palette - Light Mode */
  --bg-app: #fafafa;
  --bg-card: rgba(255, 255, 255, 0.92);
  --bg-card-subtle: rgba(255, 255, 255, 0.82);
  --bg-input: #f4f4f5;
  --bg-input-focus: #ffffff;
  --bg-tab-bar: #f4f4f5;
  --bg-tab-active: #ffffff;
  --bg-badge: #f4f4f5;
  --bg-callout: rgba(244, 244, 245, 0.85);

  --text-primary: #18181b;
  --text-secondary: #52525b;
  --text-muted: #71717a;
  --text-placeholder: #a1a1aa;

  --border-subtle: rgba(228, 228, 231, 0.8);
  --border-card: rgba(228, 228, 231, 0.9);
  --border-input: #d4d4d8;

  /* Accent Colors (Emerald) */
  --emerald-50: #ecfdf5;
  --emerald-100: #d1fae5;
  --emerald-500: #10b981;
  --emerald-600: #059669;
  --emerald-700: #047857;
  --emerald-glow: rgba(16, 185, 129, 0.2);

  /* Semantic Colors for Form Messages */
  --semantic-success: #16a34a;  /* emerald-600 */
  --semantic-error: #dc2626;    /* red-600 */

  /* Feature Card Accents */
  --amber-500: #f59e0b;
  --amber-bg: rgba(245, 158, 11, 0.12);
  --blue-500: #3b82f6;
  --blue-bg: rgba(59, 130, 246, 0.12);
  --purple-500: #8b5cf6;
  --purple-bg: rgba(139, 92, 246, 0.12);

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);

  /* Border Radii */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.25rem;
  --radius-full: 9999px;

  /* Typography */
  /* Uses local Inter variable font (weights 100-900) */
  --font-sans: 'Inter Local', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Dark Mode Tokens */
.dark {
  --bg-app: #09090b;
  --bg-card: rgba(24, 24, 27, 0.92);
  --bg-card-subtle: rgba(24, 24, 27, 0.82);
  --bg-input: rgba(39, 39, 42, 0.65);
  --bg-input-focus: rgba(39, 39, 42, 0.95);
  --bg-tab-bar: rgba(39, 39, 42, 0.75);
  --bg-tab-active: #27272a;
  --bg-badge: #27272a;
  --bg-callout: rgba(24, 24, 27, 0.65);

  --text-primary: #ffffff;
  --text-secondary: #e4e4e7;
  --text-muted: #a1a1aa;
  --text-placeholder: #71717a;

  --border-subtle: rgba(39, 39, 42, 0.8);
  --border-card: rgba(39, 39, 42, 0.9);
  --border-input: #3f3f46;

  --emerald-500: #34d399;
  --emerald-600: #10b981;
  --emerald-700: #059669;
  --emerald-glow: rgba(52, 211, 153, 0.25);

  /* Semantic Colors for Form Messages (Dark Mode) */
  --semantic-success: #4ade80;  /* emerald-400 */
  --semantic-error: #f87171;    /* red-400 */

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.45);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.55);
}

/* --- Base & Reset --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-sans);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  background-color: var(--bg-app);
  color: var(--text-primary);
  line-height: 1.5;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  overflow-x: hidden;
}

::selection {
  background-color: var(--emerald-600);
  color: #ffffff;
}

.dark ::selection {
  background-color: var(--emerald-500);
  color: #09090b;
}

/* Background Canvas */
#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
}

/* --- Layout Containers --- */
.page-container {
  position: relative;
  z-index: 10;
  width: 100%;
  min-height: 100vh;
  padding: 6.5rem 1rem 8.5rem 1rem;
}

@media (min-width: 640px) {
  .page-container {
    padding: 7rem 1.5rem 8.75rem 1.5rem;
  }
}

@media (min-width: 1024px) {
  .page-container {
    padding: 7rem 2rem 8.75rem 2rem;
  }
}

.max-width-wrapper {
  max-width: 72rem;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

/* Two-column layout */
.portal-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: start;
}

/* Responsive Ordering: Auth Card ALWAYS appears first on mobile and tablet */
.portal-col-auth {
  order: 1;
  width: 100%;
}

.portal-col-content {
  order: 2;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  text-align: left;
}

/* Desktop layout (>= 1024px) */
@media (min-width: 1024px) {
  .portal-grid {
    grid-template-columns: 5fr 7fr;
    gap: 3rem;
  }

  .portal-col-auth {
    position: sticky;
    top: 5.75rem;
    align-self: flex-start;
  }
}

/* --- Floating Header --- */
.floating-header-wrapper {
  position: fixed;
  top: 0.75rem;
  left: 0;
  right: 0;
  z-index: 40;
  padding: 0 0.75rem;
  pointer-events: none;
}

@media (min-width: 640px) {
  .floating-header-wrapper {
    top: 1rem;
    padding: 0 1.5rem;
  }
}

.floating-header-card {
  max-width: 72rem;
  margin: 0 auto;
  pointer-events: auto;
  background-color: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-lg);
  padding: 0.625rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.3s ease;
}

@media (min-width: 640px) {
  .floating-header-card {
    padding: 0.75rem 1.25rem;
  }
}

/* Brand Link & Logo */
.brand-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: inherit;
  outline: none;
}

.brand-icon-box {
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-lg);
  background: transparent; /* Removed gradient - logo image provides branding */
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: none; /* Removed shadow - logo provides its own visual weight */
  transition: transform 0.2s ease;
}

@media (min-width: 640px) {
  .brand-icon-box {
    width: 2.25rem;
    height: 2.25rem;
  }
}

/* Logo image inside brand icon box */
.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: var(--radius-md);
}

.brand-link:hover .brand-icon-box {
  transform: scale(1.08);
}

#brand-wordmark.brand-wordmark {
  font-size: 1.375rem;
  letter-spacing: -0.025em;
  display: inline-flex;
  align-items: baseline;
}

@media (min-width: 640px) {
  #brand-wordmark.brand-wordmark {
    font-size: 1.5rem;
  }
}

/* ==========================================================================
   Universal App Wordmark ("myMoney") Standard
   * "my" in myMoney is always lowercase, lighter weight (200), and muted color.
   * "Money" in myMoney is always capitalized, heavier weight (700), and accent color.
   * Both are always written together as one word with font size inherited from context.
   ========================================================================== */
.wordmark {
  display: inline;
  white-space: nowrap;
  font-size: inherit;
  letter-spacing: inherit;
  line-height: inherit;
}

.wordmark .wm-my {
  font-weight: 200;
  color: var(--text-muted);
  transition: color 0.15s ease;
}

.wordmark .wm-money {
  font-weight: 700;
  color: var(--emerald-600);
  transition: color 0.15s ease;
}

.dark .wordmark .wm-money {
  color: var(--emerald-500);
}

/* Specific context: Inside primary button with emerald background */
.btn-submit .wordmark .wm-my {
  color: rgba(255, 255, 255, 0.75);
}

.btn-submit .wordmark .wm-money {
  color: #a7f3d0;
}

/* Header Center Tagline */
.header-center-text-box {
  display: none;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 0.5rem;
}

@media (min-width: 640px) {
  .header-center-text-box {
    display: flex;
  }
}

.header-center-text {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--emerald-600);
}

.dark .header-center-text {
  color: var(--emerald-500);
}

@media (min-width: 768px) {
  .header-center-text {
    font-size: 0.8125rem;
  }
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.theme-toggle-btn {
  padding: 0.5rem;
  border-radius: var(--radius-lg);
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.theme-toggle-btn:hover {
  color: var(--text-primary);
  background-color: var(--bg-badge);
}

.theme-toggle-btn svg {
  width: 1.125rem;
  height: 1.125rem;
}

.btn-header-signin {
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: inherit;
  background-color: var(--emerald-600);
  color: #ffffff;
  padding: 0.4rem 0.875rem;
  border-radius: var(--radius-lg);
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
}

.btn-header-signin:hover {
  background-color: var(--emerald-500);
  box-shadow: var(--shadow-md);
}

.btn-header-signin:active {
  transform: scale(0.98);
}

@media (min-width: 640px) {
  .btn-header-signin {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }
}

/* --- Auth Card --- */
.auth-card {
  background-color: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-xl);
  padding: 1.25rem;
  transition: all 0.25s ease;
}

@media (min-width: 640px) {
  .auth-card {
    padding: 1.75rem;
  }
}

.auth-card-title {
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
}

@media (min-width: 640px) {
  .auth-card-title {
    font-size: 1.5rem;
  }
}

/* Tab Navigation Switcher */
.tab-switcher {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem;
  background-color: var(--bg-tab-bar);
  padding: 0.35rem;
  border-radius: var(--radius-xl);
  margin-bottom: 1.35rem;
  border: 1px solid var(--border-subtle);
  position: relative;
}

.tab-btn {
  position: relative;
  padding: 0.55rem 0.5rem;
  font-size: 0.875rem;
  font-family: inherit;
  font-weight: 500;
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  text-align: center;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  letter-spacing: 0.01em;
}

.tab-btn:hover:not(.active) {
  color: var(--text-primary);
  background-color: rgba(0, 0, 0, 0.04);
}

.dark .tab-btn:hover:not(.active) {
  background-color: rgba(255, 255, 255, 0.06);
}

/* Highly Prominent Selected Tab on Auth Card */
.tab-btn.active {
  background: linear-gradient(135deg, var(--emerald-600) 0%, var(--emerald-500) 100%);
  color: #ffffff !important;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.38), 0 1px 3px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.dark .tab-btn.active {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 4px 18px rgba(16, 185, 129, 0.44), 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Tab Panels */
.tab-panel {
  display: block;
}

.tab-panel.hidden {
  display: none !important;
}

.tab-transition {
  animation: fadeIn 0.2s ease-in-out;
}

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

.tab-intro-text {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.5;
}

@media (min-width: 640px) {
  .tab-intro-text {
    font-size: 0.875rem;
  }
}

/* Forms */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.375rem;
}

.form-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.375rem;
}

.form-input-wrapper {
  position: relative;
}

.form-input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  font-family: inherit;
  border-radius: var(--radius-lg);
  background-color: var(--bg-input);
  border: 1px solid var(--border-input);
  color: var(--text-primary);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
  outline: none;
}

.form-input::placeholder {
  color: var(--text-placeholder);
}

.form-input:focus {
  background-color: var(--bg-input-focus);
  border-color: var(--emerald-500);
  box-shadow: 0 0 0 3px var(--emerald-glow);
}

.form-input.has-right-icon {
  padding-right: 2.5rem;
}

/* Password Visibility Toggle */
.password-toggle-btn {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-placeholder);
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.password-toggle-btn:hover {
  color: var(--text-primary);
}

.password-toggle-btn svg {
  width: 1rem;
  height: 1rem;
}

/* Password Strength Meter */
.strength-container {
  margin-top: 0.375rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.strength-bar-bg {
  height: 0.375rem;
  flex: 1;
  background-color: var(--border-input);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.strength-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.3s ease, background-color 0.3s ease;
  width: 0%;
}

.strength-label {
  font-size: 0.6875rem;
  font-weight: 500;
}

/* Password strength dynamic colors */
.bg-red-500 { background-color: #ef4444 !important; }
.text-red-500 { color: #ef4444 !important; }
.bg-amber-500 { background-color: #f59e0b !important; }
.text-amber-500 { color: #f59e0b !important; }
.bg-blue-500 { background-color: #3b82f6 !important; }
.text-blue-500 { color: #3b82f6 !important; }
.bg-emerald-500 { background-color: #10b981 !important; }
.text-emerald-500 { color: #10b981 !important; }

/* Checkbox Row */
.checkbox-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  padding-top: 0.25rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  color: var(--text-secondary);
  user-select: none;
}

.checkbox-input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--emerald-600);
  cursor: pointer;
}

/* Form Buttons */
.btn-submit {
  width: 100%;
  padding: 0.65rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius-lg);
  border: none;
  cursor: pointer;
  color: #ffffff;
  background-color: var(--emerald-600);
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
  margin-top: 0.5rem;
}

.btn-submit:hover {
  background-color: var(--emerald-500);
  box-shadow: var(--shadow-md);
}

.btn-submit:active {
  transform: scale(0.98);
}

.btn-submit-dark {
  background-color: #18181b;
  color: #ffffff;
}

.btn-submit-dark:hover {
  background-color: #27272a;
}

.dark .btn-submit-dark {
  background-color: #f4f4f5;
  color: #18181b;
}

.dark .btn-submit-dark:hover {
  background-color: #ffffff;
}

/* Links inside Form */
.form-footer-text {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  padding-top: 0.5rem;
}

.link-btn {
  background: transparent;
  border: none;
  color: var(--emerald-600);
  font-weight: 600;
  font-size: inherit;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  padding: 0;
}

.dark .link-btn {
  color: var(--emerald-500);
}

.link-btn:hover {
  text-decoration: underline;
}

.link-btn-subtle {
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 500;
}

.link-btn-subtle:hover {
  color: var(--text-primary);
  text-decoration: none;
}

/* Card Pulse Animation */
@keyframes card-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0.25);
  }
}

.auth-card-highlight {
  animation: card-pulse 1.2s cubic-bezier(0.4, 0, 0.6, 1) 2;
}

/* Shake Animation for Error Feedback */
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-2px); }
  40%, 60% { transform: translateX(2px); }
}
.shake { animation: shake 0.4s cubic-bezier(.36, 0, .058, .07) both; }

/* Inline Form Message Styles */
.form-msg {
  margin: 0.5rem 0 0;
  min-height: 1.25em;
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 500;
}
.form-msg.ok { color: var(--semantic-success); }
.form-msg.err { color: var(--semantic-error); }

/* --- Right Column Content --- */
.hero-headline {
  font-size: 1.875rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1.18;
}

@media (min-width: 640px) {
  .hero-headline {
    font-size: 2.25rem;
  }
}

@media (min-width: 1024px) {
  .hero-headline {
    font-size: 2.75rem;
  }
}

.hero-headline .accent {
  color: var(--emerald-600);
}

.dark .hero-headline .accent {
  color: var(--emerald-500);
}

.lead-subheadline {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}

@media (min-width: 640px) {
  .lead-subheadline {
    font-size: 1.25rem;
  }
}

.description-paragraph {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

@media (min-width: 640px) {
  .description-paragraph {
    font-size: 1rem;
  }
}

/* 4 Subcards Grid */
.subcards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  padding-top: 0.5rem;
  padding-bottom: 0.25rem;
}

@media (min-width: 640px) {
  .subcards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.subcard-item {
  padding: 1rem;
  border-radius: var(--radius-xl);
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  cursor: pointer;
}

.subcard-item:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* Card specific accents */
.subcard-item.card-salary:hover {
  border-color: rgba(16, 185, 129, 0.45);
}

.subcard-item.card-brownies:hover {
  border-color: rgba(245, 158, 11, 0.45);
}

.subcard-item.card-savings:hover {
  border-color: rgba(59, 130, 246, 0.45);
}

.subcard-item.card-family:hover {
  border-color: rgba(139, 92, 246, 0.45);
}

/* Ring highlight effect on click */
.subcard-item.ring-highlight {
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.6) !important;
}

.subcard-header {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 0.5rem;
}

.subcard-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
}

.subcard-icon svg,
.subcard-icon .material-icons {
  width: 1.5rem;
  height: 1.5rem;
  font-size: 1.5rem;
  line-height: 1;
}

.icon-emerald {
  color: var(--emerald-600);
}
.dark .icon-emerald { color: var(--emerald-500); }

.icon-amber {
  color: var(--amber-500);
}

.icon-blue {
  color: var(--blue-500);
}

.icon-purple {
  color: var(--purple-500);
}

.subcard-title {
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  transition: color 0.15s ease;
}

.subcard-item.card-salary:hover .subcard-title { color: var(--emerald-600); }
.dark .subcard-item.card-salary:hover .subcard-title { color: var(--emerald-500); }

.subcard-item.card-brownies:hover .subcard-title { color: var(--amber-500); }
.subcard-item.card-savings:hover .subcard-title { color: var(--blue-500); }
.subcard-item.card-family:hover .subcard-title { color: var(--purple-500); }

.subcard-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* Closing Paragraph */
.closing-paragraph {
  margin-top: 0.5rem;
}

/* --- Floating Footer --- */
.floating-footer-wrapper {
  position: fixed;
  bottom: 0.75rem;
  left: 0;
  right: 0;
  z-index: 40;
  padding: 0 0.75rem;
  pointer-events: none;
}

@media (min-width: 640px) {
  .floating-footer-wrapper {
    bottom: 1rem;
    padding: 0 1.5rem;
  }
}

.floating-footer-card {
  max-width: 72rem;
  margin: 0 auto;
  pointer-events: auto;
  background-color: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-lg);
  padding: 0.625rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-secondary);
  transition: all 0.3s ease;
}

@media (min-width: 640px) {
  .floating-footer-card {
    padding: 0.75rem 1.5rem;
  }
}

.footer-copyright {
  font-weight: 500;
  color: var(--text-secondary);
}

.footer-version {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  font-family: inherit;
  background: none;
  border: none;
  padding: 0;
}

/* --- Toast Notifications --- */
#toast-container {
  position: fixed;
  top: 5rem;
  right: 1rem;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
  max-width: 24rem;
  width: calc(100% - 2rem);
}

@media (min-width: 640px) {
  #toast-container {
    right: 1.5rem;
    width: 100%;
  }
}

.toast-item {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  width: 100%;
  padding: 0.875rem 1rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.3s ease;
  transform: translateY(0.5rem);
  opacity: 0;
}

.toast-item.toast-visible {
  transform: translateY(0);
  opacity: 1;
}

.toast-success {
  background-color: rgba(236, 253, 245, 0.95);
  border-color: #a7f3d0;
  color: #064e3b;
}

.dark .toast-success {
  background-color: rgba(6, 78, 59, 0.9);
  border-color: #047857;
  color: #ecfdf5;
}

.toast-info {
  background-color: rgba(24, 24, 27, 0.95);
  border-color: #3f3f46;
  color: #ffffff;
}

.dark .toast-info {
  background-color: rgba(255, 255, 255, 0.95);
  border-color: #e4e4e7;
  color: #18181b;
}

.toast-error {
  background-color: rgba(254, 242, 242, 0.95);
  border-color: #fecaca;
  color: #7f1d1d;
}

.dark .toast-error {
  background-color: rgba(127, 29, 29, 0.9);
  border-color: #991b1b;
  color: #fef2f2;
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.toast-msg {
  font-size: 0.75rem;
  opacity: 0.9;
  margin-top: 0.125rem;
  line-height: 1.4;
}

.toast-dismiss {
  border: none;
  background: transparent;
  color: inherit;
  opacity: 0.6;
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s ease;
}

.toast-dismiss:hover {
  opacity: 1;
}

.toast-dismiss svg {
  width: 1rem;
  height: 1rem;
}

/* --- General Helpers --- */
.hidden {
  display: none !important;
}

/* ==========================================================================
   Permanent Glassmorphism System
   Frosted glass with specular edge lighting, acrylic translucency, and
   refraction against the animated Aurora waves across cards and buttons.
   ========================================================================== */

/* --- Frosted Glass Cards & Surfaces (Light Mode: lighter opacity for waves to shimmer through) --- */
.auth-card,
.floating-header-card,
.floating-footer-card,
.subcard-item,
.toast-item {
  background-color: rgba(255, 255, 255, 0.4) !important;
  backdrop-filter: blur(12px) saturate(185%) !important;
  -webkit-backdrop-filter: blur(12px) saturate(185%) !important;
  border: 1px solid rgba(255, 255, 255, 0.68) !important;
  box-shadow: 0 12px 32px 0 rgba(0, 0, 0, 0.05), inset 0 1px 1px 0 rgba(255, 255, 255, 0.85), inset 0 -1px 1px 0 rgba(0, 0, 0, 0.02) !important;
}

/* Dark Mode Glass Cards (Preserved pristine contrast & deep frosted depth) */
.dark .auth-card,
.dark .floating-header-card,
.dark .floating-footer-card,
.dark .subcard-item,
.dark .toast-item {
  background-color: rgba(18, 20, 26, 0.5) !important;
  backdrop-filter: blur(12px) saturate(190%) !important;
  -webkit-backdrop-filter: blur(12px) saturate(190%) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  box-shadow: 0 16px 40px 0 rgba(0, 0, 0, 0.5), inset 0 1px 1px 0 rgba(255, 255, 255, 0.18), inset 0 -1px 1px 0 rgba(0, 0, 0, 0.4) !important;
}

/* Subcard Hover */
.subcard-item:hover {
  background-color: rgba(255, 255, 255, 0.64) !important;
  border-color: rgba(255, 255, 255, 0.9) !important;
  box-shadow: 0 16px 36px 0 rgba(0, 0, 0, 0.08), inset 0 1px 1px 0 rgba(255, 255, 255, 1) !important;
  transform: translateY(-2px);
}

.dark .subcard-item:hover {
  background-color: rgba(28, 31, 40, 0.72) !important;
  border-color: rgba(255, 255, 255, 0.24) !important;
  box-shadow: 0 18px 44px 0 rgba(0, 0, 0, 0.58), inset 0 1px 1px 0 rgba(255, 255, 255, 0.22) !important;
  transform: translateY(-2px);
}

/* Glass Feature Icon Badges - disabled for subcards (using Material Icons without background) */
.subcard-icon {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
}

.dark .subcard-icon {
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
}

/* --- Glassmorphic Buttons --- */

/* Primary Submit Buttons */
.btn-submit {
  background: linear-gradient(135deg, rgba(5, 150, 105, 0.76) 0%, rgba(16, 185, 129, 0.66) 100%) !important;
  backdrop-filter: blur(14px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(14px) saturate(180%) !important;
  border: 1px solid rgba(255, 255, 255, 0.4) !important;
  box-shadow: 0 8px 24px rgba(5, 150, 105, 0.28), inset 0 1px 1px rgba(255, 255, 255, 0.55) !important;
}

.btn-submit:hover {
  background: linear-gradient(135deg, rgba(5, 150, 105, 0.88) 0%, rgba(16, 185, 129, 0.78) 100%) !important;
  box-shadow: 0 10px 28px rgba(5, 150, 105, 0.38), inset 0 1px 1px rgba(255, 255, 255, 0.7) !important;
}

.dark .btn-submit {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.85) 0%, rgba(5, 150, 105, 0.8) 100%) !important;
  backdrop-filter: blur(14px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(14px) saturate(180%) !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  box-shadow: 0 8px 26px rgba(16, 185, 129, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.35) !important;
}

.dark .btn-submit:hover {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.95) 0%, rgba(5, 150, 105, 0.9) 100%) !important;
  box-shadow: 0 10px 30px rgba(16, 185, 129, 0.45), inset 0 1px 1px rgba(255, 255, 255, 0.5) !important;
}

/* Secondary Button (Cancel / Back) */
.btn-submit-dark {
  background: rgba(24, 24, 27, 0.65) !important;
  color: #ffffff !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15), inset 0 1px 1px rgba(255, 255, 255, 0.3) !important;
}

.btn-submit-dark:hover {
  background: rgba(39, 39, 42, 0.85) !important;
}

.dark .btn-submit-dark {
  background: rgba(255, 255, 255, 0.85) !important;
  color: #18181b !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border: 1px solid rgba(255, 255, 255, 0.5) !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.9) !important;
}

.dark .btn-submit-dark:hover {
  background: rgba(255, 255, 255, 0.96) !important;
}

/* Header Sign In Button */
.btn-header-signin {
  background: linear-gradient(135deg, rgba(5, 150, 105, 0.76) 0%, rgba(16, 185, 129, 0.66) 100%) !important;
  backdrop-filter: blur(12px) saturate(170%) !important;
  -webkit-backdrop-filter: blur(12px) saturate(170%) !important;
  border: 1px solid rgba(255, 255, 255, 0.36) !important;
  box-shadow: 0 4px 16px rgba(5, 150, 105, 0.24), inset 0 1px 1px rgba(255, 255, 255, 0.48) !important;
}

.btn-header-signin:hover {
  background: linear-gradient(135deg, rgba(5, 150, 105, 0.88) 0%, rgba(16, 185, 129, 0.78) 100%) !important;
  box-shadow: 0 6px 20px rgba(5, 150, 105, 0.34), inset 0 1px 1px rgba(255, 255, 255, 0.6) !important;
}

.dark .btn-header-signin {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.85) 0%, rgba(5, 150, 105, 0.78) 100%) !important;
  backdrop-filter: blur(12px) saturate(170%) !important;
  -webkit-backdrop-filter: blur(12px) saturate(170%) !important;
  border: 1px solid rgba(255, 255, 255, 0.28) !important;
  box-shadow: 0 4px 18px rgba(16, 185, 129, 0.32), inset 0 1px 1px rgba(255, 255, 255, 0.35) !important;
}

.dark .btn-header-signin:hover {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.95) 0%, rgba(5, 150, 105, 0.88) 100%) !important;
  box-shadow: 0 6px 22px rgba(16, 185, 129, 0.42), inset 0 1px 1px rgba(255, 255, 255, 0.5) !important;
}

/* Header Theme Toggle Button */
.theme-toggle-btn {
  background: rgba(255, 255, 255, 0.38) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border: 1px solid rgba(255, 255, 255, 0.6) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03), inset 0 1px 1px rgba(255, 255, 255, 0.75) !important;
}

.theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.58) !important;
}

.dark .theme-toggle-btn {
  background: rgba(39, 39, 42, 0.55) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.15) !important;
}

.dark .theme-toggle-btn:hover {
  background: rgba(63, 63, 70, 0.7) !important;
}

/* Glass Auth Tab Switcher & Active Tab */
.tab-switcher {
  background: rgba(255, 255, 255, 0.3) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  border: 1px solid rgba(255, 255, 255, 0.55) !important;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.5) !important;
}

.dark .tab-switcher {
  background: rgba(24, 24, 27, 0.45) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1) !important;
}

.tab-btn.active {
  background: linear-gradient(135deg, rgba(5, 150, 105, 0.84) 0%, rgba(16, 185, 129, 0.74) 100%) !important;
  backdrop-filter: blur(12px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(12px) saturate(180%) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.45) !important;
  box-shadow: 0 6px 18px rgba(5, 150, 105, 0.34), inset 0 1px 1px rgba(255, 255, 255, 0.6) !important;
}

.dark .tab-btn.active {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.92) 0%, rgba(5, 150, 105, 0.85) 100%) !important;
  backdrop-filter: blur(12px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(12px) saturate(180%) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.35) !important;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45), inset 0 1px 1px rgba(255, 255, 255, 0.4) !important;
}

/* Glass Form Inputs */
.form-input {
  background-color: rgba(255, 255, 255, 0.42) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  border: 1px solid rgba(228, 228, 231, 0.75) !important;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03) !important;
}

.form-input:focus {
  background-color: rgba(255, 255, 255, 0.75) !important;
  border-color: var(--emerald-500) !important;
  box-shadow: 0 0 0 3px var(--emerald-glow), inset 0 1px 1px rgba(255, 255, 255, 0.8) !important;
}

.dark .form-input {
  background-color: rgba(24, 24, 27, 0.48) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25) !important;
}

.dark .form-input:focus {
  background-color: rgba(39, 39, 42, 0.75) !important;
  border-color: var(--emerald-500) !important;
  box-shadow: 0 0 0 3px var(--emerald-glow), inset 0 1px 1px rgba(255, 255, 255, 0.15) !important;
}
