/* ═══════════════════════════════════════════════════════════════
   Credvanta Client Portal — Styles
   Fonts: Playfair Display (display) + Outfit (body)
   Tokens mirror the main credvantarecovery.co.uk stylesheet.
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* Brand */
  --navy:        #1a3a6b;
  --navy-mid:    #1e4279;
  --navy-light:  #23508f;
  --blue:        #1851C4;
  --blue-bright: #2563EB;
  --blue-light:  #3B82F6;
  --blue-pale:   #EFF6FF;

  /* Neutrals */
  --white:       #FFFFFF;
  --off-white:   #F8FAFC;
  --gray-100:    #F1F5F9;
  --gray-200:    #E2E8F0;
  --gray-400:    #94A3B8;
  --gray-600:    #475569;
  --gray-800:    #1E293B;

  /* Status */
  --green:       #16A34A;
  --green-bg:    #DCFCE7;
  --amber:       #D97706;
  --amber-bg:    #FEF3C7;
  --red:         #DC2626;
  --red-bg:      #FEE2E2;
  --purple:      #7C3AED;
  --purple-bg:   #EDE9FE;

  /* Typography */
  --font-body:    'Outfit', system-ui, sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;

  /* Misc */
  --radius:     8px;
  --radius-lg:  16px;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow:     0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:  0 12px 40px rgba(0,0,0,.15);
  --transition: 0.25s ease;
}

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

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background: var(--off-white);
  color: var(--gray-800);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── AUTH PAGES (login / reset / set-password) ──────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 50%, #0a1e40 100%);
  background-image:
    linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 50%, #0a1e40 100%),
    linear-gradient(rgba(59,130,246,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59,130,246,.06) 1px, transparent 1px);
  background-size: auto, 60px 60px, 60px 60px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

/* White header — compact section that holds the logo. Flex centering
   ensures the logo sits perfectly in the middle regardless of any
   asymmetric whitespace within the logo image itself. */
.auth-card-header {
  background: var(--white);
  padding: 8px 24px 4px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-logo {
  display: block;
  height: 150px;
  width: auto;
  margin: 0;
  object-fit: contain;
  object-position: center;
}

.auth-card-header p {
  color: var(--gray-600);
  font-size: 0.82rem;
  margin: 4px 0 0;
  font-weight: 500;
}

.auth-card-body {
  padding: 32px;
}

.auth-card-body h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 6px;
}

.auth-card-body .auth-subtitle {
  font-size: 0.875rem;
  color: var(--gray-600);
  margin-bottom: 24px;
}

.auth-footer {
  padding: 0 32px 28px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--gray-400);
}

.auth-footer p { margin: 0; }
.auth-footer p + p { margin-top: 8px; }

.auth-footer a {
  color: var(--blue);
  font-weight: 500;
}
.auth-footer a:hover { text-decoration: underline; }

/* ─── FORMS ──────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 5px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--gray-800);
  /* Match main site — light grey default, white on focus */
  background: var(--gray-100);
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
  outline: none;
  appearance: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--gray-400); }

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--blue);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.form-group textarea { resize: vertical; min-height: 80px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* ─── BUTTONS ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background var(--transition), color var(--transition),
              border-color var(--transition), box-shadow var(--transition),
              transform var(--transition);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
}

.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--blue);
  color: var(--white);
  width: 100%;
  box-shadow: 0 2px 8px rgba(24,81,196,.35);
}
.btn-primary:hover {
  background: var(--blue-bright);
  box-shadow: 0 4px 16px rgba(37,99,235,.4);
}

.btn-secondary {
  background: var(--white);
  color: var(--navy);
  border: 1.5px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
}
.btn-secondary:hover {
  border-color: var(--navy);
  box-shadow: var(--shadow);
}

.btn-outline {
  background: transparent;
  color: var(--navy);
  border: 1.5px solid var(--navy);
}
.btn-outline:hover {
  background: var(--navy);
  color: var(--white);
}

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

