/* ============================================================
   BizHub365 – Design Token Layer & Bootstrap Overrides
   Finazze-inspired corporate finance refresh (Outfit, stronger contrast)
   Primary: #1B54B6  |  Secondary / Teal: #2FA89A
   ============================================================ */

/* Skip navigation link (2.4.1) */
.skip-to-main:focus {
  position: fixed;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 9999;
  padding: 0.5rem 1rem;
  background: #fff;
  color: var(--bh-blue);
  font-weight: 600;
  border: 2px solid var(--bh-blue);
  border-radius: 4px;
  text-decoration: none;
}

/* ----------------------------------------------------------
   1. Design Tokens (CSS Custom Properties)
   ---------------------------------------------------------- */
:root {
  /* Brand colours */
  --bh-blue:        #1B54B6;
  --bh-blue-deep:   #154399;
  --bh-blue-light:  #E8F0FF;
  --bh-teal:        #1D7A70;
  --bh-teal-deep:   #16675F;
  --bh-teal-light:  #E3F6F3;
  --bh-navy:        #0B1F42;
  --bh-navy-mid:    #123364;
  --bh-accent:      #E8B84A;

  /* Semantic surface colours */
  --bh-surface:        #FFFFFF;
  --bh-surface-raised: #F5F8FD;
  --bh-surface-inset:  #EAF1FB;
  --bh-page-bg:        #EEF3FA;

  /* Text — darkened for readability */
  --bh-ink:        #0A1830;
  --bh-ink-soft:   #1E3050;
  --bh-muted:      #3D4F6B;
  --bh-muted-soft: #5A6B86;

  /* Borders */
  --bh-border:        #C5D6F0;
  --bh-border-soft:   #DCE7F6;
  --bh-border-strong: #A8C2E8;

  /* Semantic states */
  --bh-success: #0C5C42;
  --bh-warning: #D9A03A;
  --bh-danger:  #8B1520;
  --bh-info:    #3B7DE8;

  /* Shadows */
  --bh-shadow-xs: 0 1px 2px rgba(10,24,48,0.06);
  --bh-shadow-sm: 0 4px 14px rgba(10,24,48,0.07);
  --bh-shadow-md: 0 10px 28px rgba(10,24,48,0.10);
  --bh-shadow-lg: 0 18px 44px rgba(10,24,48,0.13);
  --bh-shadow-xl: 0 28px 60px rgba(8,18,36,0.16);

  /* Radius scale */
  --bh-radius-xs:   4px;
  --bh-radius-sm:   8px;
  --bh-radius-md:   12px;
  --bh-radius-lg:   16px;
  --bh-radius-xl:   24px;
  --bh-radius-pill: 9999px;

  /* Typography — Outfit (Finazze-style corporate finance) */
  --bh-font: 'Outfit', 'Segoe UI', system-ui, sans-serif;

  /* Bootstrap overrides via CSS vars */
  --bs-primary:            var(--bh-blue);
  --bs-primary-rgb:        27, 84, 182;
  --bs-secondary:          var(--bh-teal);
  --bs-secondary-rgb:      29, 122, 112;
  --bs-body-font-family:   var(--bh-font);
  --bs-btn-font-family:    var(--bh-font);
  --bs-body-color:         var(--bh-ink);
  --bs-body-bg:            var(--bh-page-bg);
  --bs-border-radius:      var(--bh-radius-sm);
  --bs-border-radius-sm:   var(--bh-radius-xs);
  --bs-border-radius-lg:   var(--bh-radius-md);
  --bs-border-radius-xl:   var(--bh-radius-lg);
  --bs-border-radius-pill: var(--bh-radius-pill);
  --bs-border-color:       var(--bh-border);
  --bs-link-color:         var(--bh-blue);
  --bs-link-hover-color:   var(--bh-blue-deep);
}

/* ----------------------------------------------------------
   2. Global Reset & Typography
   ---------------------------------------------------------- */
html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--bh-font);
  font-size: 0.975rem;
  line-height: 1.65;
  color: var(--bh-ink);
  background-color: var(--bh-page-bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 0% -10%, rgba(27, 84, 182, 0.08), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(47, 168, 154, 0.07), transparent 50%),
    linear-gradient(180deg, #f4f7fc 0%, var(--bh-page-bg) 40%, #e8eef8 100%);
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: var(--bh-font);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--bh-ink);
  line-height: 1.22;
}

h1, .h1 { font-size: clamp(1.85rem, 3.2vw, 2.4rem); font-weight: 800; }
h2, .h2 { font-size: clamp(1.4rem, 2.6vw, 1.85rem); font-weight: 700; }
h3, .h3 { font-size: clamp(1.15rem, 2vw, 1.4rem); font-weight: 700; }
h4, .h4 { font-size: 1.12rem; font-weight: 600; }
h5, .h5 { font-size: 1rem; font-weight: 600; }
h6, .h6 { font-size: 0.9rem; font-weight: 600; }

p { margin-bottom: 1rem; }

a {
  color: var(--bh-blue);
  text-decoration: none;
  transition: color 150ms ease;
}
a:hover { color: var(--bh-blue-deep); }

footer a { text-decoration: none; }

.text-muted { color: var(--bh-muted) !important; }

/* ----------------------------------------------------------
   3. Bootstrap Colour Utility Overrides
   ---------------------------------------------------------- */
.text-primary   { color: var(--bh-blue)  !important; }
.text-secondary { color: var(--bh-teal)  !important; }
.text-muted     { color: var(--bh-muted) !important; }

