/*
 * LLF Brand Design System
 * Long Law, P.C.
 *
 * Primary Blue:  #395A7B
 * Primary Orange: #E74E1B
 * Used by: portal.long.law and startup.long.law
 *
 * Sections:
 *   1. CSS Variables & Reset
 *   2. Typography
 *   3. Layout
 *   4. Header / Navigation
 *   5. Buttons
 *   6. Cards
 *   7. Forms
 *   8. Badges & Tags
 *   9. Alerts & Messages
 *  10. Tables
 *  11. Tooltips & Info Buttons
 *  12. Loading States
 *  13. Modal
 *  14. Footer
 *  15. Utility Classes
 *  16. Responsive
 */

/* ============================================================
   1. CSS VARIABLES & RESET
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  /* Brand Colors */
  --blue:          #395A7B;
  --blue-dark:     #2c4660;
  --blue-light:    #4a6d8c;
  --blue-xlight:   #e8eef4;
  --orange:        #E74E1B;
  --orange-dark:   #c94016;
  --orange-light:  #f0623a;
  --orange-xlight: #fdeee9;

  /* Neutral Palette */
  --white:         #ffffff;
  --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;

  /* Semantic Colors */
  --success:       #16a34a;
  --success-light: #dcfce7;
  --warning:       #d97706;
  --warning-light: #fef3c7;
  --error:         #dc2626;
  --error-light:   #fee2e2;
  /* Alias: several admin templates style destructive actions with
     var(--danger); without a definition those rules silently no-op
     (the Decline button rendered white-on-white). */
  --danger:        #dc2626;
  --danger-light:  #fee2e2;
  --info:          #2563eb;
  --info-light:    #dbeafe;

  /* Typography */
  --font-family:   'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-size-xs:  0.75rem;    /* 12px */
  --font-size-sm:  0.875rem;   /* 14px */
  --font-size-base: 1rem;      /* 16px */
  --font-size-lg:  1.125rem;   /* 18px */
  --font-size-xl:  1.25rem;    /* 20px */
  --font-size-2xl: 1.5rem;     /* 24px */
  --font-size-3xl: 1.875rem;   /* 30px */
  --font-size-4xl: 2.25rem;    /* 36px */

  /* Spacing */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* Borders */
  --radius-sm:  4px;
  --radius:     8px;
  --radius-md:  10px;
  --radius-lg:  12px;
  --radius-xl:  16px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.08);
  --shadow:     0 2px 8px rgba(0,0,0,0.10);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.12);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.14);
  --shadow-xl:  0 16px 48px rgba(0,0,0,0.16);

  /* Transitions */
  --transition: 0.2s ease;
  --transition-slow: 0.3s ease;

  /* Layout */
  --container-max: 1200px;
  --header-height: 68px;
}

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

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

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: 1.6;
  color: var(--gray-800);
  background: var(--gray-50);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--blue);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--orange);
}

img {
  max-width: 100%;
  height: auto;
}

/* Focus styles — accessibility */
:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--blue);
  color: white;
  padding: var(--space-2) var(--space-4);
  z-index: 1000;
  font-size: var(--font-size-sm);
  font-weight: 600;
  transition: top var(--transition);
}

.skip-link:focus {
  top: 0;
}


/* ============================================================
   2. TYPOGRAPHY
   ============================================================ */

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.25;
  color: var(--blue);
}

h1 { font-size: var(--font-size-3xl); }
h2 { font-size: var(--font-size-2xl); }
h3 { font-size: var(--font-size-xl); }
h4 { font-size: var(--font-size-lg); }
h5 { font-size: var(--font-size-base); }
h6 { font-size: var(--font-size-sm); }

.page-title {
  font-size: var(--font-size-3xl);
  font-weight: 800;
  color: var(--blue);
  margin-bottom: var(--space-2);
}

.page-subtitle {
  font-size: var(--font-size-lg);
  color: var(--gray-500);
  font-weight: 400;
  margin-bottom: var(--space-6);
}

.section-title {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--blue);
  margin-bottom: var(--space-4);
}

.section-title-orange {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--orange);
  margin-bottom: var(--space-4);
}

p {
  margin-bottom: var(--space-4);
  color: var(--gray-700);
  line-height: 1.7;
}

p:last-child {
  margin-bottom: 0;
}

.text-sm    { font-size: var(--font-size-sm); }
.text-xs    { font-size: var(--font-size-xs); }
.text-lg    { font-size: var(--font-size-lg); }
.text-xl    { font-size: var(--font-size-xl); }
.text-muted { color: var(--gray-500); }
.text-blue  { color: var(--blue); }
.text-orange { color: var(--orange); }
.text-success { color: var(--success); }
.text-error   { color: var(--error); }
.font-bold   { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }


/* ============================================================
   3. LAYOUT
   ============================================================ */

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-5);
}

.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-content {
  flex: 1;
  padding: var(--space-8) var(--space-5);
  max-width: var(--container-max);
  margin: 0 auto;
  width: 100%;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: var(--space-8);
  align-items: start;
}

.three-col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

.two-col-equal {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
}

.divider {
  border: none;
  border-top: 1px solid var(--gray-200);
  margin: var(--space-6) 0;
}


/* ============================================================
   4. HEADER / NAVIGATION
   ============================================================ */

.llf-header {
  background: var(--blue);
  color: white;
  height: var(--header-height);
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
  position: sticky;
  top: 0;
  z-index: 100;
}

.llf-header .container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.llf-header .logo img {
  height: 38px;
  width: auto;
  display: block;
}

.llf-header nav {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.llf-header nav a {
  color: rgba(255,255,255,0.85);
  font-size: var(--font-size-sm);
  font-weight: 500;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius);
  transition: all var(--transition);
  white-space: nowrap;
}

.llf-header nav a:hover,
.llf-header nav a.active {
  color: white;
  background: rgba(255,255,255,0.12);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* Dev environment badge */
.dev-badge {
  background: #fbbf24;
  color: #78350f;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Staff badge */
.staff-badge {
  background: rgba(231, 78, 27, 0.2);
  color: #fca38a;
  border: 1px solid rgba(231, 78, 27, 0.4);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}


/* ============================================================
   5. BUTTONS
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius);
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  border: 2px solid transparent;
  text-decoration: none;
  transition: all var(--transition);
  white-space: nowrap;
  user-select: none;
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Primary — Orange CTA */
.btn-primary {
  background: var(--orange);
  color: white;
  border-color: var(--orange);
}

.btn-primary:hover {
  background: var(--orange-dark);
  border-color: var(--orange-dark);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(231,78,27,0.35);
}

/* Secondary — Blue */
.btn-secondary {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
}

.btn-secondary:hover {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
  color: white;
  transform: translateY(-1px);
}

/* Outline Blue */
.btn-outline {
  background: transparent;
  color: var(--blue);
  border-color: var(--blue);
}

.btn-outline:hover {
  background: var(--blue);
  color: white;
}

/* Outline Orange */
.btn-outline-orange {
  background: transparent;
  color: var(--orange);
  border-color: var(--orange);
}

.btn-outline-orange:hover {
  background: var(--orange);
  color: white;
}

/* Ghost */
.btn-ghost {
  background: transparent;
  color: var(--blue);
  border-color: transparent;
}

.btn-ghost:hover {
  background: var(--blue-xlight);
  color: var(--blue);
}

/* Danger */
.btn-danger {
  background: var(--error);
  color: white;
  border-color: var(--error);
}

.btn-danger:hover {
  background: #b91c1c;
  border-color: #b91c1c;
  color: white;
}

/* Success */
.btn-success {
  background: var(--success);
  color: white;
  border-color: var(--success);
}

/* Sizes */
.btn-sm {
  padding: var(--space-2) var(--space-3);
  font-size: var(--font-size-sm);
}

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--font-size-lg);
  border-radius: var(--radius-md);
}

.btn-full {
  display: flex;
  width: 100%;
}

/* Loading spinner inside button */
.btn .spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}


/* ============================================================
   6. CARDS
   ============================================================ */

.card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-body {
  padding: var(--space-6);
}

.card-header {
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.card-header h2,
.card-header h3 {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--blue);
  margin: 0;
}

.card-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--gray-200);
  background: var(--gray-50);
}

/* Matter card — used on portal dashboard */
.matter-card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border-left: 4px solid var(--blue);
  padding: var(--space-5) var(--space-6);
  margin-bottom: var(--space-4);
  transition: box-shadow var(--transition);
}

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

.matter-card.status-open { border-left-color: var(--blue); }
.matter-card.status-pending { border-left-color: var(--warning); }
.matter-card.status-closed { border-left-color: var(--gray-400); }

/* Product card — used on store */
.product-card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 2px solid transparent;
  transition: border-color var(--transition), box-shadow var(--transition);
  overflow: hidden;
}

.product-card:hover {
  border-color: var(--orange);
  box-shadow: var(--shadow-md);
}

.product-card.selected,
.product-card.expanded {
  border-color: var(--orange);
  box-shadow: var(--shadow-md);
}

.product-card.featured {
  border-color: var(--blue);
}

/* Attorney card — used on store consultation section */
.attorney-card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: var(--space-5);
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
  transition: box-shadow var(--transition);
}

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