/* ─── ALERTS ─────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  margin-bottom: 18px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.alert[hidden] { display: none; }
.alert svg { flex-shrink: 0; margin-top: 1px; }

.alert-error {
  background: var(--red-bg);
  color: #991B1B;
  border: 1px solid #FECACA;
}
.alert-success {
  background: var(--green-bg);
  color: #166534;
  border: 1px solid #BBF7D0;
}
.alert-info {
  background: var(--blue-pale);
  color: #1E40AF;
  border: 1px solid #BFDBFE;
}

/* ─── PORTAL LAYOUT ──────────────────────────────────────────── */
.portal-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.portal-topbar {
  background: var(--off-white); /* matches the page background — header blends seamlessly */
  padding: 0 24px;
  height: 96px; /* taller again for the bigger logo */
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--gray-200);
}

.topbar-logo {
  display: flex;
  align-items: center;
  gap: 18px;
}

.topbar-logo img {
  height: 76px; /* enlarged ~30% from 58px */
  width: auto;
}

.topbar-client {
  color: var(--gray-600);
  font-size: 0.78rem;
  line-height: 1.3;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.topbar-client strong {
  color: var(--navy);
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
}

/* Client reference under the name */
.topbar-ref {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--gray-600);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.topbar-ref #topbar-ref {
  color: var(--navy);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
}

/* Topbar right — flex container for contact + sign out */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Contact phone — icon + number on a single line */
.topbar-contact {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--navy);
  transition: background var(--transition);
}
.topbar-contact:hover { background: rgba(26,58,107,0.06); }
.topbar-contact svg { color: var(--blue); flex-shrink: 0; }
.topbar-contact-number {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: 0.01em;
  line-height: 1;
}

.btn-logout {
  background: var(--white);
  color: var(--navy);
  border: 1px solid var(--gray-200);
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.825rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
  transition: background var(--transition), border-color var(--transition);
}
.btn-logout:hover {
  background: var(--white);
  border-color: var(--navy);
  color: var(--navy);
}

/* ─── TABS ───────────────────────────────────────────────────── */
.portal-tabs {
  background: var(--navy);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding: 0 24px;
  display: flex;
  gap: 0;
}

.tab-btn {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 14px 22px 12px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  color: rgba(255,255,255,0.65);
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
  margin-bottom: -1px;
  display: flex;
  align-items: center;
}

.tab-btn:hover {
  color: var(--white);
  background: rgba(255,255,255,0.05);
}

.tab-btn.active {
  color: var(--white);
  border-bottom-color: var(--white);
}

/* The badge sitting inside the tab needs higher contrast on the navy bar */
.tab-btn .badge {
  background: rgba(255,255,255,0.2);
  color: var(--white);
  border: 1px solid rgba(255,255,255,0.25);
}
.tab-btn.active .badge {
  background: var(--white);
  color: var(--navy);
  border-color: var(--white);
}

/* ─── PORTAL CONTENT ─────────────────────────────────────────── */
.portal-content {
  flex: 1;
  padding: 28px 24px;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.panel-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 6px;
}

.panel-subtitle {
  color: var(--gray-600);
  font-size: 0.875rem;
  margin-bottom: 0;
}

