/* ═══════════════════════════════════════════════════════════════════
   SW Finance — components.css
   Reusable UI components: nav, buttons, cards, form, badges
   ═══════════════════════════════════════════════════════════════════ */

/* ── Navigation ─────────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0;
  inset-inline: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: transparent;
  transition: background var(--t-base) var(--ease-out),
              box-shadow var(--t-base) var(--ease-out);
}

.nav.is-scrolled {
  background: var(--c-nav-bg);
  box-shadow: 0 2px 24px rgba(0,0,0,0.18);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: var(--sp-8);
}

.nav__logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.nav__logo-img {
  height: 48px;
  width: auto;
  display: block;
  /* logo is white/light on dark nav — if PNG has transparent bg it works directly */
  /* if on a light bg when scrolled, a filter can be toggled via JS if needed */
}


.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(var(--sp-4), 2.5vw, var(--sp-8));
  list-style: none;
  flex-shrink: 1;
  min-width: 0;
}

.nav__links a {
  font-size: var(--text-nav-link);
  font-weight: var(--weight-label);
  color: rgba(255,255,255,0.82);
  text-decoration: none;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  transition: color var(--t-fast);
  white-space: nowrap;
}

.nav__links a:hover,
.nav__links a:focus-visible { color: var(--c-white); }

.nav__cta {
  flex-shrink: 0;
}

/* Burger */
.nav__burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;                /* classic tight spacing between bars */
  width: 44px;
  height: 44px;            /* full 44px tap target */
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

/* ── Responsive nav ─────────────────────────────────────────────── */
@media (max-width: 960px) {
  .nav__links { display: none; }
  .nav__cta   { display: none; }
  .nav__burger { display: flex; }
}

/* Landscape phones: restore full desktop nav */
@media (min-width: 600px) and (max-width: 960px) and (orientation: landscape) {
  .nav__links { display: flex; }
  .nav__cta   { display: flex; }
  .nav__burger { display: none; }
}

.nav__burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--c-white);
  border-radius: 2px;
  transition: transform var(--t-base) var(--ease-out),
              opacity var(--t-fast);
}

/* X animation: bars are 5px apart → offset = 5px + 2px/2 = 7px */
.nav__burger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav__burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__burger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Drawer */
.nav__drawer {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99;
  background: var(--c-nav-bg);
  padding: calc(var(--nav-h) + var(--sp-10)) var(--sp-8) var(--sp-10);
  flex-direction: column;
  align-items: center;        /* centre links horizontally */
  justify-content: center;    /* centre the whole list vertically */
  gap: var(--sp-4);
  overflow-y: auto;
}

.nav__drawer.is-open { display: flex; }

.nav__drawer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  align-items: center;        /* centre each link */
  gap: 0;                     /* driven by border-bottom instead */
  width: 100%;
  max-width: 360px;
}

.nav__drawer-links li {
  width: 100%;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.nav__drawer-links li:first-child {
  border-top: 1px solid rgba(255,255,255,0.08);
}

.nav__drawer-links a {
  display: block;
  padding: var(--sp-5) 0;
  font-family: var(--font-body);     /* Inter — clean & legible on mobile */
  font-size: var(--text-lead);       /* ~20–25px — comfortable mobile size */
  font-weight: var(--weight-heading);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  text-align: center;
  transition: color var(--t-fast);
}

.nav__drawer-links a:hover,
.nav__drawer-links a:focus-visible { color: var(--c-secondary); }

/* ── Buttons ────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 44px;
  padding: var(--sp-3) var(--sp-6);
  font-size: var(--text-small);
  font-weight: var(--weight-label);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  transition:
    background var(--t-fast) var(--ease-out),
    color var(--t-fast) var(--ease-out),
    border-color var(--t-fast) var(--ease-out),
    transform var(--t-fast);
}

.btn:focus-visible {
  outline: 3px solid var(--c-secondary);
  outline-offset: 2px;
}

.btn:active { transform: scale(0.98); }

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

.btn--secondary {
  background: var(--c-secondary);
  color: var(--c-white);
  border-color: var(--c-secondary);
}
.btn--secondary:hover {
  background: var(--c-secondary-hover);
  border-color: var(--c-secondary-hover);
}

.btn--ghost {
  background: transparent;
  color: var(--c-white);
  border-color: rgba(255,255,255,0.6);
}
.btn--ghost:hover {
  border-color: var(--c-white);
  background: rgba(255,255,255,0.08);
}

/* ── Section tag / badge ────────────────────────────────────────── */
.section-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-small);
  font-weight: var(--weight-label);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--c-secondary);
  margin-bottom: var(--sp-4);
}
.section-tag::before {
  content: '';
  display: block;
  width: 24px;
  height: 2px;
  background: var(--c-secondary);
  flex-shrink: 0;
}
.section-tag--light { color: rgba(255,255,255,0.75); }
.section-tag--light::before { background: rgba(255,255,255,0.4); }