.attorney-card .photo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--blue-xlight);
  border: 2px solid var(--blue);
}

.attorney-card .photo-placeholder {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: var(--font-size-xl);
  font-weight: 700;
  flex-shrink: 0;
}

.attorney-card .info h4 {
  font-size: var(--font-size-base);
  color: var(--blue);
  margin-bottom: var(--space-1);
}

.attorney-card .info .title {
  font-size: var(--font-size-sm);
  color: var(--gray-500);
  margin-bottom: var(--space-2);
}

.attorney-card .slots {
  margin-top: var(--space-3);
}

.attorney-card .slot {
  display: inline-block;
  background: var(--blue-xlight);
  color: var(--blue);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 600;
  margin: var(--space-1) var(--space-1) 0 0;
}


/* ============================================================
   7. FORMS
   ============================================================ */

.form-group {
  margin-bottom: var(--space-5);
}

.form-label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: var(--space-2);
}

.form-label .required {
  color: var(--orange);
  margin-left: var(--space-1);
}

.form-control {
  display: block;
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius);
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  color: var(--gray-800);
  background: white;
  transition: border-color var(--transition), box-shadow var(--transition);
  line-height: 1.5;
}

.form-control:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(57,90,123,0.15);
}

.form-control::placeholder {
  color: var(--gray-400);
}

.form-control.is-invalid {
  border-color: var(--error);
}

.form-control.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(220,38,38,0.15);
}

select.form-control {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
  padding-right: var(--space-10);
}

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

.form-hint {
  font-size: var(--font-size-xs);
  color: var(--gray-500);
  margin-top: var(--space-1);
}

.form-error {
  font-size: var(--font-size-xs);
  color: var(--error);
  margin-top: var(--space-1);
  font-weight: 500;
}

/* Checkbox & Radio */
.form-check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  cursor: pointer;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--blue);
  cursor: pointer;
  flex-shrink: 0;
}

.form-check label {
  font-size: var(--font-size-sm);
  color: var(--gray-700);
  cursor: pointer;
  line-height: 1.5;
}

/* Price display in forms */
.price-display {
  font-size: var(--font-size-2xl);
  font-weight: 800;
  color: var(--orange);
}

.price-breakdown {
  margin-top: var(--space-2);
}

.price-breakdown .price-line {
  display: flex;
  justify-content: space-between;
  font-size: var(--font-size-sm);
  color: var(--gray-600);
  padding: var(--space-1) 0;
}

.price-breakdown .price-line.total {
  font-weight: 700;
  font-size: var(--font-size-base);
  color: var(--gray-800);
  border-top: 1px solid var(--gray-200);
  padding-top: var(--space-2);
  margin-top: var(--space-1);
}

.price-breakdown .price-line .filing-fee-label {
  color: var(--gray-500);
  font-style: italic;
}


/* ============================================================
   8. BADGES & TAGS
   ============================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-blue    { background: var(--blue-xlight);    color: var(--blue); }
.badge-orange  { background: var(--orange-xlight);  color: var(--orange-dark); }
.badge-success { background: var(--success-light);  color: var(--success); }
.badge-warning { background: var(--warning-light);  color: var(--warning); }
.badge-error   { background: var(--error-light);    color: var(--error); }
.badge-gray    { background: var(--gray-100);        color: var(--gray-600); }

/* Matter status badges */
.badge-status-open    { background: #dbeafe; color: #1d4ed8; }
.badge-status-pending { background: var(--warning-light); color: var(--warning); }
.badge-status-closed  { background: var(--gray-100); color: var(--gray-500); }

/* Order status badges */
.badge-status-cart           { background: var(--gray-100);    color: var(--gray-600); }
.badge-status-msa-signed     { background: #dbeafe;            color: #1d4ed8; }
.badge-status-paid           { background: var(--success-light); color: var(--success); }
.badge-status-matter-created { background: var(--blue-xlight); color: var(--blue); }
.badge-status-complete       { background: var(--success-light); color: var(--success); }

/* Featured badge */
.badge-featured {
  background: var(--orange);
  color: white;
  font-size: var(--font-size-xs);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 700;
}

/* Recommended badge */
.badge-recommended {
  background: var(--blue);
  color: white;
  font-size: var(--font-size-xs);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 700;
}


/* ============================================================
   9. ALERTS & MESSAGES
   ============================================================ */

.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius);
  margin-bottom: var(--space-4);
  font-size: var(--font-size-sm);
  line-height: 1.6;
  border-left: 4px solid;
}

.alert-title {
  font-weight: 700;
  margin-bottom: var(--space-1);
  font-size: var(--font-size-base);
}

