/* ═══════════════════════════════════════════════════════════════════════════
   Banking System — Professional Silver / Platinum Gray Theme
   Palette: #E5E7EB → #6B7280  (with darker accents)
   ═══════════════════════════════════════════════════════════════════════════ */

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

:root {
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --gray-950: #0a0e17;

  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent-subtle: rgba(99, 102, 241, 0.08);
  --accent-ring: rgba(99, 102, 241, 0.18);

  --success: #059669;
  --success-light: #10b981;
  --success-bg: #ecfdf5;
  --success-border: #a7f3d0;
  --error: #dc2626;
  --error-light: #ef4444;
  --error-bg: #fef2f2;
  --error-border: #fecaca;
  --warning: #d97706;
  --warning-bg: #fffbeb;
  --warning-border: #fde68a;
  --info: #2563eb;
  --info-bg: #eff6ff;
  --info-border: #bfdbfe;

  --radius-xs: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-pill: 100px;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-md:
    0 10px 15px -3px rgba(0, 0, 0, 0.07), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --shadow-lg:
    0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  --shadow-card:
    0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.05);
  --shadow-card-hover:
    0 10px 28px -5px rgba(0, 0, 0, 0.1), 0 4px 12px -4px rgba(0, 0, 0, 0.06);

  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);

  --font-mono: "SF Mono", "Cascadia Code", "Fira Code", "Consolas", monospace;
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family:
    "Inter",
    "Segoe UI",
    system-ui,
    -apple-system,
    sans-serif;
  background: var(--gray-100);
  color: var(--gray-800);
  min-height: 100vh;
  line-height: 1.6;
}

/* Subtle background pattern */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(
      ellipse 80% 60% at 50% -10%,
      rgba(99, 102, 241, 0.04) 0%,
      transparent 60%
    ),
    linear-gradient(180deg, var(--gray-100) 0%, var(--gray-200) 100%);
}

/* ── Animations ────────────────────────────────────────────────────────────── */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

@keyframes pulse-dot {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* ── Layout ────────────────────────────────────────────────────────────────── */
.app-header {
  background: var(--gray-950);
  color: var(--gray-100);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-logo .logo-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--accent) 0%, #818cf8 100%);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.header-logo .logo-icon svg {
  width: 20px;
  height: 20px;
  color: #fff;
}

.header-logo h1 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #fff;
}

.header-logo h1 span {
  color: var(--gray-400);
  font-weight: 400;
  margin-left: 0.15rem;
}

.header-meta {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.header-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.header-stat .stat-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--gray-500);
  line-height: 1;
}

.header-stat .stat-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gray-200);
  line-height: 1.4;
}

.header-divider {
  width: 1px;
  height: 28px;
  background: var(--gray-700);
}

.header-badge {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-pill);
  background: rgba(16, 185, 129, 0.12);
  color: var(--success-light);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.app-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.75rem 2rem 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  animation: fadeIn 0.5s ease;
}

@media (max-width: 960px) {
  .app-container {
    grid-template-columns: 1fr;
    padding: 1rem;
  }
  .header-inner {
    padding: 1rem;
  }
  .header-meta {
    display: none;
  }
}

/* ── Section Titles ────────────────────────────────────────────────────────── */
.section-title {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0 0.25rem;
}

.section-title h2 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--gray-500);
}

.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--gray-300) 0%, transparent 100%);
}

/* ── Accounts Bar ──────────────────────────────────────────────────────────── */
.accounts-bar {
  grid-column: 1 / -1;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-card);
  animation: fadeInUp 0.4s ease;
}

.accounts-bar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.accounts-bar-header h2 {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--gray-400);
}

.accounts-bar-header .account-count {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--gray-500);
  background: var(--gray-100);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
}