/* ── Image badge overlay ────────────────────────────────────────── */
.img-badge {
  position: absolute;
  bottom: var(--sp-6);
  right: var(--sp-6);
  background: var(--c-secondary-muted);
  color: var(--c-white);
  font-size: var(--text-small);
  font-weight: var(--weight-label);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  padding: var(--sp-3) var(--sp-5);
  border-radius: 4px;
  z-index: 2;
}

/* ── Service card ───────────────────────────────────────────────── */
.service-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 8px;
  padding: var(--sp-8);
  list-style: none;   /* belt-and-suspenders: strip any inherited bullet */
  transition: box-shadow var(--t-base) var(--ease-out),
              transform var(--t-base) var(--ease-out),
              background var(--t-base) var(--ease-out);
}

.service-card:hover {
  box-shadow: 0 12px 48px rgba(13,31,60,0.16), 0 2px 8px rgba(13,31,60,0.08);
  transform: translateY(-4px);
  background: var(--c-white);
}

.service-card__number {
  font-family: var(--font-display);
  font-size: var(--text-subtitle);
  font-weight: var(--weight-display);
  color: var(--c-secondary);
  opacity: 0.3;
  line-height: 1;
  margin-bottom: var(--sp-4);
  transition: opacity var(--t-base) var(--ease-out),
              color var(--t-base) var(--ease-out);
}

.service-card:hover .service-card__number {
  opacity: 1;
  color: var(--c-secondary);
  filter: brightness(1.15);
}

.service-card__title {
  font-family: var(--font-display);
  font-size: var(--text-lead);
  font-weight: var(--weight-heading);
  line-height: var(--leading-snug);
  color: var(--c-primary);
  margin-bottom: var(--sp-3);
}

.service-card__body {
  font-size: var(--text-small);
  line-height: var(--leading-loose);
  color: var(--c-off);
}

/* ── Methodology card ───────────────────────────────────────────── */
.method-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 8px;
  padding: var(--sp-8);
  transition: background var(--t-base), border-color var(--t-base);
}

.method-card:hover {
  background: rgba(255,255,255,0.09);
  border-color: rgba(255,255,255,0.20);
}

.method-card__tag {
  font-size: var(--text-micro);
  font-weight: var(--weight-label);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--c-secondary);
  margin-bottom: var(--sp-3);
}

.method-card__title {
  font-family: var(--font-display);
  font-size: var(--text-lead);
  font-weight: var(--weight-heading);
  line-height: var(--leading-snug);
  color: var(--c-white);
  margin-bottom: var(--sp-3);
}

.method-card__body {
  font-size: var(--text-small);
  line-height: var(--leading-loose);
  color: rgba(255,255,255,0.65);
}

/* ── Testimonial card ───────────────────────────────────────────── */
.testimonial-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 8px;
  padding: var(--sp-8);
  display: flex;
  flex-direction: column;
  gap: var(--sp-6);
}

.testimonial-card__quote {
  font-family: var(--font-display);
  font-size: var(--text-body);
  font-style: italic;
  line-height: var(--leading-loose);
  color: var(--c-primary);
  flex: 1;
}

