/* ---------------------------------------------------------------
   Vendo.pk landing page

   Every value below is taken from the Figma file via "Copy as code",
   not eyeballed. The design canvas is 1920px wide with a 1278px
   content column (1920 - 319px padding on each side).
----------------------------------------------------------------*/

:root {
  /* Colours, exactly as Figma reports them */
  --navy:        #07205F;   /* headings, body copy, labels */
  --navy-deep:   #071A42;
  --red:         #E94235;   /* accent, active toggle, submit */
  --red-dark:    #D2392D;   /* hover only — not in the design */
  --muted:       #60729F;   /* inactive toggle label */
  --line:        #DDE4F0;   /* divider */
  --field-border: rgba(7, 32, 95, 0.1);
  --hero-bg:     #F4F8FD;
  --tint:        #F0F4FC;   /* toggle track, footer */
  --white:       #FFFFFF;
  --card-shadow: 0 12px 24px rgba(7, 32, 95, 0.0313726);

  --container: 1460px;
  --font: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-ui: 'Inter', var(--font);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--navy);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--red); }
h1, h2, h3 { margin: 0; }

.container {
  width: 100%;
  /* 1460px of content plus the gutters, so the column itself stays 1278px. */
  max-width: calc(var(--container) + 48px);
  margin: 0 auto;
  padding: 0 24px;
}

.accent { color: var(--red); }

/* ---------------- Hero ---------------- */

.hero {
  background: var(--hero-bg);
  padding: 80px 0;
  /* The texture exported from Figma (Group 95.png), shown at the design's
     25% opacity via the overlay below. */
  position: relative;
  /* No overflow:hidden here. The texture is inset:0 so it cannot spill, and
     clipping this box cut off the date picker whenever it opened near the
     bottom of the form card. */
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  /* WebP is a third of the PNG; the plain url() above it is the fallback for
     browsers without image-set(). */
  background-image: url("../img/hero-texture.png");
  background-image: image-set(url("../img/hero-texture.webp") type("image/webp"),
                              url("../img/hero-texture.png") type("image/png"));
  opacity: .25;
  pointer-events: none;
}

.hero > .container { position: relative; z-index: 1; }

.hero-inner {
  display: grid;
  grid-template-columns: 780fr 600fr;
  gap: 80px;
  align-items: stretch;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 80px;
}

/* Text block and video, 50px apart (Figma Frame 3). */
.hero-body {
  display: flex;
  flex-direction: column;
  gap: 50px;
}