.account-chips {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.account-chip {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 0.65rem 1rem;
  font-size: 0.8rem;
  color: var(--gray-700);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transition: all var(--transition);
  cursor: default;
  position: relative;
}

.account-chip:hover {
  border-color: var(--gray-300);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.account-chip .chip-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gray-200) 0%, var(--gray-300) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--gray-600);
  flex-shrink: 0;
  text-transform: uppercase;
}

.account-chip .chip-info {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.account-chip .chip-name {
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--gray-800);
}

.account-chip .chip-number {
  font-size: 0.68rem;
  color: var(--gray-400);
  font-family: var(--font-mono);
}

.account-chip .chip-balance {
  margin-left: auto;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--gray-900);
  font-family: var(--font-mono);
  padding-left: 0.75rem;
}

.account-chip .status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  flex-shrink: 0;
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  animation: pulse-dot 2s infinite;
}

.account-chip .status-dot.frozen {
  background: var(--info);
  animation: none;
}

/* ── Card ──────────────────────────────────────────────────────────────────── */
.card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: all var(--transition);
  animation: fadeInUp 0.45s ease both;
}

.card:nth-child(2) {
  animation-delay: 0.03s;
}
.card:nth-child(3) {
  animation-delay: 0.06s;
}
.card:nth-child(4) {
  animation-delay: 0.09s;
}
.card:nth-child(5) {
  animation-delay: 0.12s;
}
.card:nth-child(6) {
  animation-delay: 0.15s;
}
.card:nth-child(7) {
  animation-delay: 0.18s;
}
.card:nth-child(8) {
  animation-delay: 0.21s;
}
.card:nth-child(9) {
  animation-delay: 0.24s;
}
.card:nth-child(10) {
  animation-delay: 0.27s;
}
.card:nth-child(11) {
  animation-delay: 0.3s;
}
.card:nth-child(12) {
  animation-delay: 0.33s;
}
.card:nth-child(13) {
  animation-delay: 0.36s;
}

.card:hover {
  box-shadow: var(--shadow-card-hover);
  border-color: var(--gray-300);
}

.card-header {
  padding: 1rem 1.35rem;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #fff;
}

.card-header .icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card-header .icon svg {
  width: 18px;
  height: 18px;
}

/* Icon color variants */
.card-header .icon.icon-indigo {
  background: rgba(99, 102, 241, 0.1);
  color: #6366f1;
}
.card-header .icon.icon-green {
  background: rgba(5, 150, 105, 0.1);
  color: #059669;
}
.card-header .icon.icon-amber {
  background: rgba(217, 119, 6, 0.1);
  color: #d97706;
}
.card-header .icon.icon-blue {
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
}
.card-header .icon.icon-rose {
  background: rgba(225, 29, 72, 0.1);
  color: #e11d48;
}
.card-header .icon.icon-cyan {
  background: rgba(6, 182, 212, 0.08);
  color: #0891b2;
}
.card-header .icon.icon-violet {
  background: rgba(139, 92, 246, 0.1);
  color: #8b5cf6;
}
.card-header .icon.icon-slate {
  background: var(--gray-100);
  color: var(--gray-600);
}
.card-header .icon.icon-emerald {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}
.card-header .icon.icon-orange {
  background: rgba(249, 115, 22, 0.1);
  color: #f97316;
}

.card-header h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gray-800);
  letter-spacing: -0.01em;
}

.card-header .card-desc {
  font-size: 0.72rem;
  color: var(--gray-400);
  margin-top: 0.1rem;
}

.card-header .badge {
  margin-left: auto;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-pill);
  font-weight: 700;
  background: var(--gray-100);
  color: var(--gray-500);
  border: 1px solid var(--gray-200);
}

.card-body {
  padding: 1.25rem 1.35rem 1.35rem;
}

/* ── Form Elements ─────────────────────────────────────────────────────────── */
.form-row {
  display: flex;
  gap: 0.85rem;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}

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

.form-group.full {
  flex-basis: 100%;
}

label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 0.35rem;
}

