/* ============================================
   NomadBridge: Components
   Nav, buttons, cards, badges, footer, forms
   ============================================ */

/* ================================================
   NAVIGATION
   ================================================ */

.nav {
  position: fixed;
  top: var(--shell-top);
  left: 50%;
  transform: translateX(-50%);
  width: var(--shell-width);
  min-height: var(--nav-pill-height);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 6px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--sand-deep);
  border-radius: var(--shell-radius);
  z-index: var(--z-nav);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--duration-normal) var(--ease-out), background-color var(--duration-normal) var(--ease-out);
}

/* Glass once the page scrolls (js/main.js adds .nav--scrolled after 50px) */
.nav--scrolled {
  background: var(--glass-bg-scrolled);
  backdrop-filter: var(--glass-blur-scrolled);
  -webkit-backdrop-filter: var(--glass-blur-scrolled);
  box-shadow: var(--shadow-md);
}

.nav--scrolled .nav__logo-name .logo-word-2 {
  color: var(--terracotta-dark);
}

/* People who ask for less transparency keep the solid bar */
@media (prefers-reduced-transparency: reduce) {
  .nav--scrolled {
    background: var(--glass-bg);
  }
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0;
}

/* Logo */
.nav__logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  padding-left: 16px;
}

/* 20px/600 is large text, so terracotta "Bridge" needs 3:1 (3.2 or more) */
.nav__logo-name {
  font-family: var(--font-body);
  font-size: var(--text-logo);
  font-weight: var(--weight-semibold);
  line-height: 1;
  letter-spacing: var(--tracking-tight);
}

.nav__logo-name .logo-word-1 {
  color: var(--ink);
}

.nav__logo-name .logo-word-2 {
  color: var(--terracotta);
}

.nav__logo-tagline {
  display: none;
}

/* Nav Links */
.nav__links {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  margin-right: 8px;
}

.nav__link {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: var(--weight-medium);
  color: var(--forest);
  letter-spacing: var(--tracking-normal);
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  transition: background-color var(--duration-normal) var(--ease-out), color var(--duration-normal) var(--ease-out);
}

.nav__link:hover,
.nav__link--active {
  background-color: var(--sand);
  color: var(--forest);
}

/* Nav CTA */
.nav__cta {
  flex-shrink: 0;
}

.nav__cta .btn {
  padding: 8px 18px;
  font-size: 12px;
  font-weight: var(--weight-medium);
  line-height: 1;
  letter-spacing: var(--tracking-normal);
  text-transform: uppercase;
  border-width: 0;
}

/* Hamburger */
.nav__hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 28px;
  height: 28px;
  cursor: pointer;
}

.nav__hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--forest);
  transition: transform var(--duration-normal) var(--ease-out),
              opacity var(--duration-fast);
}

.nav__hamburger--open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav__hamburger--open span:nth-child(2) {
  opacity: 0;
}

.nav__hamburger--open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile menu panel: full screen overlay */
.nav__mobile-panel {
  display: none;
  position: fixed;
  inset: 0;
  background-color: var(--white);
  padding: 100px var(--space-7) var(--space-7);
  z-index: calc(var(--z-nav) - 1);
  flex-direction: column;
  gap: 0;
  overflow-y: auto;
}

.nav__mobile-panel--open {
  display: flex;
}

.nav__mobile-link {
  font-family: var(--font-body);
  font-size: var(--text-xl);
  font-weight: var(--weight-medium);
  color: var(--ink);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--sand-deep);
  text-decoration: none;
}

.nav__mobile-link:first-child {
  border-top: 1px solid var(--sand-deep);
}

.nav__mobile-link:hover {
  color: var(--terracotta-dark);
}

.nav__mobile-panel .btn {
  margin-top: var(--space-6);
  text-align: center;
}

/* ================================================
   BUTTONS
   ================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 550;
  letter-spacing: var(--tracking-normal);
  padding: 10px 24px;
  border-radius: var(--radius-full);
  transition: all var(--duration-normal) var(--ease-out);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  border: 2px solid transparent;
}

.btn--primary {
  background-color: var(--forest);
  color: var(--white);
  border-color: var(--forest);
}

/* Hover keeps white text at 5.12 (base terracotta would be 3.52) */
.btn--primary:hover {
  background-color: var(--terracotta-dark);
  border-color: var(--terracotta-dark);
  color: var(--white);
}

/* Black button (Book a Call form). Hover lifts to forest green. */
.btn--dark {
  background-color: var(--ink);
  color: var(--white);
  border-color: var(--ink);
}