.panel-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.btn-refresh {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: transparent;
  border: 1.5px solid var(--navy);
  border-radius: 8px;
  color: var(--navy);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s;
}
.btn-refresh:hover { background: var(--navy); color: #fff; }
.btn-refresh.spinning svg { animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── SUBMIT FORM CARD ───────────────────────────────────────── */
.submit-card {
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.submit-section {
  padding: 24px;
  border-bottom: 1px solid var(--gray-100);
}

.submit-section:last-child { border-bottom: none; }

.submit-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--gray-200);
}

.submit-actions {
  padding: 18px 24px;
  background: var(--gray-100);
  border-top: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.submit-actions .btn-primary { width: auto; }

/* ─── FILE UPLOAD ────────────────────────────────────────────── */
.file-drop {
  border: 2px dashed var(--gray-200);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  background: var(--gray-100);
  position: relative;
}

.file-drop:hover,
.file-drop.drag-over {
  border-color: var(--blue-light);
  background: var(--blue-pale);
}

.file-drop input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.file-drop-icon {
  color: var(--blue-light);
  margin: 0 auto 10px;
  width: fit-content;
}

.file-drop p { font-size: 0.875rem; color: var(--gray-600); margin-bottom: 2px; }
.file-drop .file-hint { font-size: 0.78rem; color: var(--gray-400); margin-top: 4px; }

.file-list {
  list-style: none;
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* File items — match main site's upload-item style */
.file-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: var(--blue-pale);
  border: 1px solid rgba(37,99,235,.15);
  border-radius: 6px;
  font-size: 0.82rem;
  color: var(--gray-800);
}

.file-item svg { color: var(--blue); flex-shrink: 0; }

.file-name {
  flex: 1;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-size {
  flex-shrink: 0;
  color: var(--gray-400);
  font-size: 0.75rem;
}

.file-remove {
  background: none;
  border: none;
  color: var(--gray-400);
  cursor: pointer;
  padding: 2px;
  transition: color var(--transition);
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.file-remove:hover { color: #ef4444; }

/* ─── DOCUMENT UPLOAD MODAL ──────────────────────────────────── */
.doc-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}
.doc-modal-overlay[hidden] { display: none; }
.doc-modal {
  background: var(--white, #fff);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px;
  position: relative;
}
.doc-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--gray-400, #9ca3af);
  cursor: pointer;
  padding: 4px;
  line-height: 0;
  border-radius: 6px;
}
.doc-modal-close:hover { color: var(--gray-600, #4b5563); background: var(--gray-100, #f3f4f6); }
.doc-modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--navy, #1B2D4F);
  margin: 0 0 6px;
  padding-right: 28px;
}
.doc-modal-sub {
  font-size: 0.875rem;
  color: var(--gray-600, #4b5563);
  line-height: 1.5;
  margin: 0 0 18px;
}
.doc-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 18px;
}
.doc-modal-actions .btn { width: auto; }
.doc-upload-success {
  text-align: center;
  padding: 16px 8px 8px;
}
.doc-upload-success p {
  font-size: 0.95rem;
  color: var(--gray-600, #4b5563);
  line-height: 1.6;
  margin: 12px 0 20px;
}
.case-actions {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--gray-100, #f3f4f6);
}
.btn-sm { padding: 7px 14px; font-size: 0.8rem; width: auto; }

/* ─── CASES SEARCH ───────────────────────────────────────────── */
.cases-search-wrap {
  margin-bottom: 16px;
}

.cases-search-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 10px 14px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.cases-search-inner:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.cases-search-inner svg { color: var(--gray-400); flex-shrink: 0; }

.cases-search-inner input[type="search"] {
  border: none;
  background: none;
  outline: none;
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--gray-800);
  width: 100%;
  padding: 0;
  box-shadow: none;
}

.cases-search-inner input[type="search"]::placeholder { color: var(--gray-400); }

/* ─── CASES LIST ─────────────────────────────────────────────── */
.cases-empty {
  text-align: center;
  padding: 56px 24px;
  color: var(--gray-400);
}
.cases-empty svg { opacity: .3; margin: 0 auto 12px; }
.cases-empty p { font-size: 0.875rem; }

.cases-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.case-card {
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
  box-shadow: var(--shadow-sm);
}

.case-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  border-color: var(--blue-light);
}

.case-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 16px 20px;
  gap: 12px;
}

.case-debtor {
  font-weight: 700;
  font-size: 1rem;
  color: var(--navy);
  margin-bottom: 4px;
  line-height: 1.3;
}

.case-debtor .case-company {
  font-size: 0.8rem;
  color: var(--gray-400);
  font-weight: 400;
}

.case-amount {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--blue);
  line-height: 1;
}

/* ─── CASE BALANCES (initial + outstanding, two rows) ─────────── */
.case-balances {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 20px 14px;
  border-bottom: 1px dashed var(--gray-200);
  margin-bottom: 12px;
}
.case-balance-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
.case-balance-label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.case-balance-value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--navy);
}
/* Outstanding line — bolder/brighter to draw the eye */
.case-balance-row--outstanding .case-balance-label { color: var(--navy); font-weight: 600; }
.case-balance-row--outstanding .case-balance-value { color: var(--blue); font-size: 1.2rem; font-weight: 900; }

/* ─── SUB-TABS (Ongoing / Closed) ─────────────────────────────── */
.cases-subtabs {
  display: flex;
  gap: 4px;
  background: var(--gray-100);
  padding: 4px;
  border-radius: 10px;
  margin-bottom: 16px;
  width: fit-content;
}
.subtab-btn {
  background: transparent;
  border: none;
  padding: 8px 18px;
  border-radius: 7px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-600);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.subtab-btn:hover { color: var(--navy); }