/* Heading and lead, 30px apart (Figma Frame 11). */
.hero-text {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

/* With no lead paragraph the heading would sit only the 50px hero-body gap
   above the video, which reads as cramped. Make up the difference here. */
.hero-text.is-bare {
  padding-bottom: 30px;
}

.hero-copy .logo {
  /* Figma's Vendo logo is 234.89 x 71.07. The other products' marks have very
     different proportions (Field Force is stacked, MachineKare is wide), so
     they are matched on height and left to find their own width. */
  height: var(--logo-h, 71px);
  width: auto;
  max-width: 100%;
  /* Without this the flex column stretches the box to the full 780px. */
  align-self: flex-start;
}

/* Stand-in for a site whose logo artwork has not arrived yet. */
.logo-fallback {
  width: auto;
  margin: 0;
  font-weight: 700;
  font-size: 40px;
  line-height: 71px;
  letter-spacing: -0.02em;
  color: var(--navy);
}

.hero-copy h1 {
  font-weight: 600;
  font-size: clamp(2.25rem, 3.3333vw, 64px);
  line-height: 1.09375;      /* 70px at 64px */
  letter-spacing: -0.02em;
  color: var(--navy);
}

.hero-copy p {
  margin: 0;
  font-weight: 400;
  font-size: clamp(1rem, 1.0417vw, 20px);
  line-height: 190%;
  color: var(--navy);
}

/* ---------------- Form card ---------------- */

.form-card {
  display: flex;
  flex-direction: column;
  /* Top-aligned, so the heading sits at the design's 40px padding. Figma
     centres the content, but that only reads right with the "Book a Call"
     line we were asked to drop — without it, centring pushed the heading
     38px too far down. */
  justify-content: flex-start;
  gap: 30px;
  padding: 40px 50px;
  background: var(--white);
  box-shadow: var(--card-shadow);
}

.form-card h2 {
  font-weight: 600;
  font-size: clamp(1.5rem, 1.7188vw, 33px);
  line-height: 1.3636;   /* 45px at 33px */
  letter-spacing: -0.025em;
  color: var(--navy);
  /* In Figma the rule is a separate child of the card, so it sits a full
     30px card-gap below the heading — not tucked up against it. */
  padding-bottom: 30px;
  border-bottom: 1px solid var(--line);
}

.form-card form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.field { display: flex; flex-direction: column; gap: 5px; }

.field label,
.field .label {
  font-weight: 600;
  font-size: 13px;
  line-height: 20px;
  letter-spacing: 0.5px;
  color: var(--navy);
}

.req {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 14px;
  color: var(--red);
}

/* Every text-like input, whatever its type. Listing types individually meant
   a new one (tel) silently fell back to the browser's default box, so the
   radios and hidden fields are excluded instead. */
.field input:not([type="radio"]):not([type="hidden"]),
.field textarea {
  width: 100%;
  font-family: var(--font);
  font-weight: 400;
  font-size: 15px;
  line-height: 22px;
  color: var(--navy);
  background: var(--white);
  border: 2px solid var(--field-border);
  border-radius: 0;
}

.field input:not([type="radio"]):not([type="hidden"]) {
  height: 52px;
  padding: 0 20px;
}

.field textarea {
  height: 115px;
  padding: 15px 20px;
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder { color: var(--navy); opacity: .3; }

/* Focus is navy. Red belongs to the error state alone, so a visitor tabbing
   through an optional field is never shown what looks like a validation error. */
.field input:focus,
.field textarea:focus { outline: none; border-color: var(--navy); }

/* Student / Company toggle — a pill track with a pill thumb */
.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  height: 42px;
  padding: 4px;
  background: var(--tint);
  border-radius: 24px;
}

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

.segmented label {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 13px;
  line-height: 16px;
  letter-spacing: normal;
  color: var(--muted);
  border-radius: 20px;
  cursor: pointer;
  transition: background .15s, color .15s;
}

.segmented input:checked + label { background: var(--red); color: var(--white); }
.segmented input:focus-visible + label { outline: 2px solid var(--navy); outline-offset: 2px; }

.btn-submit {
  width: 100%;
  height: 50px;
  font-family: var(--font);
  font-weight: 600;
  font-size: 15px;
  line-height: 22px;
  color: var(--white);
  background: var(--red);
  border: 0;
  border-radius: 0;
  cursor: pointer;
  transition: background .15s;
}

.btn-submit:hover { background: var(--red-dark); }
.btn-submit:disabled { opacity: .65; cursor: not-allowed; }

.hp { position: absolute; left: -9999px; }

.alert {
  padding: 11px 14px;
  font-size: 13px;
  line-height: 20px;
}

.alert-ok  { background: #E8F6ED; color: #14663A; }
.alert-err { background: #FDECEB; color: #8C1D18; }

/* ---------------- Hero video ---------------- */

.video {
  position: relative;
  /* Figma: 756.4px of the 780px column. */
  width: 96.974%;
  /* The design's exact box, 756.4 x 425.1 — a hair wider than 16:9. */
  aspect-ratio: 756.4 / 425.1;
  /* Figma's placeholder grey, seen only until the poster image loads. */
  background: #A2A9BD;
  overflow: hidden;
}

/* Set by js/main.js the moment play is pressed. */
.video.is-playing { background: #000; }

/* The player is built behind the poster before the visitor presses play, so
   that iOS accepts the tap as the gesture that starts it. Until then only the
   poster is visible. */
.video-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.video-poster {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-play { z-index: 3; }

.video.is-playing .video-poster,
.video.is-playing .video-play { display: none; }

/* iOS only: playback starts muted there, so offer the sound. Centred, because
   every edge of the frame belongs to one of YouTube's own controls. */
.video-unmute {
  position: absolute;
  z-index: 4;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  color: var(--white);
  background: rgba(7, 32, 95, .88);
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 999px;
  cursor: pointer;
}

.video-unmute[hidden] { display: none; }
.video-unmute svg { width: 18px; height: 18px; flex: none; }
.video-unmute:hover { background: var(--red); border-color: var(--red); }

.video-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 62px;
  height: 62px;
  border: 2.37px solid var(--white);
  border-radius: 50%;
  background: rgba(233, 66, 53, .95);
  cursor: pointer;
  transition: transform .15s, background .15s;
}

.video-play::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 54%;
  transform: translate(-50%, -50%);
  border-style: solid;
  border-width: 11px 0 11px 18px;
  border-color: transparent transparent transparent var(--white);
}

.video-play:hover { background: var(--red-dark); transform: translate(-50%, -50%) scale(1.06); }


/* ---------------- Info section (Figma Frame 9) ---------------- */

.info {
  background: var(--white);
  padding: 80px 0;
}

.info-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
  text-align: center;
}

.info h2 {
  font-weight: 600;
  font-size: clamp(1.75rem, 2.6042vw, 50px);
  line-height: 1.24;          /* 62px at 50px */
  letter-spacing: -0.025em;
  color: var(--navy);
}

.info p {
  margin: 0;
  font-weight: 400;
  font-size: clamp(1rem, 1.0417vw, 20px);
  line-height: 205.06%;
  color: var(--navy);
}

/* Figma "feature-list-section". Its 40px gap from the paragraph is the
   .info-inner gap of 30 plus the 10 below. */
.features {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
  width: 100%;
  padding-top: 10px;
}

.features h3 {
  font-weight: 600;
  font-size: clamp(1.25rem, 1.6667vw, 32px);
  line-height: 1.5;            /* 48px at 32px */
  color: var(--navy);
  text-align: center;
}

/* 4 cards per row on the 1460px canvas: 4 x 347 + 3 x 24 = 1460 exactly.
   Narrower viewports drop to 3, 2 then 1 per row, and justify-content
   centres whatever is left over on the last row, as the design does. */
.feature-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
  width: 100%;
}

.feature-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 15px;
  flex: 1 1 300px;
  max-width: 347px;
  min-height: 180px;
  padding: 50px 30px;
  background: #F8FAFC;
  border-radius: 12px;
  text-align: center;
}

