/* IGoAbroad guided help: welcome card, spotlight tour, "?" tips, help button + menu.
   Uses the brand tokens from site.css (--navy, --blue, --gold, --wash, --rule). */

:root {
  --gd-shadow: 0 24px 60px rgba(8, 23, 72, .38), 0 3px 10px rgba(8, 23, 72, .16);
  --gd-ease: cubic-bezier(.2, .8, .25, 1);
}

/* ---------- "?" tip button ---------- */
.tip-btn { display: none; }
.js .tip-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 24px; height: 24px; padding: 0; margin: 0; border-radius: 50%; cursor: pointer;
  border: 1.5px solid var(--blue); background: #fff; color: var(--blue);
  vertical-align: middle; -webkit-tap-highlight-color: transparent;
  transition: background-color .15s, color .15s, transform .15s;
}
.js .tip-btn:hover, .js .tip-btn[aria-expanded="true"] { background: var(--blue); color: #fff; transform: scale(1.08); }
.js .tip-btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.tip-btn.is-new::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  border: 2px solid var(--blue); opacity: 0; pointer-events: none;
  animation: gd-ping 2.2s ease-out infinite;
}
@keyframes gd-ping { 0% { transform: scale(.7); opacity: .8; } 100% { transform: scale(1.5); opacity: 0; } }

/* Label + tip button sitting side by side */
.lbl-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.lbl-row label { margin: 0 !important; }
.lbl-row--legend { margin-bottom: 18px; }
.lbl-row--legend legend { margin: 0; float: none; }
.head-tip { display: inline-flex; align-items: center; gap: 8px; }

