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

html, body {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: #222;
  background-color: #f2f4f7;
}

a {
  color: #2563eb;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ===========================
   Navbar
   =========================== */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #1e293b;
  color: #fff;
  padding: 0 24px;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

.navbar-brand {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: #fff;
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.navbar-user {
  font-size: 14px;
  color: #cbd5e1;
}

.navbar-user strong {
  color: #f1f5f9;
}

.navbar-link {
  font-size: 14px;
  color: #93c5fd;
  text-decoration: none;
  padding: 4px 10px;
  border: 1px solid #3b82f6;
  border-radius: 4px;
  transition: background 0.15s;
}

.navbar-link:hover {
  background-color: #1d4ed8;
  color: #fff;
  text-decoration: none;
}

/* ===========================
   Content area
   =========================== */
.content-area {
  max-width: 800px;
  margin: 0 auto;
  padding: 32px 16px 64px;
}

/* ===========================
   Flash messages
   =========================== */
.flash-container {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.flash {
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  border-left: 4px solid transparent;
}

.flash-success {
  background-color: #dcfce7;
  color: #166534;
  border-left-color: #22c55e;
}

.flash-error {
  background-color: #fee2e2;
  color: #991b1b;
  border-left-color: #ef4444;
}

.flash-info {
  background-color: #dbeafe;
  color: #1e40af;
  border-left-color: #3b82f6;
}

.flash-warning {
  background-color: #fef9c3;
  color: #854d0e;
  border-left-color: #eab308;
}

/* ===========================
   Cards
   =========================== */
.card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08), 0 4px 16px rgba(0,0,0,0.06);
  padding: 28px 32px;
  margin-bottom: 24px;
}

.card-centered {
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
  margin-top: 48px;
  text-align: center;
}

.card-heading {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
  color: #1e293b;
}

.card-subtext {
  color: #64748b;
  margin-bottom: 24px;
  font-size: 14px;
}

/* ===========================
   Page header (title + action)
   =========================== */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-header h1 {
  font-size: 22px;
  font-weight: 700;
  color: #1e293b;
}

/* ===========================
   Buttons
   =========================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.15s, opacity 0.15s;
  text-decoration: none;
  line-height: 1.4;
  white-space: nowrap;
}

.btn:hover {
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background-color: #2563eb;
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background-color: #1d4ed8;
  color: #fff;
}

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

.btn-secondary:hover:not(:disabled) {
  background-color: #cbd5e1;
  color: #1e293b;
}

.btn-block {
  width: 100%;
}

/* ===========================
   Forms
   =========================== */
.form-group {
  margin-bottom: 16px;
  text-align: left;
  flex: 1;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 6px;
}

.form-input {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 14px;
  color: #1e293b;
  background-color: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: auto;
}

.form-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-input:disabled {
  background-color: #f8fafc;
  color: #94a3b8;
  cursor: not-allowed;
}

.form-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.form-row .form-group {
  min-width: 180px;
}

.form-actions {
  margin-top: 20px;
}

.login-form {
  text-align: left;
}

/* ===========================
   Bank table
   =========================== */
.bank-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.bank-table thead th {
  background-color: #f8fafc;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 10px 14px;
  border-bottom: 2px solid #e2e8f0;
  text-align: left;
}

.bank-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  vertical-align: middle;
}

.bank-table tbody tr:last-child td {
  border-bottom: none;
}

.bank-table tbody tr:nth-child(even) {
  background-color: #f8fafc;
}

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

.session-id {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 12px;
  color: #64748b;
  cursor: default;
}

/* ===========================
   Empty state
   =========================== */
.empty-state {
  text-align: center;
  padding: 48px 32px;
  color: #64748b;
}

.empty-state p {
  margin-bottom: 8px;
}

/* ===========================
   Add Bank page — bank list
   =========================== */
.step-heading {
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 16px;
}

.bank-list-select {
  height: auto;
  min-height: 200px;
  overflow-y: auto;
}

.status-message {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 10px;
  min-height: 18px;
}

/* ===========================
   Redirect / spinner state
   =========================== */
.redirect-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 0;
  gap: 20px;
}

.redirect-state p {
  color: #475569;
  font-size: 15px;
  font-weight: 500;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #e2e8f0;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

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

/* ===========================
   Utility
   =========================== */
.hidden {
  display: none !important;
}

/* ===========================
   Responsive
   =========================== */
@media (max-width: 600px) {
  .content-area {
    padding: 20px 12px 48px;
  }

  .card {
    padding: 20px 16px;
  }

  .card-centered {
    margin-top: 24px;
  }

  .navbar {
    padding: 0 16px;
  }

  .navbar-brand {
    font-size: 16px;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .form-row {
    flex-direction: column;
  }

  .bank-table thead th,
  .bank-table tbody td {
    padding: 8px 10px;
    font-size: 13px;
  }
}