.alert-success {
  background: var(--success-light);
  color: #166534;
  border-left-color: var(--success);
}

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

.alert-error {
  background: var(--error-light);
  color: #991b1b;
  border-left-color: var(--error);
}

.alert-info {
  background: var(--info-light);
  color: #1e3a8a;
  border-left-color: var(--info);
}

.alert-blue {
  background: var(--blue-xlight);
  color: var(--blue-dark);
  border-left-color: var(--blue);
}

/* Flash message (shown after form submissions) */
.flash-messages {
  margin-bottom: var(--space-4);
}

/* Outstanding balance warning */
.balance-warning {
  background: var(--warning-light);
  border: 1px solid #fcd34d;
  border-left: 4px solid var(--warning);
  border-radius: var(--radius);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-5);
}

.balance-warning .amount {
  font-size: var(--font-size-xl);
  font-weight: 800;
  color: var(--warning);
}

/* Error state (friendly) — used in checkout flow on API failures */
.friendly-error {
  background: var(--orange-xlight);
  border: 1px solid #fca38a;
  border-left: 4px solid var(--orange);
  border-radius: var(--radius);
  padding: var(--space-5) var(--space-6);
  text-align: center;
}

.friendly-error h3 {
  color: var(--orange-dark);
  margin-bottom: var(--space-3);
}

.friendly-error p {
  color: var(--gray-700);
  margin-bottom: var(--space-4);
}


/* ============================================================
   10. TABLES
   ============================================================ */

.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

thead {
  background: var(--blue);
  color: white;
}

thead th {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-size: var(--font-size-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--gray-200);
  transition: background var(--transition);
}

tbody tr:last-child {
  border-bottom: none;
}

tbody tr:hover {
  background: var(--gray-50);
}

tbody td {
  padding: var(--space-3) var(--space-4);
  font-size: var(--font-size-sm);
  color: var(--gray-700);
}

.table-striped tbody tr:nth-child(even) {
  background: var(--gray-50);
}


/* ============================================================
   11. TOOLTIPS & INFO BUTTONS
   ============================================================ */

/* The "?" info button */
.info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--gray-200);
  color: var(--gray-600);
  font-size: var(--font-size-xs);
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}

.info-btn:hover {
  background: var(--blue);
  color: white;
}

/* "Ask For Guidance" link */
.guidance-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--font-size-sm);
  color: var(--blue);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-style: dotted;
  cursor: pointer;
  transition: color var(--transition);
}

.guidance-link:hover {
  color: var(--orange);
}

.guidance-link::before {
  content: '💬';
  font-size: var(--font-size-xs);
}

/* Inline label + info combo */
.label-with-info {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

/* Button + info button combo */
.btn-with-info {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}


/* ============================================================
   12. LOADING STATES
   ============================================================ */

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

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

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

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

.spinner-sm {
  width: 16px;
  height: 16px;
  border-width: 2px;
}

.spinner-lg {
  width: 40px;
  height: 40px;
  border-width: 4px;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.skeleton {
  background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
  background-size: 200% 100%;
  animation: skeleton-wave 1.5s ease-in-out infinite;
  border-radius: var(--radius);
}

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

.skeleton-text { height: 16px; margin-bottom: var(--space-2); }
.skeleton-title { height: 28px; margin-bottom: var(--space-3); width: 60%; }
.skeleton-card { height: 120px; }


/* ============================================================
   13. MODAL
   ============================================================ */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  animation: fadeIn 0.2s ease;
}

.modal {
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: fadeIn 0.2s ease;
}

.modal-header {
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h2 {
  font-size: var(--font-size-xl);
  color: var(--blue);
}

.modal-close {
  background: none;
  border: none;
  font-size: var(--font-size-xl);
  color: var(--gray-400);
  cursor: pointer;
  padding: var(--space-1);
  line-height: 1;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.modal-close:hover {
  color: var(--gray-700);
  background: var(--gray-100);
}

.modal-body {
  padding: var(--space-6);
}

.modal-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--gray-200);
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
}

/* DocuSign embed container */
.docusign-container {
  width: 100%;
  height: 600px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
}

.docusign-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}


/* ============================================================
   14. FOOTER
   ============================================================ */

.llf-footer {
  background: var(--blue-dark);
  color: rgba(255,255,255,0.75);
  padding: var(--space-8) 0;
  margin-top: auto;
}

.llf-footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6);
  justify-content: space-between;
  align-items: flex-start;
}

.llf-footer .footer-brand img {
  height: 32px;
  opacity: 0.9;
  margin-bottom: var(--space-3);
}