.feature-card svg {
  width: 35px;
  height: 35px;
  flex: none;
  color: var(--red);
}

.feature-card span {
  font-weight: 600;
  font-size: clamp(1rem, 1.0417vw, 20px);
  line-height: 1.5;            /* 30px at 20px */
  color: var(--navy);
}


/* ---------------- More products ---------------- */
/* Figma "Frame 12": a navy band of cards linking to the other four products.
   Each card is a fixed height so the four logos, which have quite different
   aspect ratios, still line up as one row.

   Deliberately tighter than Figma, which draws 347x180 cards in an 80px band.
   This is a cross-link strip, not a headline section, so it is scaled down to
   sit quieter under the feature grid. */

.more-products {
  background: var(--navy);
  padding: 60px 0;
}

.more-products h2 {
  margin: 0 0 32px;
  font-weight: 600;
  font-size: clamp(1.75rem, 2.6042vw, 50px);
  line-height: 1.24;          /* 62px at 50px */
  letter-spacing: -0.025em;
  color: var(--white);
  text-align: center;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.product-card {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 132px;
  padding: 28px 24px;
  background: var(--white);
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  transition: transform .18s ease, box-shadow .18s ease;
}

/* Not in the design — a hint that the card is a link. */
.product-card:hover,
.product-card:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(7, 26, 66, .28);
}

