/* ==========================================================================
   NORTHSTAR BANK - DESIGN SYSTEM & STYLESHEET
   Color Palette: Deep Navy, Electric Blue, Emerald Green, Slate Gray
   ========================================================================== */

:root {
  --primary-navy: #0b1a30;
  --secondary-navy: #102a43;
  --accent-blue: #1d4ed8;
  --accent-blue-hover: #1e40af;
  --light-blue: #eff6ff;
  --border-color: #e2e8f0;
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --text-dark: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --success: #10b981;
  --success-bg: #ecfdf5;
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --info: #0284c7;
  --info-bg: #f0f9ff;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.07);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.08);
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-page);
  color: var(--text-dark);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   NAVIGATION BAR
   ========================================================================== */
.navbar {
  background-color: var(--primary-navy);
  color: #ffffff;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.nav-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: #ffffff;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.brand-icon {
  width: 32px;
  height: 32px;
  fill: #60a5fa;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  list-style: none;
}

.nav-link {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.nav-link:hover, .nav-link.active {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.08);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.4rem 0.8rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  color: #f1f5f9;
}

.user-avatar-dot {
  width: 8px;
  height: 8px;
  background-color: #34d399;
  border-radius: 50%;
}

.role-tag {
  font-size: 0.7rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  text-transform: uppercase;
  font-weight: 600;
}

.role-admin {
  background: #ef4444;
  color: white;
}

.role-customer {
  background: #3b82f6;
  color: white;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
}

/* ==========================================================================
   BUTTONS & FORM CONTROLS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.btn-primary {
  background-color: var(--accent-blue);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--accent-blue-hover);
  box-shadow: 0 4px 12px rgba(29, 78, 216, 0.25);
}

.btn-secondary {
  background-color: #f1f5f9;
  color: var(--text-dark);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  background-color: #e2e8f0;
}

.btn-outline {
  background-color: transparent;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.4);
}

.btn-outline:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: #ffffff;
}

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

.btn-danger:hover {
  background-color: #dc2626;
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.82rem;
}

.btn-block {
  width: 100%;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text-dark);
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  font-family: inherit;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background-color: #ffffff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15);
}

textarea.form-control {
  min-height: 100px;
  resize: vertical;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

/* ==========================================================================
   LAYOUT CONTAINERS & CARDS
   ========================================================================== */
.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  flex: 1;
}

.page-header {
  margin-bottom: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.25rem;
}

.page-title {
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--primary-navy);
  letter-spacing: -0.5px;
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 0.25rem;
}

.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  background-color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary-navy);
}

.card-body {
  padding: 1.5rem;
}

.card-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  background-color: #f8fafc;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

/* ==========================================================================
   VIRTUAL DEBIT / CREDIT CARD
   ========================================================================== */
.virtual-card {
  background: linear-gradient(135deg, #0b1a30 0%, #1e3a8a 60%, #2563eb 100%);
  color: #ffffff;
  padding: 1.75rem;
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 24px -6px rgba(11, 26, 48, 0.4);
  position: relative;
  overflow: hidden;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.virtual-card::after {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0) 70%);
  border-radius: 50%;
  pointer-events: none;
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-chip {
  width: 45px;
  height: 35px;
  background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 50%, #94a3b8 100%);
  border-radius: 6px;
  position: relative;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.3);
}

.card-number {
  font-family: "Courier New", Courier, monospace;
  font-size: 1.35rem;
  letter-spacing: 2px;
  margin: 1.5rem 0;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.card-holder-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #93c5fd;
}

.card-holder-name {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.card-network {
  font-size: 1.25rem;
  font-weight: 800;
  font-style: italic;
  letter-spacing: -1px;
}

/* ==========================================================================
   KPI WIDGETS & STATS
   ========================================================================== */
.stat-box {
  background-color: var(--bg-card);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-navy);
  margin: 0.35rem 0;
}