/* ---------- Popover bubble (tips + tour) ---------- */
.gd-pop {
  position: fixed; z-index: 150; left: 0; top: 0; width: 340px; max-width: calc(100vw - 24px);
  background: #fff; color: var(--ink); border-radius: 18px; padding: 18px 18px 16px;
  box-shadow: var(--gd-shadow); border-top: 4px solid var(--gold);
  opacity: 0; transform: translateY(8px) scale(.97);
  transition: opacity .22s var(--gd-ease), transform .22s var(--gd-ease);
}
.gd-pop.is-in { opacity: 1; transform: none; }
.gd-pop--tour { z-index: 202; }
.gd-pop::before {
  content: ""; position: absolute; left: var(--arrow, 50%); width: 0; height: 0;
  margin-left: -9px; border: 9px solid transparent;
}
.gd-pop[data-side="below"]::before { top: -13px; border-top-width: 0; border-bottom-color: var(--gold); }
.gd-pop[data-side="above"]::before { bottom: -9px; border-bottom-width: 0; border-top-color: #fff; }
.gd-pop-title { margin: 0 0 6px; padding-right: 22px; font: 700 1.05rem/1.25 var(--font-head); color: var(--navy); max-width: none; }
.gd-pop-text { margin: 0; font-size: .94rem; line-height: 1.55; color: var(--muted); max-width: none; }
.gd-pop--tour .gd-pop-text { color: #33405c; }
.gd-pop-x {
  position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border: 0; border-radius: 50%;
  background: transparent; color: var(--muted); font-size: 1.4rem; line-height: 1; cursor: pointer;
}
.gd-pop-x:hover { background: var(--wash); color: var(--navy); }
.gd-pop-x:focus-visible, .gd-btn:focus-visible, .gd-link:focus-visible,
.gd-menu button:focus-visible, .gd-menu a:focus-visible, .gd-x:focus-visible, .gd-langs a:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.gd-step { margin: 0 0 4px; font: 600 .72rem/1 var(--font-head); letter-spacing: .08em; text-transform: uppercase; color: var(--blue); max-width: none; }
.gd-dots { display: flex; gap: 5px; margin-bottom: 12px; }
.gd-dots span { flex: 1; height: 4px; border-radius: 4px; background: var(--rule); transition: background-color .25s; }
.gd-dots span.is-done { background: #9db8f3; }
.gd-dots span.is-on { background: var(--blue); }
.gd-extra:empty { display: none; }
.gd-extra { margin-top: 12px; }
.gd-pop-actions { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
.gd-grow { flex: 1; }

.gd-btn {
  min-height: 42px; padding: 0 20px; border: 2px solid var(--navy); border-radius: 999px; cursor: pointer;
  background: var(--navy); color: #fff; font: 600 .9rem var(--font-head);
  transition: background-color .15s, color .15s, transform .15s;
}
.gd-btn:hover { background: var(--blue); border-color: var(--blue); transform: translateY(-1px); }
.gd-btn--ghost { background: #fff; color: var(--navy); }
.gd-btn--ghost:hover { background: var(--wash); color: var(--navy); border-color: var(--navy); }
.gd-link {
  background: none; border: 0; padding: 10px 6px; cursor: pointer; color: var(--muted);
  font: 500 .875rem var(--font-body); text-decoration: underline; text-underline-offset: 3px;
}
.gd-link:hover { color: var(--navy); }

/* ---------- Spotlight ---------- */
.gd-shade { position: fixed; inset: 0; z-index: 200; background: transparent; }
.gd-spot {
  position: fixed; z-index: 201; left: 0; top: 0; width: 0; height: 0; border-radius: 14px; pointer-events: none;
  box-shadow: 0 0 0 3px var(--gold), 0 0 0 9999px rgba(8, 23, 72, .74);
  opacity: 0; transition: left .38s var(--gd-ease), top .38s var(--gd-ease), width .38s var(--gd-ease), height .38s var(--gd-ease), opacity .25s;
}
.gd-spot.is-in { opacity: 1; }

/* ---------- Welcome card ---------- */
.gd-welcome {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 16px;
  background: rgba(8, 23, 72, .62); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px);
  opacity: 0; transition: opacity .25s;
}
.gd-welcome[hidden] { display: none; }
.gd-welcome.is-in { opacity: 1; }
.gd-card {
  position: relative; width: min(440px, 100%); text-align: center; background: #fff; border-radius: 24px;
  padding: 34px 26px 22px; box-shadow: var(--gd-shadow); overflow: hidden;
  transform: translateY(18px) scale(.97); transition: transform .35s var(--gd-ease);
}
.gd-welcome.is-in .gd-card { transform: none; }
.gd-card::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 120px; z-index: 0;
  background: radial-gradient(120% 100% at 50% 0%, #e8f0ff 0%, rgba(232, 240, 255, 0) 70%);
}
.gd-card > * { position: relative; z-index: 1; }
.gd-x {
  position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; border: 0; border-radius: 50%;
  background: transparent; color: var(--muted); font-size: 1.6rem; line-height: 1; cursor: pointer;
}
.gd-x:hover { background: var(--wash); color: var(--navy); }
.gd-badge {
  display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 20px;
  background: linear-gradient(145deg, #2f7df5 0%, var(--blue) 40%, var(--navy) 100%); color: var(--gold);
  box-shadow: 0 10px 24px rgba(31, 111, 235, .38); transform: rotate(-6deg);
}
.gd-card h2 { margin: 0 0 8px; font-size: 1.55rem; }
.gd-card > p { margin: 0 auto 18px; max-width: 34ch; color: var(--muted); font-size: .98rem; }
.gd-card > p.gd-label { margin: 0 0 8px; font: 600 .72rem/1 var(--font-head); letter-spacing: .08em; text-transform: uppercase; color: var(--navy); max-width: none; }

.gd-langs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 20px; }
.gd-langs a {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 12px;
  border: 2px solid var(--rule); border-radius: 14px; background: #fff; color: var(--navy);
  font: 600 .95rem var(--font-head); text-decoration: none; transition: border-color .15s, background-color .15s, transform .15s;
}
.gd-langs a:hover { border-color: var(--blue); background: var(--wash); transform: translateY(-1px); color: var(--navy); }
.gd-langs a[aria-current="true"] { border-color: var(--gold); background: #fff9e0; }
.gd-langs a[aria-current="true"]::after { content: "\2713"; color: var(--ok); font-weight: 700; }
.gd-langs--sm { margin: 0; }
.gd-langs--sm a { min-height: 40px; border-radius: 999px; font-size: .85rem; }

.gd-actions { display: grid; gap: 4px; justify-items: center; }
.gd-actions .btn { width: 100%; border-radius: 999px; box-shadow: 0 8px 20px rgba(242, 183, 5, .35); }

@media (max-width: 600px) {
  .gd-welcome { align-items: end; padding: 0; }
  .gd-card { width: 100%; border-radius: 24px 24px 0 0; padding: 30px 20px calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateY(40px); }
  .gd-pop { width: calc(100vw - 24px); }
}

/* ---------- Help button + menu ---------- */
.igo-help {
  width: 46px; height: 46px; background: #fff; color: var(--navy);
  box-shadow: 0 6px 18px rgba(8, 23, 72, .28), 0 0 0 2px var(--navy);
}
.igo-help:focus-visible { box-shadow: 0 0 0 3px var(--gold), 0 0 0 6px var(--navy); }
.igo-help[aria-expanded="true"] { background: var(--navy); color: var(--gold); }
body.igo-chat-open .igo-help { display: none; }

.gd-menu {
  position: fixed; z-index: 160; right: 18px; bottom: 120px; width: min(280px, calc(100vw - 24px));
  background: #fff; border-radius: 18px; padding: 8px; box-shadow: var(--gd-shadow); border-top: 4px solid var(--gold);
  opacity: 0; transform: translateY(8px) scale(.97); transform-origin: bottom right;
  transition: opacity .2s var(--gd-ease), transform .2s var(--gd-ease);
}
.gd-menu[hidden] { display: none; }
.gd-menu.is-in { opacity: 1; transform: none; }
.gd-menu-title { margin: 6px 10px 4px; font: 700 .72rem/1 var(--font-head); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); max-width: none; }
.gd-menu button, .gd-menu a {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 0 12px;
  border: 0; border-radius: 12px; background: transparent; cursor: pointer; text-align: left;
  font: 600 .93rem var(--font-body); color: var(--navy); text-decoration: none;
}
.gd-menu button[hidden] { display: none; }
.gd-menu button:hover, .gd-menu a:hover { background: var(--wash); color: var(--blue); }
.gd-menu span[aria-hidden] { width: 28px; height: 28px; border-radius: 9px; background: var(--wash); display: grid; place-items: center; font-size: .85rem; flex: none; }

@media print { .gd-welcome, .gd-menu, .gd-pop, .gd-spot, .gd-shade, .igo-help, .tip-btn { display: none !important; } }

/* Page title + tip */
.head-tip--h1 { display: flex; align-items: flex-start; gap: 12px; }
.head-tip--h1 h1 { margin-bottom: 12px; }
.js .head-tip--h1 .tip-btn { width: 30px; height: 30px; margin-top: .7em; }
@media (max-width: 600px) { .js .head-tip--h1 .tip-btn { margin-top: .55em; } }
