/* ==========================================================================
   Components — reusable UI pieces
   ========================================================================== */

/* Buttons
   ========================================================================== */

.btn {
  --btn-bg: var(--color-navy);
  --btn-fg: var(--color-white);
  --btn-fill: #12355a;

  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  isolation: isolate;
  overflow: hidden;
  min-height: var(--btn-h);
  padding: 0 var(--btn-px);
  border-radius: 103px;
  font-size: var(--fs-btn);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  white-space: nowrap;
  color: var(--btn-fg);
  background: var(--btn-bg);
  transition: color 0.4s var(--ease-out), transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}

.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: var(--btn-fill);
  transform: translateY(101%);
  transition: transform 0.55s var(--ease-out);
}

.btn:hover::before,
.btn:focus-visible::before {
  transform: none;
}

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

.btn--light {
  --btn-bg: var(--color-white);
  --btn-fg: var(--color-navy);
  --btn-fill: var(--color-navy);
}

.btn--light:hover,
.btn--light:focus-visible {
  color: var(--color-white);
}

.btn--lg {
  font-size: var(--fs-btn);
}

.btn--sm {
  min-height: clamp(40px, calc(40px + 16 * (100vw - 393px) / 1527), 56px);
  padding: 0 clamp(18px, calc(18px + 24 * (100vw - 393px) / 1527), 42px);
  font-size: clamp(16px, calc(16px + 2 * (100vw - 393px) / 1527), 18px);
  font-weight: 500;
}

.btn[disabled] {
  opacity: 0.6;
  pointer-events: none;
}

/* Chips
   ========================================================================== */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(10px, calc(10px + 14 * (100vw - 393px) / 1527), 24px) clamp(10px, calc(10px + 12 * (100vw - 393px) / 1527), 22px);
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: clamp(32px, calc(32px + 22 * (100vw - 393px) / 1527), 54px);
  padding: 0 clamp(12px, calc(12px + 8 * (100vw - 393px) / 1527), 20px);
  border-radius: clamp(8px, calc(8px + 2 * (100vw - 393px) / 1527), 10px);
  font-size: var(--fs-chip);
  line-height: 1.38;
  letter-spacing: 0.01em;
  color: var(--color-black);
  background: var(--color-bg);
  transition: background-color 0.3s, color 0.3s;
}

@media (min-width: 1024px) {
  .chip {
    color: var(--color-muted);
  }
}

.chip:hover {
  color: var(--color-white);
  background: var(--color-navy);
}

/* Accordion
   ========================================================================== */

.accordion__item {
  border-bottom: 3px solid var(--color-line);
}

.accordion__item:last-child {
  border-bottom: 0;
}

.accordion__heading {
  font-size: inherit;
  font-weight: 400;
}

.accordion__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
  padding: clamp(16px, calc(16px + 28 * (100vw - 393px) / 1527), 44px) 0;
  font-size: var(--fs-acc);
  line-height: 1.38;
  letter-spacing: -0.02em;
  text-align: left;
  color: var(--color-black);
}

.accordion__item:first-child .accordion__trigger {
  padding-top: 0;
}

.accordion__icon {
  position: relative;
  flex: none;
  width: clamp(40px, calc(40px + 8 * (100vw - 393px) / 1527), 48px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--color-icon-bg);
  transition: background-color 0.4s var(--ease-out), transform 0.5s var(--ease-out);
}

.accordion__icon::before,
.accordion__icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 34%;
  height: 2px;
  margin: -1px 0 0 -17%;
  border-radius: 2px;
  background: var(--color-navy);
  transition: transform 0.5s var(--ease-out), background-color 0.4s;
}

.accordion__icon::after {
  transform: rotate(90deg);
}

.accordion__trigger:hover .accordion__icon {
  transform: scale(1.08);
}

.accordion__item.is-open .accordion__icon {
  background: var(--color-navy);
  transform: rotate(180deg);
}

.accordion__item.is-open .accordion__icon::before,
.accordion__item.is-open .accordion__icon::after {
  background: var(--color-white);
}

.accordion__item.is-open .accordion__icon::after {
  transform: rotate(0deg);
}

.accordion__panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.6s var(--ease-out);
}

.accordion__item.is-open .accordion__panel {
  grid-template-rows: 1fr;
}

.accordion__content {
  min-height: 0;
  overflow: hidden;
}

.accordion__content > p {
  max-width: 688px;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--color-muted);
}

.accordion__content > * {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.4s, transform 0.6s var(--ease-out);
}