.subtab-btn.active {
  background: var(--white);
  color: var(--navy);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.subtab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 7px;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(0,0,0,0.06);
  color: var(--gray-600);
}
.subtab-btn.active .subtab-count {
  background: var(--blue);
  color: var(--white);
}

.case-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  padding: 0 20px 14px;
}

/* ─── CASE STATUS MESSAGE BLOCK ──────────────────────────────── */
.case-status-message {
  margin: 0 20px 18px;
  padding: 14px 16px;
  border-radius: 8px;
  border-left: 4px solid;
  font-size: 0.86rem;
  line-height: 1.55;
}
.case-status-message p {
  margin: 0;
}
.case-status-message p + p {
  margin-top: 8px;
}
.case-status-message a {
  font-weight: 600;
}
.case-status-message__header {
  font-weight: 700 !important;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 8px !important;
}

/* Client Action Required — red */
.case-status-message--action {
  background: #FEF2F2;
  border-color: #DC2626;
  color: #7F1D1D;
}
.case-status-message--action a              { color: #991B1B; }
.case-status-message--action .case-status-message__header { color: #DC2626; }

/* Escalated / Legal — amber */
.case-status-message--escalated {
  background: #FFF7ED;
  border-color: #EA580C;
  color: #7C2D12;
}
.case-status-message--escalated a              { color: #9A3412; }
.case-status-message--escalated .case-status-message__header {
  color: #C2410C;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.85rem;
  font-style: italic;
}

/* In Progress — blue */
.case-status-message--progress {
  background: #EFF6FF;
  border-color: var(--blue);
  color: #1E3A8A;
}
.case-status-message--progress a              { color: #1E40AF; }
.case-status-message--progress .case-status-message__header { color: var(--blue); }

/* Completed — green */
.case-status-message--completed {
  background: #F0FDF4;
  border-color: #16A34A;
  color: #14532D;
}
.case-status-message--completed a              { color: #166534; }
.case-status-message--completed .case-status-message__header { color: #15803D; }

/* Closed unsuccessful — slate */
.case-status-message--closed {
  background: #F3F4F6;
  border-color: #4B5563;
  color: #1F2937;
}
.case-status-message--closed a              { color: #1F2937; }
.case-status-message--closed .case-status-message__header { color: #1F2937; }

.case-meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--gray-600);
}

.case-meta-label {
  font-weight: 700;
  color: var(--gray-400);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.case-notes {
  padding: 12px 20px 14px;
  font-size: 0.82rem;
  color: var(--gray-600);
  line-height: 1.6;
  border-top: 1px solid var(--gray-100);
}

.case-docs {
  border-top: 1px solid var(--gray-100);
  padding: 10px 20px;
}

.case-docs-toggle {
  background: none;
  border: none;
  color: var(--blue);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--transition);
}
.case-docs-toggle:hover { color: var(--blue-bright); }

.case-doc-list {
  list-style: none;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.case-doc-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--gray-600);
  padding: 4px 0;
}

/* ─── STATUS BADGES ──────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: .04em;
  flex-shrink: 0;
}

/* Tab badge — shows active case count */
.badge-active   { background: var(--blue-pale); color: var(--blue); }

/* Case status badges */
.badge-submitted { background: var(--gray-100);  color: var(--gray-600); }
.badge-letter    { background: var(--amber-bg);   color: var(--amber); }
.badge-dispute   { background: var(--red-bg);     color: #991B1B; }
.badge-legal     { background: var(--purple-bg);  color: var(--purple); }
.badge-settled   { background: var(--green-bg);   color: var(--green); }
.badge-closed    { background: var(--gray-100);   color: var(--gray-600); }

/* ─── CASE UPDATE BLOCK ──────────────────────────────────────── */
.case-update {
  padding: 12px 20px 14px;
  border-top: 1px solid var(--gray-100);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Contextual status message — mirrors main site lookup-status-msg */
.case-status-msg {
  font-size: 0.82rem;
  line-height: 1.55;
  padding: 10px 14px;
  border-radius: var(--radius);
  margin: 0;
}

.case-status-msg--info {
  background: var(--blue-pale);
  border: 1px solid #BFDBFE;
  color: #1E40AF;
}

.case-status-msg--warning {
  background: var(--amber-bg);
  border: 1px solid #FDE68A;
  color: #92400E;
}

.case-status-msg--success {
  background: var(--green-bg);
  border: 1px solid #BBF7D0;
  color: #166534;
}

/* Team note — the written update from Credvanta staff */
.case-team-note {
  background: var(--gray-100);
  border-left: 3px solid var(--blue);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 10px 14px;
}

.case-team-note-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--blue);
  margin-bottom: 6px;
}

.case-team-note p {
  font-size: 0.875rem;
  color: var(--gray-800);
  line-height: 1.6;
  margin: 0;
}

.case-updated-at {
  font-size: 0.75rem;
  color: var(--gray-400);
  margin: 0;
}

/* ─── SUCCESS STATE ──────────────────────────────────────────── */
.success-panel {
  text-align: center;
  padding: 48px 24px;
  display: none;
}

.success-icon {
  width: 64px;
  height: 64px;
  background: var(--green-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: var(--green);
}

.success-panel h2 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 8px;
}

.success-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 8px;
}
@media (max-width: 480px) {
  .success-actions { flex-direction: column; align-items: stretch; width: 100%; max-width: 280px; margin-left: auto; margin-right: auto; }
}

.success-panel p {
  color: var(--gray-600);
  font-size: 0.875rem;
  max-width: 360px;
  margin: 0 auto 24px;
  line-height: 1.6;
}

/* ─── LOADING ────────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 28px;
  height: 28px;
  border: 3px solid rgba(0,0,0,.12);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-state {
  text-align: center;
  padding: 48px;
  color: var(--gray-400);
}

/* ─── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 680px) {
  .portal-content       { padding: 16px; }
  .portal-topbar        { padding: 0 12px; height: 78px; }
  .topbar-logo          { gap: 10px; min-width: 0; }
  .topbar-logo img      { height: 50px; flex-shrink: 0; }
  .topbar-client strong { font-size: 0.85rem; }
  .topbar-client        { font-size: 0.7rem; line-height: 1.3; min-width: 0; }
  .topbar-ref           { font-size: 0.62rem; }
  .topbar-right         { gap: 6px; }
  .btn-logout           { padding: 7px 12px; font-size: 0.78rem; }

  /* Contact: collapse to icon-only on mobile so it stays tappable but compact */
  .topbar-contact          { padding: 8px 10px; }
  .topbar-contact-number   { display: none; }
  .topbar-contact svg      { width: 20px; height: 20px; }
  .form-row             { grid-template-columns: 1fr; }
  .submit-section       { padding: 16px; }
  .submit-actions       { flex-direction: column; }
  .submit-actions .btn  { width: 100%; }
  .panel-title          { font-size: 1.15rem; }
  .panel-subtitle       { font-size: 0.85rem; }

  /* Navy tab bar — full-width buttons that split equally */
  .portal-tabs   { padding: 0; }
  .tab-btn       { flex: 1; justify-content: center; padding: 14px 8px 12px; font-size: 0.85rem; }
  .tab-btn svg   { display: none; }

  /* Sub-tabs — full width on mobile so taps are easy */
  .cases-subtabs { width: 100%; }
  .subtab-btn    { flex: 1; justify-content: center; }

  /* Case cards — stack header, balances comfortable */
  .case-card-header { flex-direction: column; gap: 10px; padding: 14px 16px; }
  .case-balances    { padding: 0 16px 14px; }
  .case-balance-value { font-size: 0.95rem; }
  .case-balance-row--outstanding .case-balance-value { font-size: 1.05rem; }
  .case-meta        { padding: 0 16px 14px; gap: 4px 14px; }
  .case-status-message { margin: 0 16px 16px; padding: 12px 14px; font-size: 0.825rem; }

  /* Search bar */
  .cases-search-wrap { width: 100%; }
  .cases-search-inner { width: 100%; }
  .cases-search-inner input { width: 100%; }
}

@media (max-width: 420px) {
  .auth-card-body  { padding: 24px 20px; }
  .auth-footer     { padding: 0 20px 24px; }
  .portal-content  { padding: 12px; }

  /* Even more compact tabs on very small screens */
  .tab-btn         { padding: 12px 4px 10px; font-size: 0.78rem; }
  .subtab-btn      { padding: 8px 10px; font-size: 0.8rem; }
}