.testimonial-card__quote::before {
  content: '\201C';
  font-size: var(--text-subtitle);
  color: var(--c-secondary);
  line-height: 1;
  display: block;
  margin-bottom: var(--sp-2);
}

.testimonial-card__author {
  font-size: var(--text-small);
  font-weight: var(--weight-label);
  color: var(--c-off);
  border-top: 1px solid var(--c-border);
  padding-top: var(--sp-4);
}

.testimonial-card__author strong {
  display: block;
  color: var(--c-primary);
}

/* ── Principle item ─────────────────────────────────────────────── */
.principle-item {
  display: flex;
  gap: var(--sp-4);
  align-items: flex-start;
}

.principle-item__icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-surface-2);
  border-radius: 8px;
  font-size: var(--text-lead);
}


.principle-item__title {
  font-size: var(--text-body);
  font-weight: var(--weight-heading);
  color: var(--c-primary);
  margin-bottom: var(--sp-1);
}

.principle-item__body {
  font-size: var(--text-small);
  color: var(--c-off);
  line-height: var(--leading-loose);
}

/* ── Stat item ──────────────────────────────────────────────────── */
.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-1);
  text-align: center;
  padding: var(--sp-6) var(--sp-4);
  border-right: 1px solid rgba(255,255,255,0.12);
}

.stat-item:last-child { border-right: none; }

.stat-item__value {
  font-family: var(--font-display);
  font-size: var(--text-subtitle);
  font-weight: var(--weight-display);
  color: var(--c-white);
  line-height: 1;
}

.stat-item__label {
  font-size: var(--text-micro);
  font-weight: var(--weight-label);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
}

/* ── London feature item ────────────────────────────────────────── */
.london-feature {
  display: flex;
  gap: var(--sp-4);
  align-items: flex-start;
  padding: var(--sp-6) 0;
  border-bottom: 1px solid rgba(255,255,255,0.10);
}

.london-feature:last-child { border-bottom: none; }

.london-feature__icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-lead);
}

.london-feature__title {
  font-size: var(--text-body);
  font-weight: var(--weight-heading);
  color: var(--c-white);
  margin-bottom: var(--sp-1);
}

.london-feature__body {
  font-size: var(--text-small);
  color: rgba(255,255,255,0.65);
  line-height: var(--leading-loose);
}

/* ── Form ───────────────────────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
}

.form-grid--full { grid-column: 1 / -1; }

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  min-width: 0;
}

.form-label {
  font-size: var(--text-small);
  font-weight: var(--weight-label);
  color: var(--c-primary);
}

.form-label span { color: var(--c-secondary); }

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  min-height: 44px;
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--c-border);
  border-radius: 4px;
  background: var(--c-surface);
  color: var(--c-text);
  font-size: var(--text-body);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(13,31,60,0.10);
}

.form-input[aria-invalid="true"],
.form-select[aria-invalid="true"],
.form-textarea[aria-invalid="true"] {
  border-color: var(--c-secondary);
}

.form-textarea { resize: vertical; min-height: 120px; }

.form-error {
  font-size: var(--text-micro);
  color: var(--c-secondary);
  font-weight: var(--weight-label);
}

/* Honeypot */
.form-group--honey { display: none; }

/* ── Custom select ──────────────────────────────────────────────── */
.custom-select {
  position: relative;
  width: 100%;
}

.custom-select__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  width: 100%;
  min-height: 44px;
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--c-border);
  border-radius: 4px;
  background: var(--c-surface);
  color: var(--c-text);
  font-size: var(--text-body);
  font-family: var(--font-body);
  font-weight: var(--weight-body);
  text-align: left;
  cursor: pointer;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.custom-select__trigger:focus-visible {
  outline: 3px solid var(--c-secondary);
  outline-offset: 2px;
}

.custom-select__trigger[aria-expanded="true"] {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(13,31,60,0.10);
}

.custom-select__trigger[aria-invalid="true"] {
  border-color: var(--c-secondary);
}

