/**
 * DWT guides — finder and country guide.
 * Ported from the design mocks. One file for both blocks.
 */

/* Palette scoped to the DWT blocks, so it neither depends on nor
   overwrites the theme's own :root tokens. Delete this block if the
   theme already defines these names globally. */
.dwt-guide-header,
.dwt-guide-body,
.dwt-pdf-capture,
.dwt-finder,
.header-dwt-guide {
  --navy: #031c2b;
  --royal: #1360a0;
  --mint: #b0f7cf;
  --coral: #e66d62;
  --pale-pink: #fbebec;
  --cool-grey: #e6e6dc;
  --pine: #1d7b7f;
  --ink: #0c2635;
  --muted: #5b7080;
  --line: #dce3e7;
  --radius: 14px;
}

.header-dwt-guide a {
  font-size: 13px;
  color: var(--muted);
  text-decoration: underline;
}
.header-dwt-guide a:hover { text-decoration: none; }
/* ===================================================================
   1. Finder — the two dropdowns
   =================================================================== */
.finder-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, transparent,#000 20%,#000 80%, transparent);
}
.finder-wrap {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  width: 100%;
  padding: 60px 32px;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}
.finder-copy .eyebrow {
  color: var(--coral);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 16px;
  display: block;
}
.finder-copy h1 {
  font-size: 44px;
  line-height: 1.12;
  font-weight: 700;
  color: #fff;
  margin: 0 0 18px;
  letter-spacing: -0.01em;
}
.finder-copy h1 em {
  color: var(--mint);
  font-style: normal;
  font-weight: 700;
}
.finder-copy p {
  font-size: 16px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.72);
  max-width: 440px;
  margin: 0 0 28px;
  font-weight: 300;
}
.finder-copy ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.finder-copy li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
  font-weight: 300;
}
.finder-copy li::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--coral);
  flex: none;
}
.finder-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  padding: 34px;
  backdrop-filter: blur(6px);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.5);
}
.finder-card h2 {
  color: #fff;
  font-size: 21px;
  margin: 0 0 6px;
  font-weight: 600;
}
.finder-card .sub {
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
  font-weight: 300;
  margin: 0 0 26px;
  line-height: 1.5;
}
.field {
  margin-bottom: 20px;
  position: relative;
}
.field label {
  display: block;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}
.field .hint {
  display: block;
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
  font-weight: 300;
  margin-top: 5px;
  line-height: 1.4;
}
.field input,
.field select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}
.field select {
  cursor: pointer;
}
.field select option {
  color: #0c2635;
}
.field input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}
.field input:focus,
.field select:focus {
  border-color: var(--coral);
  background: rgba(255, 255, 255, 0.12);
}
.field.locked input {
  opacity: 0.75;
  cursor: not-allowed;
}
.field .chev {
  position: absolute;
  right: 15px;
  top: 45px;
  color: rgba(255, 255, 255, 0.5);
  pointer-events: none;
  font-size: 12px;
}
.cta-primary {
  width: 100%;
  padding: 14px 18px;
  border-radius: 999px;
  border: none;
  background: var(--coral);
  color: #fff;
  font-family: inherit;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  margin-top: 6px;
  transition: transform 0.15s ease, background 0.15s ease;
}
.cta-primary:hover {
  background: #d95e52;
  transform: translateY(-1px);
}
@media (max-width: 860px) {
  .finder-wrap {
    grid-template-columns: 1fr;
    padding: 36px 20px;
  }
  .finder-copy h1 {
    font-size: 32px;
  }
  .guide-shell {
    padding: 24px 18px 100px;
  }
  .guide-header {
    flex-direction: column;
  }
  .step-body {
    padding-left: 0;
    margin-top: 10px;
  }
  .help-float {
    right: 16px;
    bottom: 16px;
    left: 16px;
    max-width: none;
  }
}