.llf-footer .footer-text {
  font-size: var(--font-size-sm);
  line-height: 1.7;
  color: rgba(255,255,255,0.75);
}

.llf-footer .footer-links {
  display: flex;
  gap: var(--space-6);
  flex-wrap: wrap;
}

.llf-footer .footer-links a {
  color: rgba(255,255,255,0.65);
  font-size: var(--font-size-sm);
  transition: color var(--transition);
}

.llf-footer .footer-links a:hover {
  color: white;
}

.llf-footer .footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: var(--space-5);
  margin-top: var(--space-5);
  width: 100%;
  font-size: var(--font-size-xs);
  color: rgba(255,255,255,0.5);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* Consultation CTA bar — shown at bottom of store pages */
.consultation-bar {
  background: var(--blue-xlight);
  border-top: 1px solid var(--gray-200);
  padding: var(--space-5) 0;
  text-align: center;
}

.consultation-bar p {
  font-size: var(--font-size-base);
  color: var(--gray-600);
  margin-bottom: var(--space-3);
}

.consultation-bar .actions {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  flex-wrap: wrap;
}


/* ============================================================
   15. UTILITY CLASSES
   ============================================================ */

.hidden       { display: none !important; }
.visible      { display: block !important; }
.sr-only      {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.flex         { display: flex; }
.flex-col     { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.items-start  { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.flex-wrap    { flex-wrap: wrap; }
.gap-2        { gap: var(--space-2); }
.gap-3        { gap: var(--space-3); }
.gap-4        { gap: var(--space-4); }

.text-center  { text-align: center; }
.text-right   { text-align: right; }

.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

.p-4  { padding: var(--space-4); }
.p-5  { padding: var(--space-5); }
.p-6  { padding: var(--space-6); }
.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }

.rounded    { border-radius: var(--radius); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

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

.bg-white    { background: white; }
.bg-blue     { background: var(--blue); color: white; }
.bg-blue-light { background: var(--blue-xlight); }
.bg-orange   { background: var(--orange); color: white; }
.bg-gray     { background: var(--gray-50); }

/* Progress timeline */
.progress-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.timeline-item {
  display: flex;
  gap: var(--space-4);
  position: relative;
}

.timeline-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 32px;
  bottom: 0;
  width: 2px;
  background: var(--gray-200);
  z-index: 0;
}

.timeline-item.completed::before {
  background: var(--success);
}

.timeline-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gray-200);
  border: 3px solid var(--gray-300);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-xs);
  color: var(--gray-500);
  z-index: 1;
  position: relative;
}

.timeline-item.completed .timeline-dot {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.timeline-item.in-progress .timeline-dot {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
  animation: pulse 2s ease-in-out infinite;
}

.timeline-content {
  padding-bottom: var(--space-6);
  flex: 1;
}

.timeline-content .step-name {
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: var(--space-1);
}

.timeline-item.completed .timeline-content .step-name {
  color: var(--success);
}

.timeline-content .step-date {
  font-size: var(--font-size-xs);
  color: var(--gray-500);
}

/* Compliance due date widget */
.compliance-widget {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: var(--space-5);
  margin-bottom: var(--space-4);
}

.compliance-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--gray-100);
}

.compliance-item:last-child {
  border-bottom: none;
}

.compliance-item .entity-name {
  font-weight: 600;
  color: var(--gray-800);
  font-size: var(--font-size-sm);
}

.compliance-item .due-date {
  font-size: var(--font-size-xs);
  color: var(--gray-500);
}

.compliance-item .due-soon .due-date {
  color: var(--warning);
  font-weight: 600;
}

.compliance-item .overdue .due-date {
  color: var(--error);
  font-weight: 700;
}


/* ============================================================
   16. RESPONSIVE
   ============================================================ */

@media (max-width: 900px) {
  .two-col {
    grid-template-columns: 1fr;
  }

  .three-col {
    grid-template-columns: repeat(2, 1fr);
  }

  .two-col-equal {
    grid-template-columns: 1fr;
  }

  .llf-header nav {
    display: none; /* Mobile: handled by hamburger menu (future) */
  }

  .page-title {
    font-size: var(--font-size-2xl);
  }
}

@media (max-width: 600px) {
  :root {
    --header-height: 60px;
  }

  .three-col {
    grid-template-columns: 1fr;
  }

  .container,
  .page-content {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }

  .btn-lg {
    padding: var(--space-3) var(--space-5);
    font-size: var(--font-size-base);
  }

  .modal {
    margin: var(--space-4);
    max-height: 85vh;
  }

  .llf-footer .footer-links {
    flex-direction: column;
    gap: var(--space-2);
  }
}