.product-card:focus-visible { outline: 2px solid var(--white); outline-offset: 3px; }

/* Contained rather than stretched: the five logos are not the same shape. */
.product-card img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}


/* ---------------- Footer ---------------- */

.site-footer {
  background: var(--hero-bg);
  padding: 80px 0;
  text-align: center;
}

.footer-logo-link { display: block; width: 207px; margin: 0 auto 15px; }
.footer-logo { width: 207px; height: 73px; }

.footer-copy {
  margin: 0;
  font-weight: 400;
  font-size: 15px;
  line-height: 205.06%;
  color: var(--navy);
}

.footer-copy a { color: inherit; text-decoration: none; font-weight: 500; }
.footer-copy a:hover,
.footer-copy a:focus-visible { color: var(--red); text-decoration: underline; }

/* ---------------- Form validation states ---------------- */

.field input.is-invalid,
.field textarea.is-invalid { border-color: var(--red); background: #FEF7F6; }

/* An invalid field stays red while it is being corrected. */
.field input.is-invalid:focus,
.field textarea.is-invalid:focus { border-color: var(--red); }

.field-error {
  font-size: 12px;
  line-height: 18px;
  font-weight: 500;
  letter-spacing: normal;
  color: var(--red);
}

/* ---------------- Company-variant fields ---------------- */

.field[hidden] { display: none !important; }

.date-wrap { position: relative; }

.date-wrap input[type="text"] {
  padding-right: 46px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='17' height='17' viewBox='0 0 24 24' fill='none' stroke='%23E94235' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 18px center;
}

/* ---------------- Date + time picker ---------------- */

.dp {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  width: 320px;
  max-width: 100%;
  padding: 16px;
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: 0 12px 32px rgba(7, 32, 95, .16);
}

.dp.dp-above { top: auto; bottom: calc(100% + 6px); }
.dp[hidden] { display: none; }

.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.dp-title { font-size: 14px; font-weight: 600; color: var(--navy); }

.dp-nav {
  width: 30px;
  height: 30px;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--navy);
  background: none;
  border: 1px solid var(--line);
  cursor: pointer;
}

.dp-nav:hover:not(:disabled) { border-color: var(--red); color: var(--red); }
.dp-nav:disabled { opacity: .35; cursor: not-allowed; }

.dp-dow, .dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }

.dp-dow {
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  color: var(--muted);
}

.dp-day {
  aspect-ratio: 1;
  font: inherit;
  font-size: 13px;
  color: var(--navy);
  background: none;
  border: 0;
  cursor: pointer;
}

/* Exclude the selected day: a plain hover would repaint it light and leave
   white text on a light background. */
.dp-day:hover:not(:disabled):not(.is-selected) { background: var(--tint); }
.dp-day:disabled { color: rgba(7, 32, 95, .25); cursor: not-allowed; }
.dp-day.is-today { box-shadow: inset 0 0 0 1px var(--line); }
.dp-day.is-selected { background: var(--red); color: var(--white); font-weight: 600; }
.dp-day.is-selected:hover { background: var(--red-dark); color: var(--white); }

.dp-times-wrap { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }

.dp-times-label, .dp-hint {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--navy);
}

.dp-hint { font-weight: 400; color: var(--muted); margin: 0; }

.dp-times {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  max-height: 140px;
  overflow-y: auto;
}

.dp-time {
  font: inherit;
  font-size: 12px;
  padding: 7px 0;
  color: var(--navy);
  background: var(--white);
  border: 1px solid var(--line);
  cursor: pointer;
}

