/* ============================================================
   PVG Manager – Design Token Layer & Bootstrap Overrides
   Primary: #1B54B6  |  Secondary / Teal: #38A197
   ============================================================ */

/* 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(--pvg-green);
  font-weight: 600;
  border: 2px solid var(--pvg-green);
  border-radius: 4px;
  text-decoration: none;
}

/* PVG Logo */
.pvg-logo {
    width: 150px;
}

/* ----------------------------------------------------------
   1. Design Tokens (CSS Custom Properties)
   ---------------------------------------------------------- */
:root {
  /* Brand colours */
  --pvg-green:        #8cff98;
  --pvg-green-deep:   #54b45e;
  --pvg-green-light:  #EBF2FF;
  --pvg-teal:        #aad922;
  --pvg-teal-deep:   #aad922;
  --pvg-teal-light:  #E6F5F4;
  --pvg-navy:        #aad922;
  --pvg-navy-mid:    #aad922;

  /* Semantic surface colours */
  --pvg-surface:        #FFFFFF;
  --pvg-surface-raised: #F8FBFF;
  --pvg-surface-inset:  #EFF5FF;
  --pvg-page-bg:        #F2F6FC;

  /* Text */
  --pvg-ink:        #0E1F3B;
  --pvg-ink-soft:   #2B3D5C;
  --pvg-muted:      #5E6E8A;
  --pvg-muted-soft: #8A97AD;

  /* Borders */
  --pvg-border:        #D4E3FA;
  --pvg-border-soft:   #E6EFFC;
  --pvg-border-strong: #B8CFF5;

  /* Semantic states */
  --pvg-success: #0F6147;
  --pvg-warning: #F0B44D;
  --pvg-danger:  #931A26;
  --pvg-info:    #4D8CF6;

  /* Shadows */
  --pvg-shadow-xs: 0 1px 3px rgba(14,31,59,0.06);
  --pvg-shadow-sm: 0 4px 12px rgba(14,31,59,0.08);
  --pvg-shadow-md: 0 8px 24px rgba(14,31,59,0.10);
  --pvg-shadow-lg: 0 16px 40px rgba(14,31,59,0.14);
  --pvg-shadow-xl: 0 24px 56px rgba(10,25,48,0.18);

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

  /* Typography */
  --pvg-font: 'Inter', system-ui, -apple-system, sans-serif;

  /* Bootstrap overrides via CSS vars */
  --bs-primary:            var(--pvg-green);
  --bs-primary-rgb:        49, 112, 224;
  --bs-secondary:          var(--pvg-teal);
  --bs-secondary-rgb:      56, 161, 151;
  --bs-body-font-family:   var(--pvg-font);
  --bs-btn-font-family:    var(--pvg-font);
  --bs-body-color:         var(--pvg-ink);
  --bs-body-bg:            var(--pvg-page-bg);
  --bs-border-radius:      var(--pvg-radius-sm);
  --bs-border-radius-sm:   var(--pvg-radius-xs);
  --bs-border-radius-lg:   var(--pvg-radius-md);
  --bs-border-radius-xl:   var(--pvg-radius-lg);
  --bs-border-radius-pill: var(--pvg-radius-pill);
  --bs-border-color:       var(--pvg-border);
  --bs-link-color:         var(--pvg-green);
  --bs-link-hover-color:   var(--pvg-green-deep);
}

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

body {
  font-family: var(--pvg-font);
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--pvg-ink);
  background-color: var(--pvg-page-bg);
  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(--pvg-font);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--pvg-ink);
  line-height: 1.25;
}

h1, .h1 { font-size: clamp(1.75rem, 3vw, 2.25rem); font-weight: 800; }
h2, .h2 { font-size: clamp(1.35rem, 2.5vw, 1.75rem); font-weight: 700; }
h3, .h3 { font-size: clamp(1.1rem, 2vw, 1.35rem); font-weight: 700; }
h4, .h4 { font-size: 1.1rem; font-weight: 600; }
h5, .h5 { font-size: 0.975rem; font-weight: 600; }
h6, .h6 { font-size: 0.875rem; font-weight: 600; }

p { margin-bottom: 1rem; }

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

footer a { text-decoration: none; }

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

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

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

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

.text-danger { color: var(--pvg-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(--pvg-radius-xs) !important;
}

.badge-secondary { background-color: var(--pvg-teal);   color: #fff; }
.badge-danger    { background-color: var(--pvg-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(--pvg-ink-soft);
}

.form-control,
.form-select,
.input-group-text {
  min-height: 2.75rem;
  border: 1.5px solid var(--pvg-border);
  border-radius: var(--pvg-radius-sm) !important;
  background: var(--pvg-surface);
  color: var(--pvg-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(--pvg-muted-soft); }

.form-control:focus,
.form-select:focus {
  border-color: var(--pvg-green);
  box-shadow: 0 0 0 3px rgba(49, 112, 224, 0.25);
  outline: 2px solid var(--pvg-green);
  outline-offset: 1px;
}

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

.form-check-input {
  border: 1.5px solid var(--pvg-border-strong);
  border-radius: var(--pvg-radius-xs) !important;
}
.form-check-input:checked {
  background-color: var(--pvg-green);
  border-color: var(--pvg-green);
}
.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(--pvg-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(--pvg-radius-sm);
  box-shadow: var(--pvg-shadow-sm);
}
.hmrc-mtd-recognised-p {
  color: var(--pvg-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;
}

.pvg-logo {
    width: 150px;
}