/* ---------- theme integration ---------- */
.dwt-finder {
  position: relative;
  overflow: hidden;
  background: radial-gradient(
      1100px 600px at 78% 15%,
      rgba(19, 96, 160, 0.55),
      transparent 60%
    ),
    linear-gradient(
      160deg,
      var(--navy, #031c2b) 0%,
      #0a2e42 55%,
      var(--navy, #031c2b) 100%
    );
}
.dwt-finder::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient( rgba(255, 255, 255, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, transparent,#000 20%,#000 80%, transparent);
}
/* The mock was a full-screen screen; as a page block it sizes to its content. */
.dwt-finder.finder-hero {
  padding: 10vw 0;
  min-height: 0;
}
.dwt-finder .finder-wrap {
  padding: 72px 32px;
}
.dwt-finder .field-error {
  color: #fff;
  background: rgba(230, 109, 98, 0.92);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13px;
  margin: 0 0 14px;
}
.dwt-finder select[aria-invalid="true"] {
  border-color: var(--coral, #e66d62);
}

@media (prefers-reduced-motion: reduce) {
  .dwt-finder * {
    transition: none !important;
  }
}

/* ===================================================================
   2. Guide page — header, steps, what's next
   =================================================================== */
.guide-breadcrumb {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 18px;
}
.guide-breadcrumb a {
  text-decoration: none;
  font-weight: 600;
}
.guide-breadcrumb a:hover {
  text-decoration: underline;
}
.guide-header {
  background: linear-gradient(135deg, var(--navy), #0a2e42);
  border-radius: 18px;
  padding: 30px 34px;
  color: #fff;
  margin-bottom: 28px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
}
.guide-header .tag {
  display: inline-block;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--mint);
  margin-bottom: 12px;
}
.guide-header h1 {
  margin: 0 0 8px;
  font-size: 26px;
  font-weight: 700;
}
.guide-header p {
  margin: 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 14px;
  font-weight: 300;
  max-width: 520px;
}

.step-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.step-num {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--pale-pink);
  color: var(--coral);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex: none;
}
.step-head h3 {
  margin: 0;
  font-size: 17.5px;
  font-weight: 600;
  color: var(--navy);
}
.step-body {
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.65;
}
.dwt-guide-body--filing .step-body { padding-left: 48px; }
.step-body p {
  margin: 0 0 10px;
}
.step-body ul {
  margin: 0 0 10px;
  padding-left: 20px;
  list-style: disc;
}
.step-body li {
  margin-bottom: 6px;
}
.note {
  background: var(--cool-grey);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13.5px;
  color: var(--ink);
  margin-top: 12px;
}
.note b {
  color: var(--navy);
}
.addr {
  background: var(--pale-pink);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 10px 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--navy);
  font-weight: 500;
}
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  background: var(--cool-grey);
  border-radius: 10px;
  padding: 14px 18px;
  margin-top: 14px;
}
.info-grid .label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}
.info-grid .value {
  display: block;
  font-size: 14.5px;
  color: var(--navy);
  font-weight: 600;
}
.detail-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--royal);
}
.detail-toggle.open .arrow {
  transform: rotate(180deg);
}
.detail-panel {
  display: none;
  margin-top: 12px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafbfb;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
}
.detail-panel.open {
  display: block;
}
.detail-panel ol {
  margin: 0 0 0 18px;
  padding: 0;
}
.detail-panel li {
  margin-bottom: 8px;
}
.detail-panel .addr-inline {
  background: var(--pale-pink);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 8px 0;
  font-weight: 500;
}
.whatsnext {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 8px;
}
.wn-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
}
.wn-card h4 {
  margin: 0 0 6px;
  font-size: 14px;
  color: var(--navy);
  font-weight: 600;
}
.wn-card p {
  margin: 0;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.55;
}
.section-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--royal);
  margin: 34px 0 14px;
}

@media (max-width: 860px) {
  .guide-shell {
    padding: 24px 18px 100px;
  }
  .guide-header {
    flex-direction: column;
  }
  .step-body {
    padding-left: 0;
    margin-top: 10px;
  }
  .whatsnext {
    grid-template-columns: 1fr;
  }
}

/* ---------- theme integration ---------- */
.dwt-guide-header .guide-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
}
.dwt-guide-header .cta-pdf {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  background: var(--coral);
  color: #fff;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 999px;
}
.dwt-guide-header .cta-pdf:hover {
  background: #d95e52;
}
button.cta-pdf {
  border: 0;
  cursor: pointer;
  font-family: inherit;
}
button.cta-pdf[disabled] {
  opacity: 0.6;
  cursor: default;
}

/* The header and the body are two blocks, so drop the container padding
   between them and let the body carry the bottom space. */
.dwt-guide-header.guide-shell {
  padding-bottom: 0;
}
.dwt-guide-body.guide-shell {
  padding-top: 0;
}
.guide-shell {
  max-width: 980px;
  margin: 0 auto;
  padding: 36px 32px 90px;
}

