/* ═══════════════════════════════════════════════════
   BankAI — Shared Base Styles (Fey Terminal Theme)
   ═══════════════════════════════════════════════════ */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  background-color: var(--color-fey-ink);
}

body {
  font-family: var(--font);
  background: var(--surface-canvas);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Ambient Background (Deep, subtle depth halos) ── */
.ambient-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.04; /* Extremely subtle terminal glow */
  animation: orbFloat 24s ease-in-out infinite alternate;
  will-change: transform;
}

.orb-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, var(--color-fey-signal) 0%, transparent 70%);
  top: -100px; left: -100px;
  animation-delay: 0s;
}
.orb-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, var(--color-fey-ember) 0%, transparent 70%);
  bottom: -80px; right: -80px;
  animation-delay: -8s;
}
.orb-3 {
  width: 350px; height: 350px;
  background: radial-gradient(circle, var(--color-fey-growth) 0%, transparent 70%);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -16s;
}

@keyframes orbFloat {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(50px, -40px) scale(1.1); }
  100% { transform: translate(-30px, 30px) scale(0.9); }
}

/* ── Typographic Defaults ── */
h1, h2, h3, h4, h5, h6 {
  color: var(--color-fey-white);
  font-weight: var(--font-weight-bold);
  letter-spacing: var(--tracking-heading);
}

p {
  color: var(--color-fey-graphite);
  font-weight: var(--font-weight-regular);
}

/* ── Buttons (Fey Ghost Button design) ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: var(--font-weight-medium);
  border-radius: var(--radius-buttons);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  letter-spacing: -0.01em;
  outline: none;
}

/* Primary Button is Ghost with a soft white halo */
.btn-primary {
  background: var(--surface-canvas);
  color: var(--color-fey-white);
  border: 1px solid var(--color-fey-white);
  box-shadow: var(--shadow-md); /* rgba(255,255,255,0.25) 0px 0px 14px 0px */
}
.btn-primary:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: rgba(255, 255, 255, 0.35) 0px 0px 18px 0px;
}
.btn-primary:active {
  transform: translateY(0);
}

/* Secondary Button sits in Fey Graphite border */
.btn-secondary {
  background: transparent;
  color: var(--color-fey-graphite);
  border: 1px solid var(--color-fey-smoke);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--color-fey-white);
  border-color: var(--color-fey-mist);
  transform: translateY(-1px);
}
.btn-secondary:active {
  transform: translateY(0);
}

/* Glow Button (used for start CTA) is styled as a premium Ember outline ghost */
.btn-glow {
  background: var(--surface-canvas);
  color: var(--color-fey-white);
  border: 1px solid var(--color-fey-ember);
  box-shadow: 0 0 15px rgba(255, 161, 108, 0.15);
}
.btn-glow:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 20px rgba(255, 161, 108, 0.3);
  background: rgba(255, 161, 108, 0.04);
}

.btn-sm {
  padding: 6px 16px;
  font-size: 11px;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ── Inputs & Form Controls ── */
input, textarea, select {
  background: var(--surface-elevated);
  border: 1px solid var(--color-fey-smoke);
  border-radius: var(--radius-small);
  padding: 10px 14px;
  color: var(--color-fey-white);
  font-family: var(--font);
  font-size: var(--text-body);
  outline: none;
  transition: var(--transition);
}

input:focus, textarea:focus, select:focus {
  border-color: var(--color-fey-signal);
}

input::placeholder, textarea::placeholder {
  color: var(--color-fey-smoke);
}

/* ── Input Validation ── */
.invalid {
  border-color: var(--accent-danger) !important;
  box-shadow: 0 0 8px rgba(226, 92, 92, 0.2) !important;
  animation: shake 0.3s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* ── Spinner ── */
.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  border-top-color: var(--color-fey-signal);
  animation: spin 0.8s linear infinite;
}

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

/* ── Shared Toast Styles ── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: calc(100vw - 48px);
}

.toast {
  background: var(--surface-card);
  border: 1px solid var(--color-fey-smoke);
  padding: 14px 20px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  color: var(--color-fey-white);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
  max-width: 400px;
  animation: slideIn 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.toast::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}

.toast-info::before { background: var(--color-fey-signal); }
.toast-success::before { background: var(--color-fey-growth); }
.toast-error::before { background: var(--accent-danger); }
.toast-warning::before { background: var(--color-fey-ember); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast.fade-out {
  animation: slideOut 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--surface-canvas);
}
::-webkit-scrollbar-thumb {
  background: var(--color-fey-smoke);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-fey-ash);
}

/* ♿ Accessibility controls toolbar */
.a11y-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  position: relative;
  z-index: 100;
  width: 100%;
}

.a11y-select {
  padding: 8px 12px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: 13px;
  outline: none;
  cursor: pointer;
}

.btn-a11y {
  padding: 8px 16px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius-full);
  font-family: var(--font);
  font-size: 13px;
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.btn-a11y:hover {
  background: var(--bg-surface-hover);
  border-color: var(--accent);
}

body.accessibility-mode .btn-a11y {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}