.accordion__item.is-open .accordion__content > * {
  opacity: 1;
  transform: none;
  transition-delay: 0.1s;
}

.accordion__item.is-open .accordion__content > .chips {
  transition-delay: 0.18s;
}

.accordion__content .chips {
  margin-top: clamp(16px, calc(16px + 24 * (100vw - 393px) / 1527), 40px);
}

.accordion__item.is-open .accordion__content {
  padding-bottom: clamp(16px, calc(16px + 24 * (100vw - 393px) / 1527), 40px);
}

.accordion__item.is-open .accordion__trigger {
  padding-bottom: clamp(14px, calc(14px + 22 * (100vw - 393px) / 1527), 36px);
}

/* FAQ variant */
.accordion--faq .accordion__item {
  border-bottom-color: var(--color-line-soft);
}

.accordion--faq .accordion__item:last-child {
  border-bottom: 0;
}

.accordion--faq .accordion__trigger {
  padding: clamp(16px, calc(16px + 18 * (100vw - 393px) / 1527), 34px) 0;
  font-size: var(--fs-faq);
}

.accordion--faq .accordion__icon {
  background: var(--color-white);
}

/* Tabs
   ========================================================================== */

.tabs {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.tabs::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--color-line);
}

.tabs__tab {
  padding: 0 0 clamp(10px, calc(10px + 22 * (100vw - 393px) / 1527), 32px);
  font-size: var(--fs-tab);
  font-weight: 400;
  line-height: 1.38;
  letter-spacing: -0.02em;
  color: var(--color-muted);
  transition: color 0.3s;
}

.tabs__tab:hover,
.tabs__tab.is-active {
  color: var(--color-black);
}

.tabs__tab.is-active {
  font-weight: 500;
}

.tabs__indicator {
  position: absolute;
  bottom: 0;
  left: 0;
  z-index: 1;
  width: var(--tab-w, 50%);
  height: 3px;
  background: var(--color-navy);
  transform: translateX(var(--tab-x, 0px));
  transition: transform 0.7s var(--ease-out), width 0.7s var(--ease-out);
}

@media (min-width: 1024px) {
  .tabs {
    grid-template-columns: repeat(2, minmax(0, 568px));
    justify-content: center;
    padding-right: 4%;
  }
}

/* Step
   ========================================================================== */

.step {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  column-gap: clamp(12px, calc(12px + 12 * (100vw - 393px) / 1527), 24px);
}

.step__num {
  display: inline-grid;
  place-items: center;
  min-width: clamp(49px, calc(49px + 31 * (100vw - 393px) / 1527), 80px);
  height: clamp(30px, calc(30px + 18 * (100vw - 393px) / 1527), 48px);
  border: 1px solid var(--color-navy);
  border-radius: 42px;
  font-size: clamp(16px, calc(16px + 10 * (100vw - 393px) / 1527), 26px);
  font-weight: 500;
  line-height: 1;
  color: var(--color-navy);
  transition: color 0.4s, background-color 0.4s;
}

.step.is-active .step__num {
  color: var(--color-white);
  background: var(--color-navy);
}

.step__body {
  display: contents;
}

.step__title {
  align-self: center;
  font-size: var(--fs-step-title);
  line-height: 1.38;
  letter-spacing: -0.01em;
  color: var(--color-black);
}

.step__text {
  grid-column: 1 / -1;
  margin-top: 10px;
  font-size: var(--fs-step-text);
  line-height: var(--lh-step-text);
  color: var(--color-muted);
}

@media (min-width: 1024px) {
  .step__body {
    display: block;
    padding-top: 10px;
  }

  .step__text {
    max-width: 518px;
    margin-top: clamp(10px, calc(10px + 18 * (100vw - 1024px) / 896), 28px);
  }
}

/* Glass card
   ========================================================================== */

.glass-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(16px, calc(16px + 16 * (100vw - 393px) / 1527), 32px);
  padding-top: clamp(50px, calc(50px + 52 * (100vw - 393px) / 1527), 102px);
  border-radius: clamp(16px, calc(16px + 9 * (100vw - 393px) / 1527), 25px);
  background: rgba(255, 255, 255, 0.49);
  -webkit-backdrop-filter: blur(40px);
  backdrop-filter: blur(40px);
}

.glass-card__title {
  font-size: var(--fs-glass-title);
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: var(--color-black);
}

.glass-card__title br {
  display: none;
}

.glass-card__text {
  margin-top: clamp(12px, calc(12px + 12 * (100vw - 393px) / 1527), 24px);
  max-width: 420px;
  font-size: var(--fs-glass-text);
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--color-muted);
}