.dwt-guide-body .detail-panel:not(.open) {
  display: none;
}
.dwt-guide-body .detail-panel.open {
  display: block;
}
:where(.dwt-guide-body, .dwt-guide-header) :where(a, button):focus-visible {
  outline: 3px solid var(--mint);
  outline-offset: 2px;
}

/* Off-screen clone used by the client-side PDF capture. */
.dwt-pdf-capture {
  position: fixed;
  left: -10000px;
  top: 0;
  width: 800px;
  background: #fff;
  padding: 24px;
}

@media print {
  /* Adjust these to the theme's own header/footer if they differ. */
  .site-header,
  .site-footer,
  .main-header,
  .main-footer,
  header.header,
  footer.footer,
  .topbar,
  .cookie-banner,
  .guide-breadcrumb,
  .cta-pdf,
  .detail-toggle {
    display: none !important;
  }

  .main {
    padding: 0 !important;
  }
  .guide-shell {
    max-width: none;
    padding: 0;
  }
  .dwt-guide-header .guide-header,
  .dwt-guide-body .step.highlight {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .dwt-guide-body .detail-panel {
    display: block !important;
  }
  .dwt-guide-body .step {
    break-inside: avoid;
  }
  body {
    background: #fff;
  }
  @page {
    margin: 14mm;
  }
}

/* ===================================================================
   3. Numbered country steps (from the COTR design)
   Styles both <ol class="cor-steps"> and a plain <ol> typed in the editor.
   =================================================================== */
.cor-steps,
.cor-steps-wrap > ol {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  counter-reset: cor-step;
}
.cor-steps > li,
.cor-steps-wrap > ol > li {
  counter-increment: cor-step;
  position: relative;
  margin: 0;
  padding: 14px 0 14px 40px;
  border-bottom: 1px solid var(--line);
}
.cor-steps > li:last-child,
.cor-steps-wrap > ol > li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.cor-steps > li::before,
.cor-steps-wrap > ol > li::before {
  content: counter(cor-step);
  position: absolute;
  left: 0;
  top: 14px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--pale-pink);
  color: var(--coral);
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Always-visible steps are not a collapsible panel, so no grey box. */
.dwt-guide-body .cor-steps-wrap:not(.detail-panel) {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
}

/* Accept .guide-step as well as .step, in case the template was renamed. */
.guide-step {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 28px;
  margin-bottom: 18px;
}
.guide-step.highlight {
  border-color: var(--coral);
  box-shadow: 0 0 0 3px var(--pale-pink);
}
/* ===================================================================
   4. Collapsible steps — native <details>, no JavaScript
   =================================================================== */
.dwt-guide-body details.detail{margin-top:6px;}
.dwt-guide-body details.detail > summary{
  list-style:none;cursor:pointer;display:inline-flex;align-items:center;gap:8px;
  color:var(--royal);font-size:13.5px;font-weight:600;
}
.dwt-guide-body details.detail > summary::-webkit-details-marker { display: none; }
.dwt-guide-body details.detail > summary:hover .detail-toggle-label { text-decoration: underline; }
.dwt-guide-body details.detail > summary .arrow { transition: transform .18s ease; font-size: 11px; }
.dwt-guide-body details.detail[open] > summary .arrow { transform: rotate(180deg); }
.dwt-guide-body details.detail .label-open { display: none; }
.dwt-guide-body details.detail[open] .label-closed { display: none; }
.dwt-guide-body details.detail[open] .label-open { display: inline; }
/* The panel's base rule is display:none for the old JS markup — override it here. */
.dwt-guide-body details.detail > .detail-panel{ display: block; margin-top: 12px; }

/* Class aliases, in case the template was renamed locally. */
.guide-step-head{display:flex;align-items:center;gap:14px;margin-bottom:14px;}
.guide-step-body{padding-left:48px;color:var(--ink);font-size:14.5px;line-height:1.65;}
.guide-step-body p{margin:0 0 10px;}
.guide-step-num {
  width:34px;height:34px;border-radius:50%;background:var(--pale-pink);color:var(--coral);
  display:flex;align-items:center;justify-content:center;font-weight:700;font-size:14px;flex:none;
}

@media (max-width:640px){
  .step-body, .guide-step-body { padding-left:0; }
}
/* Boxes made with the editor buttons wrap a <p>; keep the spacing tight. */
.addr > p:first-child,
.note > p:first-child { margin-top: 0; }
.addr > p:last-child, 
.note > p:last-child { margin-bottom:0; }


/* ===================================================================
   5. Searchable dropdowns in the finder — the theme's custom-select.js
   Same look as the closed field: dark, translucent, white text.
   Scoped to .dwt-finder so the theme's other dropdowns are untouched.
   =================================================================== */
.dwt-finder .field{position:relative;}
.dwt-finder .dropdown{position:relative;width:100%;}
 
/* Closed field */
.dwt-finder .dropdown .dropdown-select{
  background:rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.18);
  border-radius:10px;
  color:#fff;
  font-size:14.5px;
  min-height:46px;
  padding:12px 40px 12px 14px;
  cursor:pointer;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.dwt-finder .dropdown .dropdown-select:focus-visible{
  outline:none;border-color:var(--mint);box-shadow:0 0 0 3px rgba(176,247,207,.22);
}
.dwt-finder .dropdown.is-invalid .dropdown-select{border-color:var(--coral);}
.dwt-finder .field .chev{pointer-events:none;z-index:3;}
 
/* Open list — matches the field. Solid rather than translucent, so the page
   underneath does not show through the list. */
.dwt-finder .dropdown .dropdown-menu{
  display:none; /* custom-select.js shows it inline when opened */
  position:absolute;left:0;right:0;top:calc(100% + 6px);z-index:30;
  background:#1F3C4D;
  border:1px solid rgba(255,255,255,.18);
  border-radius:10px;
  box-shadow:0 14px 34px rgba(0,0,0,.35);
  color:#fff;
  overflow:hidden;
}
 
/* Search box inside the list */
.dwt-finder .dropdown .dropdown-menu-search,
.dwt-finder .dropdown .dropdown-menu-search:focus{
  display:block;width:100%;box-sizing:border-box;margin:0;
  background:rgba(255,255,255,.06);
  border:0;border-bottom:1px solid rgba(255,255,255,.14);
  border-radius:0;box-shadow:none;outline:none;
  padding:12px 14px;
  font:inherit;font-size:14px;color:#fff;
}
.dwt-finder .dropdown .dropdown-menu-search::placeholder{color:rgba(255,255,255,.55);}
 
/* Items */
.dwt-finder .dropdown .dropdown-menu-inner{max-height:260px;overflow-y:auto;}
.dwt-finder .dropdown .dropdown-menu-item{
  padding:10px 14px;font-size:14px;color:#fff;background:none;cursor:pointer;
}
.dwt-finder .dropdown .dropdown-menu-item:hover{background:rgba(255,255,255,.08);}
.dwt-finder .dropdown .dropdown-menu-item.is-select{background:rgba(176,247,207,.12);color:var(--mint);font-weight:600;}
/* The component marks its first item "selected"; not wanted here. */
.dwt-finder .dropdown .dropdown-menu-item.selected:not(.is-select){background:none;}
 
/* In both dropdowns the first item is the empty placeholder option — it shows
   as the text in the closed field, not as a choice. !important because the
   component's search re-shows matching items with an inline style. */
.dwt-finder .field--has-placeholder .dropdown-menu-inner > .dropdown-menu-item:first-child{display:none !important;}
 
/* Per-field error, under the hint. */
.dwt-finder .field .field-error{margin:8px 0 0;}
 
/* One residency list per dividend country; only the active one is shown.
   Unpositioned on purpose — the chevron is placed against the whole field. */
.dwt-finder .dwt-country-list[hidden]{display:none !important;}
 
/* Scrollbar in the dark list */
.dwt-finder .dropdown .dropdown-menu-inner::-webkit-scrollbar{width:8px;}
.dwt-finder .dropdown .dropdown-menu-inner::-webkit-scrollbar-thumb{background:rgba(255,255,255,.18);border-radius:4px;}
 
/* Locked first dropdown: read-only look, from the design. */
.dwt-finder .field.locked input[disabled]{opacity:.75;cursor:not-allowed;}
 
/* Residency field locked until a dividend country is chosen. */
.dwt-finder .field.is-disabled .dropdown,
.dwt-finder .field.is-disabled select{opacity:.5;pointer-events:none;cursor:not-allowed;}
.dwt-finder .field.is-disabled .chev{opacity:.5;}