/* =====================================================================
 * WRIBZM Insurance & Beyond — global styles.
 * Loaded on every page after Bootstrap 5.
 * Complements the inline critical styles in components/head.php.
 * ===================================================================== */

/* ---------------------------------------------------------------------
 * 1. Design tokens
 * ------------------------------------------------------------------- */
:root {
  --wz-navy:    #0A2540;
  --wz-navy-2:  #103765;
  --wz-navy-3:  #1c4d7a;
  --wz-gold:    #C9A227;
  --wz-gold-2:  #b18f1c;
  --wz-ink:     #101828;
  --wz-muted:   #5b6b7b;
  --wz-border:  #e5eaf1;
  --wz-surface: #ffffff;
  --wz-surface-2: #f6f8fb;
  --wz-success: #198754;
  --wz-danger:  #dc3545;
  --wz-warning: #ffc107;
  --wz-radius:  16px;
  --wz-radius-sm: 10px;
  --wz-shadow:  0 4px 24px rgba(10, 37, 64, .08);
  --wz-shadow-sm: 0 2px 8px rgba(10, 37, 64, .06);
}

/* ---------------------------------------------------------------------
 * 2. Base
 * ------------------------------------------------------------------- */
html, body { -webkit-text-size-adjust: 100%; }
body.wz-body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
               Arial, "Noto Sans", "Liberation Sans", sans-serif;
  color: var(--wz-ink);
  background: var(--wz-surface-2);
  font-size: 15.5px;
  line-height: 1.55;
}

/* Slightly larger tap targets on mobile */
@media (max-width: 576px) {
  .btn, .form-control, .form-select { min-height: 42px; }
}

a { color: var(--wz-navy-2); }
a:hover { color: var(--wz-navy); }

/* Focus visibility on interactive elements only */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible {
  outline: 2px solid var(--wz-gold);
  outline-offset: 2px;
  box-shadow: none;
}

/* ---------------------------------------------------------------------
 * 3. Layout helpers
 * ------------------------------------------------------------------- */
.min-width-0 { min-width: 0; }
.text-balance { text-wrap: balance; }
.text-pretty  { text-wrap: pretty; }

/* Scroll padding for the sticky navbar */
html { scroll-padding-top: 72px; }

/* ---------------------------------------------------------------------
 * 4. Brand buttons
 * ------------------------------------------------------------------- */
.btn-wz-gold {
  background: var(--wz-gold);
  border-color: var(--wz-gold);
  color: #1a1a1a;
  font-weight: 600;
}
.btn-wz-gold:hover,
.btn-wz-gold:focus {
  background: var(--wz-gold-2);
  border-color: var(--wz-gold-2);
  color: #111;
}
.btn-wz-gold:disabled,
.btn-wz-gold.disabled {
  background: var(--wz-gold);
  border-color: var(--wz-gold);
  color: #1a1a1a;
  opacity: .55;
}

.btn-outline-navy {
  border-color: var(--wz-navy-2);
  color: var(--wz-navy-2);
}
.btn-outline-navy:hover {
  background: var(--wz-navy-2);
  color: #fff;
}

/* ---------------------------------------------------------------------
 * 5. Cards
 * ------------------------------------------------------------------- */
.card {
  border-radius: var(--wz-radius);
}
.card.border-0.shadow-sm {
  box-shadow: var(--wz-shadow-sm) !important;
}
.card-header {
  border-bottom: 1px solid var(--wz-border);
}

/* ---------------------------------------------------------------------
 * 6. Tables
 * ------------------------------------------------------------------- */
.table > :not(caption) > * > * {
  vertical-align: middle;
}
.table thead th {
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: uppercase;
  font-size: .72rem;
  color: var(--wz-muted);
  border-bottom-color: var(--wz-border);
}
.table-hover > tbody > tr:hover > * {
  background-color: #f8fafc;
}

/* ---------------------------------------------------------------------
 * 7. Forms
 * ------------------------------------------------------------------- */
.form-label {
  color: #28323f;
}
.form-text {
  color: var(--wz-muted);
}
.form-control:focus,
.form-select:focus {
  border-color: var(--wz-gold);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, .18);
}
.form-check-input:checked {
  background-color: var(--wz-navy-2);
  border-color: var(--wz-navy-2);
}
.form-switch .form-check-input:focus {
  box-shadow: 0 0 0 3px rgba(201, 162, 39, .18);
}

/* ---------------------------------------------------------------------
 * 8. Badges — ensure they read well on all backgrounds
 * ------------------------------------------------------------------- */
.badge.rounded-pill { padding: .4em .75em; font-weight: 600; letter-spacing: .01em; }
.badge.text-bg-light.border { color: var(--wz-ink); }

/* ---------------------------------------------------------------------
 * 9. Alerts
 * ------------------------------------------------------------------- */
.alert { border-radius: var(--wz-radius-sm); }
.alert-success { border-left: 4px solid var(--wz-success); }
.alert-danger  { border-left: 4px solid var(--wz-danger); }
.alert-warning { border-left: 4px solid var(--wz-warning); }
.alert-info    { border-left: 4px solid #0dcaf0; }

/* ---------------------------------------------------------------------
 * 10. Navbar tweaks for the offcanvas drawer
 * ------------------------------------------------------------------- */
@media (max-width: 991.98px) {
  .navbar-wz .offcanvas-body .nav-link {
    padding: .7rem .25rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
  }
  .navbar-wz .offcanvas-body .nav-item:last-child .nav-link {
    border-bottom: 0;
  }
}

/* ---------------------------------------------------------------------
 * 11. Breadcrumbs
 * ------------------------------------------------------------------- */
.breadcrumb {
  --bs-breadcrumb-divider-color: #9aa7b5;
  --bs-breadcrumb-item-padding-x: .4rem;
}
.breadcrumb-item a { text-decoration: none; }
.breadcrumb-item a:hover { text-decoration: underline; }

/* ---------------------------------------------------------------------
 * 12. Pagination
 * ------------------------------------------------------------------- */
.pagination .page-link { color: var(--wz-navy-2); border-color: var(--wz-border); }
.pagination .page-item.active .page-link {
  background: var(--wz-navy-2);
  border-color: var(--wz-navy-2);
  color: #fff;
}
.pagination .page-link:focus { box-shadow: 0 0 0 3px rgba(201,162,39,.18); }

/* ---------------------------------------------------------------------
 * 13. Page transition (subtle, respects reduced motion)
 * ------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  main { animation: wz-fade-in .18s ease-out; }
}
@keyframes wz-fade-in {
  from { opacity: 0; transform: translateY(2px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ---------------------------------------------------------------------
 * 14. Utility: visually-hidden focusable skip-link
 * ------------------------------------------------------------------- */
.visually-hidden-focusable:focus {
  position: absolute !important;
  z-index: 2000;
}

/* ---------------------------------------------------------------------
 * 15. Mobile-friendly tables
 * ------------------------------------------------------------------- */
@media (max-width: 767.98px) {
  .table-responsive {
    -webkit-overflow-scrolling: touch;
    border-radius: var(--wz-radius-sm);
  }
}

/* ---------------------------------------------------------------------
 * 16. Autodismiss timing hint for JS (data attribute driven)
 * ------------------------------------------------------------------- */
[data-autodismiss] { transition: opacity .35s ease, transform .35s ease; }
[data-autodismiss].wz-dismissing { opacity: 0; transform: translateY(-4px); }

/* ---------------------------------------------------------------------
 * 17. Form submit lockout state (set by app.js on submit)
 * ------------------------------------------------------------------- */
button[data-submitting] { pointer-events: none; opacity: .7; }