@media (min-width: 1024px) {
  .glass-card__title br {
    display: inline;
  }
}

/* Social
   ========================================================================== */

.social {
  display: flex;
  gap: 16px;
}

.social__link {
  display: block;
  width: clamp(28px, calc(28px + 20 * (100vw - 393px) / 1527), 48px);
  color: var(--color-white);
  transition: transform 0.4s var(--ease-out), opacity 0.3s;
}

.social__link svg {
  width: 100%;
  height: auto;
}

.social__glyph {
  fill: var(--color-navy);
}

.social__link:hover {
  transform: translateY(-4px) rotate(-8deg);
}

/* Menu toggle
   ========================================================================== */

.menu-toggle {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.menu-toggle__lines {
  position: relative;
  width: 30px;
  height: 18px;
}

.menu-toggle__lines span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 1.5px;
  border-radius: 2px;
  background: #292d32;
  transition: transform 0.5s var(--ease-out), opacity 0.3s, width 0.4s var(--ease-out);
}

.menu-toggle__lines span:nth-child(1) { top: 0; }
.menu-toggle__lines span:nth-child(2) { top: 8.25px; }
.menu-toggle__lines span:nth-child(3) { top: 16.5px; }

.menu-toggle:hover .menu-toggle__lines span:nth-child(2) {
  width: 70%;
}

.menu-toggle[aria-expanded="true"] .menu-toggle__lines span:nth-child(1) {
  transform: translateY(8.25px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-toggle__lines span:nth-child(2) {
  opacity: 0;
}

.menu-toggle[aria-expanded="true"] .menu-toggle__lines span:nth-child(3) {
  transform: translateY(-8.25px) rotate(-45deg);
}

/* Preloader
   ========================================================================== */

.preloader {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  background: var(--color-bg);
}

html:not(.js) .preloader {
  display: none;
}

.preloader__inner {
  display: grid;
  justify-items: center;
  gap: 28px;
}

.preloader__logo {
  width: clamp(160px, calc(160px + 60 * (100vw - 393px) / 1527), 220px);
}

.preloader__road {
  position: relative;
  width: clamp(160px, calc(160px + 60 * (100vw - 393px) / 1527), 220px);
  height: 3px;
  overflow: hidden;
  border-radius: 3px;
  background: rgba(2, 25, 48, 0.1);
}

.preloader__road-fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--color-navy) 0 70%, var(--color-red) 70%);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

/* Form fields
   ========================================================================== */

.field {
  display: grid;
  gap: 8px;
}

.field__label {
  font-size: 15px;
  font-weight: 500;
  color: var(--color-navy);
}

.field__label span {
  font-weight: 400;
  color: var(--color-muted);
}

.field__input {
  width: 100%;
  min-height: 52px;
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: 14px;
  font-size: 16px;
  color: var(--color-navy);
  background: var(--color-bg);
  transition: border-color 0.3s, background-color 0.3s, box-shadow 0.3s;
}

.field__input::placeholder {
  color: rgba(0, 0, 0, 0.4);
}

.field__input:focus {
  outline: none;
  border-color: var(--color-navy);
  background: var(--color-white);
  box-shadow: 0 0 0 4px rgba(2, 25, 48, 0.08);
}

.field__input--area {
  min-height: 96px;
  resize: vertical;
}

.field.is-invalid .field__input {
  border-color: var(--color-red);
}

.field__error {
  min-height: 0;
  font-size: 13px;
  color: var(--color-red);
}

.field__error:empty {
  display: none;
}

/* Modal
   ========================================================================== */

.modal {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: grid;
  place-items: center;
  padding: 16px;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 25, 48, 0.55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.modal__dialog {
  position: relative;
  display: flex;
  width: min(640px, 100%);
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--color-white);
  box-shadow: 0 40px 80px rgba(2, 25, 48, 0.25);
}

/* Scrolls inside the rounded dialog so the scrollbar never cuts its corners */
.modal__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: clamp(24px, calc(24px + 16 * (100vw - 393px) / 1527), 40px);
  scrollbar-width: thin;
  scrollbar-color: rgba(2, 25, 48, 0.25) transparent;
  -webkit-overflow-scrolling: touch;
}

.modal__close {
  position: absolute;
  z-index: 1;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-icon-bg);
  transition: transform 0.4s var(--ease-out), background-color 0.3s;
}

.modal__close::before,
.modal__close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 2px;
  margin: -1px 0 0 -8px;
  border-radius: 2px;
  background: var(--color-navy);
  transform: rotate(45deg);
}