.bg-primary   { background-color: var(--bh-blue) !important; }
.bg-secondary { background-color: var(--bh-teal) !important; }
.bg-success   { background-color: var(--bh-success) !important; }
.bg-warning   { background-color: var(--bh-warning) !important; }
.bg-danger    { background-color: var(--bh-danger)  !important; }

.border-primary   { border-color: var(--bh-blue) !important; }
.border-secondary { border-color: var(--bh-teal) !important; }

.text-bg-primary   { color: #fff !important; background-color: var(--bh-blue)    !important; }
.text-bg-secondary { color: #1b1b1b !important; background-color: var(--bh-teal)    !important; }
.text-bg-success   { color: #fff !important; background-color: var(--bh-success) !important; }
.text-bg-warning   { color: #fff !important; background-color: var(--bh-warning) !important; }
.text-bg-danger    { color: #1b1b1b !important; background-color: var(--bh-danger)  !important; }

.text-danger { color: var(--bh-danger) !important; }

/* ----------------------------------------------------------
   4. Badge Variants
   ---------------------------------------------------------- */
.badge {
  padding: 0.38rem 0.65rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: var(--bh-radius-xs) !important;
}

.badge-secondary { background-color: var(--bh-teal);   color: #fff; }
.badge-danger    { background-color: var(--bh-danger);  color: #fff; }
.badge-disabled, .btn-disabled {
  background-color: #6c757d !important;
  color: #fff !important;
  opacity: 1 !important;
}
.btn.disabled { pointer-events: none; opacity: 0.65; }

/* ----------------------------------------------------------
   5. Form Controls
   ---------------------------------------------------------- */
.form-label {
  margin-bottom: 0.4rem;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--bh-ink-soft);
}

.form-control,
.form-select,
.input-group-text {
  min-height: 2.75rem;
  border: 1.5px solid var(--bh-border);
  border-radius: var(--bh-radius-sm) !important;
  background: var(--bh-surface);
  color: var(--bh-ink);
  font-size: 0.9375rem;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

textarea.form-control { min-height: 6rem; }

.form-control::placeholder { color: var(--bh-muted-soft); }

.form-control:focus,
.form-select:focus {
  border-color: var(--bh-blue);
  box-shadow: 0 0 0 3px rgba(27, 84, 182, 0.22);
  outline: 2px solid var(--bh-blue);
  outline-offset: 1px;
}

.input-group > .btn { box-shadow: none; }

.form-check-input {
  border: 1.5px solid var(--bh-border-strong);
  border-radius: var(--bh-radius-xs) !important;
}
.form-check-input:checked {
  background-color: var(--bh-blue);
  border-color: var(--bh-blue);
}
.form-check-input:checked[type="checkbox"] {
  --bs-form-check-bg-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e");
}
.form-switch .form-check-input {
  width: 2.2em;
  --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3crect x='-3' y='-3' width='6' height='6' fill='rgba(0,0,0,0.25)'/%3e%3c/svg%3e");
  background-position: left center;
  transition: background-position 0.15s ease-in-out;
}
.form-switch .form-check-input:checked {
  background-position: right center;
  --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3crect x='-3' y='-3' width='6' height='6' fill='%23fff'/%3e%3c/svg%3e");
}
.form-switch .form-check-input:focus {
  --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3crect x='-3' y='-3' width='6' height='6' fill='%2386b7fe'/%3e%3c/svg%3e");
}

/* ----------------------------------------------------------
   6. Dropdown caret suppression
   ---------------------------------------------------------- */
.dropdown-toggle::after { content: none; display: none; }

/* ----------------------------------------------------------
   7. Misc utilities
   ---------------------------------------------------------- */
.app-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

div#notif-list { color: var(--bh-ink); }
.hightlighted  { color: white; }

/* HMRC MTD Recognised Badge */
.hmrc-mtd-recognised {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
img.img-fluid.hmrc-mtd-regonised {
  width: 90px;
  height: auto;
}
.hmrc-mtd-recognised-container {
  background: white;
  height: 130px;
  width: 130px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: var(--bh-radius-sm);
  box-shadow: var(--bh-shadow-sm);
}
.hmrc-mtd-recognised-p {
  color: var(--bh-ink) !important;
  margin: 0 !important;
  padding: 0 !important;
  font-weight: 700;
  font-size: 0.8rem;
}

/* ----------------------------------------------------------
   8. View Transitions
   ---------------------------------------------------------- */
body { view-transition-name: page; }

::view-transition-old(page) { animation: 0.22s ease-in both bh-leave; }
::view-transition-new(page) { animation: 0.22s ease-out both bh-enter; }

@keyframes bh-leave {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-4px); }
}
@keyframes bh-enter {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

::view-transition-group(*) { animation-duration: 0.28s; }

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*) { animation-duration: 0s !important; }
}

/* ----------------------------------------------------------
   9. Cookie consent
   ---------------------------------------------------------- */
button.btn.btn-link.text-start.text-white.p-0.cookie-settings-link.text-decoration-none {
  font-weight: 400;
}

/* Modal header close button */
.modal-header button.btn-close {
    display: inline-block;
    background-position: left;
    padding-left: 20px !important;
    width: auto;
    height: 1.3em;
}

/* Choices.js item styling */
.choices__item {
    color: #1b1b1b !important;
}
.choices__placeholder {
    opacity: 1 !important;
}

/* Disabled form check labels */
.form-check-input:disabled~.form-check-label, .form-check-input[disabled]~.form-check-label {
    opacity: 1 !important;
    cursor: not-allowed !important;
}

.bh-logo {
    width: 150px;
}