/* DebitSafe — minimal, accessible stylesheet */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --color-bg: #f4f6f9;
  --color-surface: #ffffff;
  --color-primary: #1a56db;
  --color-primary-hover: #1344b6;
  --color-danger: #e02424;
  --color-success: #057a55;
  --color-border: #d1d5db;
  --color-text: #111827;
  --color-muted: #6b7280;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
}

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
}

/* ── Layout ── */
.container { max-width: 960px; margin: 0 auto; padding: 0 1rem; }
.page { display: none; min-height: 100vh; align-items: center; justify-content: center; }
.page.active { display: flex; }

/* ── Card / Panel ── */
.panel {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
  width: 100%;
}
.panel--narrow { max-width: 420px; }
.panel--wide   { max-width: 860px; }

/* ── Typography ── */
h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: .25rem; }
h2 { font-size: 1.25rem; font-weight: 600; margin-bottom: 1rem; }
.subtitle { color: var(--color-muted); font-size: .875rem; margin-bottom: 1.5rem; }

/* ── Forms ── */
.form-group { margin-bottom: 1rem; }
label { display: block; font-size: .875rem; font-weight: 500; margin-bottom: .375rem; }
input, select {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: .5rem .75rem;
  font-size: 1rem;
  outline: none;
  transition: border-color .15s;
}
input:focus, select:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(26,86,219,.15); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem 1rem;
  border: none;
  border-radius: 6px;
  font-size: .9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, opacity .15s;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--primary  { background: var(--color-primary); color: #fff; }
.btn--primary:hover:not(:disabled) { background: var(--color-primary-hover); }
.btn--danger   { background: var(--color-danger); color: #fff; }
.btn--outline  { background: transparent; border: 1px solid var(--color-border); }
.btn--full     { width: 100%; justify-content: center; }
.btn--sm       { padding: .3rem .65rem; font-size: .8125rem; }

/* ── Alerts ── */
.alert {
  padding: .75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: .875rem;
}
.alert--error   { background: #fdf2f2; color: var(--color-danger); border: 1px solid #fbd5d5; }
.alert--success { background: #f3faf7; color: var(--color-success); border: 1px solid #bcf0da; }
.alert--info    { background: #ebf5ff; color: var(--color-primary); border: 1px solid #c3ddfd; }
.alert--hidden  { display: none; }

/* ── Logo ── */
.page-logo {
  text-align: center;
  margin-bottom: 1.25rem;
}
.page-logo img {
  height: 56px;
  width: auto;
}
.navbar__logo {
  height: 36px;
  width: auto;
}

/* ── Navbar ── */
.navbar {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: .75rem 0;
  box-shadow: var(--shadow);
}
.navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.navbar__brand { font-weight: 700; font-size: 1.1rem; color: var(--color-primary); }
.navbar__user  { display: flex; align-items: center; gap: .75rem; font-size: .875rem; color: var(--color-muted); }

/* ── Search bar ── */
.search-row {
  display: flex;
  gap: .5rem;
  margin-bottom: 1.5rem;
}
.search-row input { flex: 1; }

/* ── Customer info box ── */
.customer-info {
  background: #ebf5ff;
  border: 1px solid #c3ddfd;
  border-radius: 6px;
  padding: .75rem 1rem;
  margin-bottom: 1.5rem;
  font-size: .9rem;
}
.customer-info strong { font-size: 1rem; }

/* ── Cards list ── */
.cards-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.cards-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.cards-table th {
  text-align: left;
  padding: .5rem .75rem;
  border-bottom: 2px solid var(--color-border);
  font-weight: 600;
  color: var(--color-muted);
}
.cards-table td { padding: .6rem .75rem; border-bottom: 1px solid var(--color-border); }
.cards-table tr:last-child td { border-bottom: none; }

.badge {
  display: inline-block;
  padding: .15rem .5rem;
  border-radius: 4px;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
}
.badge--visa       { background: #1a56db; color: #fff; }
.badge--mastercard { background: #eb3b00; color: #fff; }
.badge--amex       { background: #2d7dd2; color: #fff; }
.badge--discover   { background: #f59e0b; color: #fff; }
.badge--active     { background: #def7ec; color: #03543f; }
.badge--inactive   { background: #fde8e8; color: #9b1c1c; }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  display: none;
  align-items: flex-start;
  justify-content: center;
  z-index: 100;
  overflow-y: auto;
  padding: 1.5rem 1rem;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  padding: 2rem;
  width: 100%;
  max-width: 480px;
  margin: auto;
}
.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.modal__close {
  background: none; border: none; font-size: 1.4rem;
  cursor: pointer; color: var(--color-muted); line-height: 1;
}
.cvv-notice {
  background: #fdf6ec;
  border: 1px solid #fcd9a0;
  border-radius: 6px;
  padding: .6rem .85rem;
  font-size: .8125rem;
  color: #92400e;
  margin-bottom: 1rem;
}
.modal__footer { display: flex; gap: .5rem; justify-content: flex-end; margin-top: 1.25rem; }

/* ── Spinner ── */
.spinner {
  display: inline-block;
  width: 1rem; height: 1rem;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Responsive ── */
@media (max-width: 600px) {
  .panel { padding: 1.25rem; }
  .cards-table th:nth-child(4), .cards-table td:nth-child(4) { display: none; }
}