.modal__close::after {
  transform: rotate(-45deg);
}

.modal__close:hover {
  background: var(--color-panel);
  transform: rotate(90deg);
}

.request-form__title {
  padding-right: 52px;
  font-size: clamp(28px, calc(28px + 12 * (100vw - 393px) / 1527), 40px);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.request-form__lead {
  margin-top: 10px;
  font-size: 16px;
  line-height: 1.4;
  color: var(--color-muted);
}

.request-form__types {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0;
}

.type-pill {
  position: relative;
  cursor: pointer;
}

.type-pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.type-pill span {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 18px;
  border: 1px solid rgba(2, 25, 48, 0.15);
  border-radius: 40px;
  font-size: 15px;
  transition: color 0.3s, background-color 0.3s, border-color 0.3s;
}

.type-pill:hover span {
  border-color: var(--color-navy);
}

.type-pill input:checked + span {
  color: var(--color-white);
  border-color: var(--color-navy);
  background: var(--color-navy);
}

.type-pill input:focus-visible + span {
  outline: 2px solid var(--color-navy);
  outline-offset: 3px;
}

.request-form__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 600px) {
  .request-form__grid {
    grid-template-columns: 1fr 1fr;
  }

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

.request-form__submit {
  width: 100%;
  margin-top: 24px;
  min-height: 56px;
  font-size: 18px;
}

/* Short screens (laptops, landscape phones): tighten the form so it fits */
@media (max-height: 860px) {
  .request-form__title {
    font-size: clamp(26px, calc(26px + 6 * (100vw - 393px) / 1527), 32px);
  }

  .request-form__lead {
    margin-top: 6px;
    font-size: 15px;
  }

  .request-form__types {
    margin: 16px 0;
  }

  .request-form__grid {
    gap: 12px;
  }

  .field {
    gap: 6px;
  }

  .field__input {
    min-height: 46px;
    padding: 10px 16px;
  }

  .field__input--area {
    min-height: 72px;
  }

  .request-form__submit {
    margin-top: 18px;
    min-height: 52px;
  }
}

.request-form__status {
  margin-top: 14px;
  font-size: 15px;
  text-align: center;
}

.request-form__status:empty {
  display: none;
}

.request-form__status[data-type="error"] {
  color: var(--color-red);
}

.request-form__status[data-type="success"] {
  color: #12804a;
}

.request-form.is-sent .request-form__grid,
.request-form.is-sent .request-form__types,
.request-form.is-sent .request-form__submit {
  display: none;
}

.request-form.is-sent .request-form__status {
  padding: 24px;
  border-radius: 16px;
  font-size: 18px;
  background: var(--color-bg);
}

/* Upload field (driver documents)
   ========================================================================== */

.upload {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 56px;
  padding: 10px 16px;
  border: 1px dashed rgba(2, 25, 48, 0.25);
  border-radius: 14px;
  background: var(--color-bg);
  cursor: pointer;
  transition: border-color 0.3s, background-color 0.3s;
}

.upload:hover {
  border-color: var(--color-navy);
}

/* Visually hidden but still focusable, so validation can move focus to it */
.upload__input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.upload:focus-within {
  border-style: solid;
  border-color: var(--color-navy);
  box-shadow: 0 0 0 4px rgba(2, 25, 48, 0.08);
}

.upload__icon {
  position: relative;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--color-white);
}

/* Upload arrow, switching to a check mark once a file is picked */
.upload__icon::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--color-navy);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 16V4m0 0-5 5m5-5 5 5M5 20h14'/%3E%3C/svg%3E") center / 18px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 16V4m0 0-5 5m5-5 5 5M5 20h14'/%3E%3C/svg%3E") center / 18px no-repeat;
}

.upload.has-file {
  border-style: solid;
  border-color: rgba(18, 128, 74, 0.45);
  background: rgba(18, 128, 74, 0.06);
}

.upload.has-file .upload__icon::before {
  background: #12804a;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E");
}

.upload__text {
  min-width: 0;
  overflow: hidden;
  font-size: 15px;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--color-muted);
}

.upload.has-file .upload__text {
  color: var(--color-navy);
}

.field.is-invalid .upload {
  border-color: var(--color-red);
}

/* A picked file that fails validation (wrong type / too large) */
.field.is-invalid .upload.has-file {
  background: rgba(229, 50, 50, 0.05);
}

.field.is-invalid .upload.has-file .upload__icon::before {
  background: var(--color-red);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M7 7l10 10M17 7 7 17'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M7 7l10 10M17 7 7 17'/%3E%3C/svg%3E");
}