.btn--dark:hover {
  background-color: var(--forest);
  border-color: var(--forest);
  color: var(--white);
}

.btn--outline {
  background-color: transparent;
  color: var(--forest);
  border-color: var(--forest);
}

.btn--outline:hover {
  background-color: var(--forest);
  border-color: var(--forest);
  color: var(--white);
}

.btn--outline-white {
  background-color: transparent;
  color: var(--pure-white);
  border-color: var(--white-20);
}

/* Every button hover sets its own text colour: otherwise the global
   a:hover (terracotta) wins and can vanish into the fill */
.btn--outline-white:hover {
  background-color: var(--white-20);
  border-color: var(--white-80);
  color: var(--pure-white);
}

/* Terracotta fill under white text: the dark step passes (5.12), the base does not (3.52) */
.btn--terracotta {
  background-color: var(--terracotta-dark);
  color: var(--white);
  border-color: var(--terracotta-dark);
}

.btn--terracotta:hover {
  background-color: var(--terracotta-deep);
  border-color: var(--terracotta-deep);
  color: var(--white);
}

.btn--sm {
  padding: 10px 24px;
  font-size: 14px;
}

.btn--lg {
  padding: 10px 24px;
  font-size: 14px;
}

.btn--white {
  background-color: var(--white);
  color: var(--forest);
  border-color: var(--white);
}

.btn--white:hover {
  background-color: var(--sand);
  border-color: var(--sand);
  color: var(--forest);
}

/* Keep the pill shape when focused (a:focus-visible sets a small radius) */
.btn:focus-visible {
  outline: 2px solid var(--terracotta);
  outline-offset: 3px;
  border-radius: var(--radius-full);
}

/* On dark heroes and green bands terracotta is only about 2.5:1, below the
   3:1 a focus ring needs, so focus rings there are white */
.section--forest :focus-visible,
.footer :focus-visible,
.page-hero--bg:not(.page-hero--cream) :focus-visible {
  outline-color: var(--pure-white);
}

/* Sending: same size, no spinner */
.btn--loading {
  cursor: progress;
  opacity: 0.7;
}

.btn--primary.btn--loading:hover {
  background-color: var(--forest);
  border-color: var(--forest);
}

.btn--dark.btn--loading:hover {
  background-color: var(--ink);
  border-color: var(--ink);
}

.btn-group {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}

/* ================================================
   CARDS
   ================================================ */

.card {
  background-color: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  border-top: 3px solid var(--terracotta);
}

.card__stat {
  font-size: var(--text-3xl);
  font-weight: var(--weight-semibold);
  color: var(--terracotta);
  line-height: 1;
  margin-bottom: var(--space-3);
}

.card__title {
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  color: var(--ink);
  margin-bottom: var(--space-3);
}

.card__body {
  font-size: var(--text-sm);
  color: var(--muted);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-4);
}

.card__source {
  font-size: var(--text-xs);
  color: var(--muted);
  font-style: italic;
  margin-bottom: var(--space-4);
}

.card__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--forest);
  background-color: var(--sand);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  letter-spacing: var(--tracking-wide);
}

/* ================================================
   TESTIMONIAL CARDS
   ================================================ */

.testimonial-card {
  background-color: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--space-6) var(--space-7);
  min-width: 360px;
  max-width: 420px;
  flex-shrink: 0;
  border: 1px solid var(--sand-deep);
  position: relative;
}

.testimonial-card__quote {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-regular);
  color: var(--forest);
  line-height: var(--leading-snug);
  margin-bottom: var(--space-5);
  font-style: italic;
}

.testimonial-card__quote::before {
  content: '\201C';
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  color: var(--terracotta);
  line-height: 0;
  position: relative;
  top: 12px;
  margin-right: 4px;
}

.testimonial-card__author {
  font-weight: var(--weight-medium);
  font-size: var(--text-sm);
  color: var(--ink);
}

.testimonial-card__role {
  font-size: var(--text-xs);
  color: var(--muted);
  margin-top: 2px;
}

/* Inline testimonial (within service sections) */
.testimonial-inline {
  margin: var(--space-6) 0 0;
  padding-top: var(--space-6);
  border-top: 1px solid var(--sand-deep);
  max-width: 60ch;
}

.testimonial-inline + .testimonial-inline {
  margin-top: var(--space-7);
}

/* Roman Fraunces reads better than italic at paragraph length; the
   opening quote mark hangs into the margin so the text edge stays clean */