.custom-select__value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select__value.is-placeholder {
  color: var(--c-off);
}

.custom-select__arrow {
  flex-shrink: 0;
  color: var(--c-off);
  transition: transform var(--t-fast) var(--ease-out);
  display: flex;
  align-items: center;
}

.custom-select__trigger[aria-expanded="true"] .custom-select__arrow {
  transform: rotate(180deg);
}

.custom-select__listbox {
  display: none;
  position: absolute;
  top: calc(100% + var(--sp-1));
  left: 0;
  right: 0;
  z-index: 200;
  list-style: none;
  border: 1px solid var(--c-border);
  border-radius: 4px;
  background: var(--c-surface);
  box-shadow: 0 8px 32px rgba(13,31,60,0.14);
  max-height: 260px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.custom-select__listbox.is-open {
  display: block;
}

.custom-select__option {
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--text-body);
  color: var(--c-text);
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
  outline: none;
}

.custom-select__option:hover,
.custom-select__option:focus {
  background: var(--c-surface-2);
  color: var(--c-primary);
}

.custom-select__option.is-selected {
  background: var(--c-surface-2);
  color: var(--c-primary);
  font-weight: var(--weight-label);
}

.custom-select__option--placeholder {
  color: var(--c-off);
}

/* ── Contact dark context overrides ─────────────────────────────── */
.contact .custom-select__trigger {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.18);
  color: var(--c-white);
}

.contact .custom-select__trigger[aria-expanded="true"] {
  border-color: rgba(255,255,255,0.55);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.08);
}

.contact .custom-select__value.is-placeholder {
  color: rgba(255,255,255,0.35);
}

.contact .custom-select__arrow {
  color: rgba(255,255,255,0.55);
}

.contact .custom-select__listbox {
  background: var(--c-primary);
  border-color: rgba(255,255,255,0.16);
  box-shadow: 0 8px 32px rgba(0,0,0,0.45);
}

.contact .custom-select__option {
  color: rgba(255,255,255,0.80);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.contact .custom-select__option:last-child {
  border-bottom: none;
}

.contact .custom-select__option:hover,
.contact .custom-select__option:focus {
  background: rgba(255,255,255,0.08);
  color: var(--c-white);
}

.contact .custom-select__option.is-selected {
  background: rgba(255,255,255,0.10);
  color: var(--c-white);
  font-weight: var(--weight-label);
}

.contact .custom-select__option--placeholder {
  color: rgba(255,255,255,0.35);
}

.form-success {
  text-align: center;
  padding: var(--sp-12);
}

.form-success__icon {
  font-size: var(--text-subtitle);
  margin-bottom: var(--sp-4);
}

@media (max-width: 560px) {
  .form-grid { grid-template-columns: 1fr; }
}

/* ── Footer ─────────────────────────────────────────────────────── */
.footer {
  background: var(--c-primary);
  color: rgba(255,255,255,0.7);
  padding: 0;
}

.footer__bottom {
  border-top: 1px solid rgba(255,255,255,0.10);
  padding: var(--sp-6) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-4);
}

.footer__copy {
  font-size: var(--text-micro);
  color: rgba(255,255,255,0.40);
}

.footer__social {
  display: flex;
  gap: var(--sp-4);
  align-items: center;
}

.footer__social a {
  font-size: var(--text-small);
  font-weight: var(--weight-label);
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  transition: color var(--t-fast);
}

.footer__social a:hover { color: var(--c-white); }

.footer__legal {
  display: flex;
  gap: var(--sp-4);
  align-items: center;
  flex-wrap: wrap;
}

.footer__legal a,
.footer__legal a.iubenda-embed {
  font-size: var(--text-small);
  font-weight: var(--weight-label);
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  transition: color var(--t-fast);
}

.footer__legal a:hover,
.footer__legal a.iubenda-embed:hover { color: var(--c-white); }

@media (max-width: 560px) {
  .footer__bottom { flex-direction: column; align-items: flex-start; }
}