/* Same here: hovering the selected slot must not turn its text red on red. */
.dp-time:hover:not(:disabled):not(.is-selected) { border-color: var(--red); color: var(--red); }
.dp-time:disabled { opacity: .4; cursor: not-allowed; }
.dp-time.is-selected { background: var(--red); border-color: var(--red); color: var(--white); font-weight: 600; }
.dp-time.is-selected:hover { background: var(--red-dark); border-color: var(--red-dark); color: var(--white); }

.dp-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 12px; }

.dp-clear, .dp-done {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 18px;
  cursor: pointer;
}

.dp-clear { color: var(--muted); background: none; border: 1px solid var(--line); }
.dp-clear:hover { border-color: var(--red); color: var(--red); }

.dp-done { color: var(--white); background: var(--red); border: 1px solid var(--red); }
.dp-done:hover:not(:disabled) { background: var(--red-dark); }
.dp-done:disabled { opacity: .45; cursor: not-allowed; }

/* ---------------- Responsive ---------------- */

@media (max-width: 1024px) {
  .hero-inner { grid-template-columns: 1fr; gap: 48px; }
  .form-card { max-width: 600px; margin-left: auto; margin-right: auto; }
  .hero { padding: 48px 0; }

  /* Tighter than the desktop 80/50/30 once everything is in one column. */
  .hero-copy { gap: 40px; }
  .hero-body { gap: 36px; }
  .hero-text { gap: 20px; }

  /* Once the hero stacks, centre the copy so it lines up with the form card. */
  .hero-copy { text-align: center; }
  .hero-copy .logo { align-self: center; }
  .hero-copy p { margin-left: auto; margin-right: auto; }

  /* The 96.974% is Figma's 756.4-of-780 column and only makes sense beside the
     form. Stacked, it left-aligns the video and leaves a wider gutter on one
     side than the other, so take the full width instead. */
  .video { width: 100%; }

  /* Four 347px cards need 1460px. Two per row is the next size that keeps the
     logos legible. */
  .more-products { padding: 48px 0; }
  .more-products h2 { margin-bottom: 26px; }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .product-card { height: 116px; padding: 22px 20px; }
}

@media (max-width: 640px) {
  .info { padding: 56px 0; }
  .info-inner { gap: 20px; }
  .features { gap: 20px; padding-top: 0; }
  .feature-grid { gap: 16px; }
  .feature-card { min-height: 0; padding: 28px 20px; gap: 12px; }
  /* A fixed height plus max-width:100% would squash the wide marks
     (MachineKare, CheckRyt) on a phone. Letting the height follow the width
     keeps every logo's proportions, with its own height as the ceiling. */
  .hero-copy .logo { height: auto; max-height: var(--logo-h, 71px); }
  .hero-copy br { display: none; }
  .form-card { padding: 24px 20px; gap: 20px; }
  .form-card form { gap: 20px; }
  /* height:auto, or the 73px from the desktop rule stretches the mark. */
  .footer-logo-link { width: 160px; }
  .footer-logo { width: 160px; height: auto; }

  /* iOS Safari zooms the whole page when a focused input is under 16px. */
  .field input:not([type="radio"]):not([type="hidden"]),
  .field textarea { font-size: 16px; }

  /* The design's 34px button is under the 44px a thumb needs. The track grows
     with it (44 + the 4px padding on each side) so the pill still fits. */
  .segmented { height: 52px; border-radius: 28px; }
  .segmented label { font-size: 13px; height: 44px; border-radius: 24px; }
  .footer-copy a { display: inline-block; padding: 4px 0; }

  /* One per row on a phone: two 150px cards side by side leave the wide marks
     (MachineKare, CheckRyt) too small to read. */
  .product-grid { grid-template-columns: 1fr; gap: 12px; }
  .product-card { height: 96px; padding: 18px 20px; }
}

@media (max-width: 400px) {
  .dp { width: 100%; }
  .dp-times { grid-template-columns: repeat(3, 1fr); }
}