.testimonial-inline__quote {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-display-4);
  font-weight: var(--weight-regular);
  line-height: 1.3;
  letter-spacing: -0.005em;
  color: var(--ink);
  text-wrap: pretty;
}

/* 1.3 halves the gap between lines left by the paragraph default (1.65) */
.testimonial-inline__quote p {
  line-height: 1.3;
  text-indent: -0.42em;
}

.testimonial-inline__cite {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: var(--space-4);
}

.testimonial-inline__author {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--ink);
}

.testimonial-inline__role {
  font-size: var(--text-xs);
  color: var(--muted-strong);   /* passes on white and on sand */
}

/* ================================================
   FEATURE LIST
   ================================================ */

.feature-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.feature-item {
  display: flex;
  gap: var(--space-4);
}

.feature-item__icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--sand);
  border-radius: var(--radius-md);
  color: var(--terracotta);
}

.feature-item__icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1.75;
  fill: none;
}

.feature-item__content h4 {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--forest);
  margin-bottom: var(--space-1);
}

.feature-item__content p {
  font-size: var(--text-sm);
  color: var(--muted);
  line-height: var(--leading-relaxed);
}

/* ================================================
   DIRECT BOOKING (Calendly overlay link)
   ================================================ */

/* "Book a call" heading and the Pick a time button on one line */
.booking-direct {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-6);
  margin-bottom: var(--space-7);
}

.booking-direct .panel-title {
  margin-bottom: 0;
}

.booking-direct .panel-title::after {
  display: none;
}

.booking-direct__link {
  line-height: 1.2;
}

.booking-direct__link svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  flex-shrink: 0;
}

.booking-direct__link--loading {
  cursor: progress;
  opacity: 0.7;
}

/* Booking dialog: Calendly in a frame inside a native <dialog> */
.has-open-dialog {
  overflow: hidden;
}

.booking-dialog {
  width: min(1000px, calc(100vw - 2 * var(--space-4)));
  height: min(760px, calc(100dvh - 2 * var(--space-4)));
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  border: none;
  border-radius: var(--radius-card);
  background: var(--white);
  color: var(--ink);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}

.booking-dialog[open] {
  display: flex;
  flex-direction: column;
}

.booking-dialog::backdrop {
  background: var(--ink-50);
}

.booking-dialog__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-5);
  border-bottom: 1px solid var(--ink-10);
}

.booking-dialog__title {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--forest);
}

.booking-dialog__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--forest);
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-out);
}

@media (hover: hover) {
  .booking-dialog__close:hover {
    background: var(--forest-15);
  }
}

.booking-dialog__close:focus-visible {
  outline: 2px solid var(--terracotta);
  outline-offset: 2px;
}

.booking-dialog__close svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.booking-dialog__body {
  position: relative;
  flex: 1;
  min-height: 0;
}

.booking-dialog__loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
  text-align: center;
  font-size: var(--text-sm);
  color: var(--muted);
}

.booking-dialog--loaded .booking-dialog__loading {
  display: none;
}

/* No load event after 10 seconds: the message sits above the empty frame */
.booking-dialog--failed .booking-dialog__loading {
  z-index: 1;
  background: var(--white);
}

.booking-dialog__fallback {
  max-width: 36ch;
  color: var(--ink);
}

.booking-dialog__fallback a {
  display: inline-block;
  margin-top: var(--space-2);
  padding: var(--space-2) 0;
  color: var(--forest);
  font-weight: var(--weight-medium);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.booking-dialog__frame {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ================================================
   TRUST SIGNALS
   ================================================ */

.trust-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.trust-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--muted);
}

.trust-item svg {
  width: 18px;
  height: 18px;
  stroke: var(--forest);
  stroke-width: 2;
  fill: none;
  flex-shrink: 0;
}

/* ================================================
   FORM
   ================================================ */

/* Underlined fields: label above, one line below. The line is an inset
   box-shadow, so focus (2px) and error states never shift the layout. */

.cta-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.form-label {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  line-height: var(--leading-snug);
  color: var(--forest);
}

.form-label__optional {
  font-weight: var(--weight-regular);
  color: var(--muted);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: var(--space-2) 0;
  font-family: var(--font-body);
  font-size: max(1rem, var(--text-base)); /* 16px floor: no zoom on phones */
  line-height: var(--leading-normal);
  color: var(--ink);
  background-color: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: inset 0 -1px 0 var(--muted);
  transition: box-shadow var(--duration-fast) var(--ease-out);
}