input,
select {
  height: 40px;
  padding: 0 0.85rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--gray-50);
  color: var(--gray-800);
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
  transition: all var(--transition-fast);
}

input:hover,
select:hover {
  border-color: var(--gray-300);
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
  background: #fff;
}

input::placeholder {
  color: var(--gray-400);
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.2rem;
}

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  height: 40px;
  padding: 0 1.25rem;
  border: none;
  border-radius: var(--radius);
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
  letter-spacing: 0.01em;
}

.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.1) 0%,
    transparent 100%
  );
  pointer-events: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.btn-primary {
  background: var(--gray-800);
  color: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.btn-primary:hover {
  background: var(--gray-900);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--error);
  color: #fff;
  box-shadow: 0 1px 2px rgba(220, 38, 38, 0.25);
}

.btn-danger:hover {
  background: #b91c1c;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
  transform: translateY(-1px);
}

.btn-success {
  background: var(--success);
  color: #fff;
  box-shadow: 0 1px 2px rgba(5, 150, 105, 0.25);
}

.btn-success:hover {
  background: #047857;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.2);
  transform: translateY(-1px);
}

.btn-outline {
  background: #fff;
  border: 1px solid var(--gray-200);
  color: var(--gray-700);
  box-shadow: var(--shadow-xs);
}

.btn-outline:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
}

.btn-outline::after {
  display: none;
}

/* Button group */
.btn-group {
  display: flex;
  gap: 0.5rem;
}

/* ── Result Output ─────────────────────────────────────────────────────────── */
.result-box {
  margin-top: 0.85rem;
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.7;
  max-height: 240px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  display: none;
  animation: slideDown 0.25s ease;
  position: relative;
}

.result-box.visible {
  display: block;
}

.result-box .result-label {
  font-family: "Inter", sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 0.35rem;
  display: block;
}

.result-box.success {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  color: #065f46;
}

.result-box.error {
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  color: #991b1b;
}

.result-box.info {
  background: var(--info-bg);
  border: 1px solid var(--info-border);
  color: #1e40af;
}

.result-box.warning {
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  color: #92400e;
}

/* ── Full-width Cards ──────────────────────────────────────────────────────── */
.card.full-width {
  grid-column: 1 / -1;
}

/* ── Scrollbar ─────────────────────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}

/* ── Password strength meter ───────────────────────────────────────────────── */
.strength-meter {
  margin-top: 0.65rem;
}

.strength-bar {
  height: 4px;
  border-radius: 2px;
  background: var(--gray-200);
  overflow: hidden;
}

.strength-bar .fill {
  height: 100%;
  border-radius: 2px;
  transition:
    width 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    background 0.35s;
  width: 0%;
}

.strength-label {
  font-size: 0.68rem;
  font-weight: 600;
  margin-top: 0.35rem;
  color: var(--gray-400);
  transition: color 0.25s;
}

/* ── Toast Notifications ───────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: 5rem;
  right: 1.5rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  min-width: 280px;
  max-width: 380px;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.8rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: slideDown 0.3s ease;
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  backdrop-filter: blur(8px);
}

.toast.toast-success {
  background: rgba(236, 253, 245, 0.95);
  border: 1px solid var(--success-border);
  color: #065f46;
}

.toast.toast-error {
  background: rgba(254, 242, 242, 0.95);
  border: 1px solid var(--error-border);
  color: #991b1b;
}

.toast svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ── Footer ────────────────────────────────────────────────────────────────── */
.app-footer {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 2rem 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--gray-200);
}

.footer-left {
  font-size: 0.73rem;
  color: var(--gray-400);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.footer-left svg {
  width: 14px;
  height: 14px;
  color: var(--gray-300);
}

.footer-right {
  display: flex;
  gap: 1.5rem;
}

.footer-right a,
.footer-right span {
  font-size: 0.72rem;
  color: var(--gray-400);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-right a:hover {
  color: var(--gray-600);
}

/* ── Utility ───────────────────────────────────────────────────────────────── */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