.stat-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ==========================================================================
   TABLES & TRANSACTION LISTS
   ========================================================================== */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.bank-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.bank-table th {
  background-color: #f8fafc;
  padding: 0.9rem 1.25rem;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
}

.bank-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.92rem;
  color: var(--text-dark);
}

.bank-table tbody tr:hover {
  background-color: #f8fafc;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-credit {
  background-color: var(--success-bg);
  color: var(--success);
}

.badge-debit {
  background-color: var(--danger-bg);
  color: var(--danger);
}

.badge-info {
  background-color: var(--info-bg);
  color: var(--info);
}

.amount-credit {
  color: var(--success);
  font-weight: 600;
}

.amount-debit {
  color: var(--danger);
  font-weight: 600;
}

/* ==========================================================================
   NOTIFICATIONS / FLASH MESSAGES
   ========================================================================== */
.flash-container {
  max-width: 1240px;
  margin: 1.5rem auto 0;
  padding: 0 1.5rem;
}

.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid transparent;
  font-size: 0.92rem;
}

.alert-success {
  background-color: var(--success-bg);
  border-color: #a7f3d0;
  color: #065f46;
}

.alert-danger {
  background-color: var(--danger-bg);
  border-color: #fecaca;
  color: #991b1b;
}

.alert-warning {
  background-color: var(--warning-bg);
  border-color: #fde68a;
  color: #92400e;
}

.alert-info {
  background-color: var(--info-bg);
  border-color: #bae6fd;
  color: #075985;
}

.alert-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: inherit;
  opacity: 0.6;
}

.alert-close:hover {
  opacity: 1;
}

/* ==========================================================================
   LANDING PAGE (HERO & MARKETING)
   ========================================================================== */
.hero {
  background: linear-gradient(135deg, var(--primary-navy) 0%, var(--secondary-navy) 100%);
  color: #ffffff;
  padding: 5rem 1.5rem;
  text-align: center;
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.4rem 1rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.hero-title {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1px;
  margin-bottom: 1.25rem;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: #cbd5e1;
  margin-bottom: 2.25rem;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.features-section {
  padding: 4.5rem 1.5rem;
  background-color: #ffffff;
}

.section-title {
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-navy);
  margin-bottom: 0.5rem;
}

.section-subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 3rem;
  font-size: 1.05rem;
}

.feature-box {
  padding: 2rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: transform 0.2s, box-shadow 0.2s;
  background: var(--bg-card);
}

.feature-box:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--light-blue);
  color: var(--accent-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
}

.feature-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.feature-desc {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.trust-banner {
  background-color: #f1f5f9;
  padding: 2.5rem 1.5rem;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.trust-grid {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 2rem;
  text-align: center;
}

.trust-item h4 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary-navy);
}

.trust-item p {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ==========================================================================
   TERMINAL & DIAGNOSTIC VIEWER
   ========================================================================== */
.terminal-card {
  background: #0f172a;
  color: #f8fafc;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  font-family: "Consolas", "Courier New", monospace;
}

.terminal-header {
  background: #1e293b;
  padding: 0.65rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #334155;
}

.terminal-dots {
  display: flex;
  gap: 6px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.dot-red { background: #ef4444; }
.dot-yellow { background: #f59e0b; }
.dot-green { background: #10b981; }

.terminal-body {
  padding: 1.25rem;
  min-height: 180px;
  max-height: 400px;
  overflow-y: auto;
  font-size: 0.9rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer {
  background-color: var(--primary-navy);
  color: #94a3b8;
  padding: 3rem 1.5rem 1.5rem;
  margin-top: auto;
  font-size: 0.88rem;
}

.footer-container {
  max-width: 1240px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-brand h3 {
  color: #ffffff;
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

.footer-col h4 {
  color: #ffffff;
  font-size: 0.95rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: #ffffff;
}

.footer-bottom {
  max-width: 1240px;
  margin: 1.5rem auto 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .footer-container { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 650px) {
  .hero-title { font-size: 2.2rem; }
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  .footer-container { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 0.5rem; text-align: center; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
}