@media (hover: hover) {
  .form-input:hover,
  .form-select:hover,
  .form-textarea:hover {
    box-shadow: inset 0 -1px 0 var(--forest);
  }
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus,
.form-input:focus-visible,
.form-select:focus-visible,
.form-textarea:focus-visible {
  outline: none;
  box-shadow: inset 0 -2px 0 var(--forest);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}

.form-textarea {
  display: block;
  resize: vertical;
  min-height: 7.5rem;
  min-height: calc(3lh + var(--space-4));
}

/* Select: native control, chevron drawn with borders in currentColor */
.form-select-wrap {
  position: relative;
  display: block;
  color: var(--forest);
}

.form-select-wrap::after {
  content: '';
  position: absolute;
  right: var(--space-1);
  top: 50%;
  width: 0.45em;
  height: 0.45em;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-75%) rotate(45deg);
  pointer-events: none;
}

.form-select {
  appearance: none;
  padding-right: var(--space-6);
  cursor: pointer;
}

.form-select:required:invalid {
  color: var(--muted);
}

.form-select option {
  color: var(--ink);
}

/* Honeypot: off-screen, not display:none, so bots still fill it */
.form-honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.cta-form__actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-2);
}

/* Standard slim button, like the hero buttons on the site */
.cta-form__submit {
  align-self: flex-start;
  line-height: 1.2;
}

/* Form-level message from js/form.js (send failed, rate limited) */
.form-status {
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--terracotta-dark);
}

/* Lock icon on the first line, then one text block: the sentence and
   the policy link wrap together instead of splitting into columns */
.form-privacy {
  font-size: var(--text-xs);
  line-height: var(--leading-normal);
  color: var(--muted);
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  text-wrap: pretty;
}

.form-privacy svg {
  width: 14px;
  height: 14px;
  margin-top: 0.2em;
  stroke: var(--forest);
  stroke-width: 2;
  fill: none;
  flex-shrink: 0;
}

.form-privacy a {
  color: var(--forest);
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}

.form-privacy a:hover {
  color: var(--terracotta-dark);
}

.form-error {
  font-size: var(--text-sm);
  line-height: var(--leading-snug);
  color: var(--terracotta-dark);
  margin-top: var(--space-1);
  display: none;
}

.form-group--error .form-input,
.form-group--error .form-select,
.form-group--error .form-textarea {
  box-shadow: inset 0 -2px 0 var(--terracotta);
}

.form-group--error .form-error {
  display: block;
}

/* Success state */
.form-success {
  display: none;
  text-align: center;
  padding: var(--space-8) var(--space-6);
}

.form-success--visible {
  display: block;
}

.form-success__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-5);
  color: var(--forest);
}

.form-success__icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
}

.form-success h3 {
  margin-bottom: var(--space-3);
}

/* ================================================
   FOOTER
   ================================================ */

/* Deep forest footer, kept lean: brand and tagline on the left, two
   link groups on the right, a slim bottom bar. No CTA here: every page
   already closes with a "Book a discovery call" section above it. One
   step darker than --forest so it parts from those green bands. */
.footer {
  background-color: var(--forest-deep);
  color: var(--white);
  padding: var(--space-9) 0 0;
}

.footer__inner {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: var(--space-8) var(--space-9);
  padding-bottom: var(--space-8);
}

.footer__brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.footer__brand-name {
  font-family: var(--font-display);
  font-size: var(--text-display-4);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
  color: var(--white);
  text-decoration: none;
}

.footer__brand-name:hover {
  color: var(--white);
}

.footer__brand-tagline {
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  color: var(--gold-pale);
}

.footer__nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-7);
}

.footer__col-title {
  margin: 0 0 var(--space-4);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--gold-pale);
}

.footer__col-title::after {
  display: none;
}

.footer__link {
  display: inline-block;
  padding: var(--space-2) 0;
  font-size: var(--text-base);
  color: var(--white-80);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

/* Own hover colour: the global a:hover terracotta would be 2.6:1 here */
.footer__link:hover {
  color: var(--white);
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

.footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5) 0;
  border-top: 1px solid var(--white-20);
}

.footer__copyright {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--white-80);
}

/* The 44px tap targets pad each 18px icon; pull the row out by that
   padding so the icons line up with the text edges */
.footer__social {
  display: flex;
  gap: var(--space-2);
  margin-inline: -13px;
}

.footer__social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  color: var(--white-80);
  transition: color var(--duration-fast) var(--ease-out), background-color var(--duration-fast) var(--ease-out);
}

.footer__social-link svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.footer__social-link:hover {
  color: var(--white);
  background-color: var(--white-20);
}

