/* ==========================================================================
   Home page
   Mobile-first. Base rules match the 390px mobile mockup; the min-width
   rules move to the desktop mockup (exact at 1200px+). Breakpoints follow
   Bootstrap: md 768, lg 992, xl 1200.
   ========================================================================== */

/* Hero -------------------------------------------------------------------- */
.home-hero {
  background: var(--pg-sky-50);
  padding-block: 28px 40px;
}

.home-hero__grid {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "badge"
    "title"
    "lead"
    "media"
    "actions";
}

.home-hero__badge   { grid-area: badge; }
.home-hero__title   { grid-area: title; }
.home-hero__lead    { grid-area: lead; margin: 0; max-width: 560px; }
.home-hero__media   { grid-area: media; }
.home-hero__actions { grid-area: actions; }

.home-hero__login {
  grid-area: login;
  display: none;
  margin: 0;
  font-size: 15px;
  color: var(--pg-muted);
}
.home-hero__login a { font-weight: 700; text-decoration: underline; }

.home-hero__badge {
  justify-self: start;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--pg-line-sky);
  border-radius: var(--pg-radius-pill);
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--pg-blue);
}

.home-hero__badge::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: var(--pg-radius-pill);
  background: var(--pg-cyan);
}

.home-hero__actions {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Phone artwork: one 250px circle, 230px image, 260px tall block. */
.home-hero__media {
  position: relative;
  height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.home-hero__media::before {
  content: "";
  position: absolute;
  width: 250px;
  height: 250px;
  border-radius: var(--pg-radius-pill);
  background: var(--pg-cyan-100);
}

.home-hero__media picture { position: relative; display: block; width: 230px; }
.home-hero__media img { display: block; width: 100%; height: auto; }

@media (min-width: 768px) {
  .home-hero { padding-block: 56px 72px; }
  .home-hero__grid {
    gap: 24px;
    grid-template-areas:
      "badge"
      "title"
      "lead"
      "media"
      "actions"
      "login";
  }
  .home-hero__badge { font-size: 14px; padding: 8px 16px; gap: 10px; }
  .home-hero__actions { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 14px; }
  .home-hero__actions .btn-primary { --bs-btn-padding-x: 28px; }
  .home-hero__call { --bs-btn-padding-x: 24px; }
  .home-hero__login { display: block; }

  /* Desktop artwork: a light circle inside a square up to 460px. */
  .home-hero__media {
    height: auto;
    width: 460px;
    max-width: 100%;
    aspect-ratio: 1 / 1;
    justify-self: center;
  }
  .home-hero__media::before { width: auto; height: auto; inset: 6%; }
  .home-hero__media picture { width: 78%; }
}

@media (min-width: 992px) {
  .home-hero { padding-block: 72px 80px; }
  .home-hero__grid {
    /* Same split as the mockup's flex 520px / 440px columns: 612px / 532px at 1200px. */
    grid-template-columns: minmax(0, calc(50% + 12px)) minmax(0, 1fr);
    grid-template-areas:
      "badge   media"
      "title   media"
      "lead    media"
      "actions media"
      "login   media";
    column-gap: 56px;
    align-content: center;
  }
  .home-hero__media { align-self: center; }
}

/* Stats ------------------------------------------------------------------- */
.home-stats {
  position: relative;
  margin-top: -20px;
}

.home-stats__card {
  background: var(--pg-navy);
  color: #fff;
  border-radius: var(--pg-radius-lg);
  padding: 22px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.home-stats__value {
  font-family: var(--pg-font-display);
  font-weight: 800;
  font-size: clamp(26px, 19.26px + 1.728vw, 40px);
  color: var(--pg-cyan);
}

.home-stats__label {
  font-size: 13px;
  color: var(--pg-on-dark);
}

@media (min-width: 768px) {
  .home-stats { margin-top: -36px; }
  .home-stats__card {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 24px 40px;
    padding: 32px 36px;
    border-radius: var(--pg-radius-xl);
  }
  .home-stats__item { flex: 1 1 200px; display: flex; flex-direction: column; gap: 4px; }
  .home-stats__label { font-size: 15px; }
}

/* Services ---------------------------------------------------------------- */
.home-services { padding-block: 48px 24px; }

.home-services__grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.service-card {
  background: var(--pg-sky-50);
  border: 1px solid var(--pg-line-sky-2);
  border-radius: var(--pg-radius-lg);
  padding: 22px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  min-width: 0;
}

.service-card__icon {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: var(--pg-radius-sm);
  background: #fff;
  border: 1px solid var(--pg-line-sky);
  color: var(--pg-ink);
  display: flex;
  align-items: center;
  justify-content: center;
}

.service-card__icon svg { width: 22px; height: 22px; }

.service-card__body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.service-card__title { font-size: 20px; }
.service-card__text { margin: 0; font-size: 15px; line-height: 1.5; color: var(--pg-text); }

/* Featured (Permits) card */
.service-card--featured {
  background: var(--pg-navy);
  border: 0;
  color: #fff;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  padding: 24px;
}

.service-card--featured .service-card__icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--pg-cyan);
  border: 0;
}

.service-card--featured .service-card__icon svg { width: 24px; height: 24px; }
.service-card--featured .service-card__title { font-size: 26px; }
.service-card--featured .service-card__text { color: var(--pg-on-dark); font-size: 16px; line-height: 1.55; max-width: 520px; }

.service-card__tags { display: none; flex-wrap: wrap; gap: 8px; }

.service-card__tags span {
  border: 1px solid var(--pg-line-chip);
  border-radius: var(--pg-radius-pill);
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 600;
}

@media (min-width: 768px) {
  .home-services { padding-block: 72px 32px; }
  .home-services__grid { gap: 20px; }
  .service-card { padding: 28px; gap: 20px; }
  .service-card__icon { width: 52px; height: 52px; border-radius: var(--pg-radius-md); }
  .service-card__icon svg { width: 26px; height: 26px; }
  .service-card__title { font-size: 24px; }
  .service-card__text { font-size: 17px; line-height: 1.55; }
  .service-card__tags { display: flex; }
  .service-card--featured { gap: 18px; padding: 32px; }
  .service-card--featured .service-card__title { font-size: 30px; }
  .service-card--featured .service-card__text { font-size: 18px; }
}

/* Desktop: the mockup's wrapping flex row (Permits + ECC, then Site Plans + Title 24).
   Bases include padding so they behave like the mockup's content-box sizes. */
@media (min-width: 992px) {
  .home-services__grid { flex-direction: row; flex-wrap: wrap; }
  .service-card {
    flex: 1 1 364px;
    flex-direction: column;
    gap: 14px;
    padding: 32px;
    border-radius: var(--pg-radius-xl);
  }
  .service-card__body { gap: 14px; }
  .service-card__title { font-size: 26px; }
  .service-card--featured { flex: 2 1 592px; padding: 36px; gap: 18px; }
  .service-card--featured .service-card__icon { width: 56px; height: 56px; border-radius: var(--pg-radius-md); }
  .service-card--featured .service-card__icon svg { width: 28px; height: 28px; }
  .service-card--featured .service-card__title { font-size: 32px; }
}

/* Narrow desktops: the flex row would leave Title 24 alone on a row, so use
   Permits on top and the other three side by side. */
@media (min-width: 992px) and (max-width: 1199.98px) {
  .home-services__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .service-card--featured { grid-column: 1 / -1; }
}

@media (min-width: 1200px) {
  .home-services { padding-block: 96px 40px; }
}

/* Process ----------------------------------------------------------------- */
.home-process { padding-block: 32px 48px; }

.process-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: step;
  display: flex;
  flex-direction: column;
}

.process-step {
  counter-increment: step;
  display: flex;
  gap: 14px;
  padding-block: 14px;
  border-bottom: 1px solid var(--pg-line);
}

.process-step:last-child { border-bottom: 0; }

.process-step::before {
  content: counter(step);
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: var(--pg-radius-pill);
  background: var(--pg-cyan-100);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.process-step__title {
  font-family: var(--pg-font-body);
  font-weight: 700;
  font-size: 17px;
}

.process-step__text { margin: 4px 0 0; font-size: 15px; color: var(--pg-text); }

@media (min-width: 768px) {
  .home-process { padding-block: 48px 72px; }
  .process-steps { flex-direction: row; flex-wrap: wrap; gap: 20px; }
  .process-step {
    flex: 1 1 240px;
    min-width: 0;
    flex-direction: column;
    gap: 10px;
    padding: 20px 0 0;
    border-bottom: 0;
    border-top: 4px solid var(--pg-cyan);
  }
  .process-step::before {
    content: counter(step, decimal-leading-zero);
    width: auto;
    height: auto;
    border-radius: 0;
    background: none;
    justify-content: flex-start;
    font-family: var(--pg-font-display);
    font-size: 20px;
    color: var(--pg-blue);
  }
  .process-step__body { display: flex; flex-direction: column; gap: 10px; }
  .process-step__title { font-family: var(--pg-font-display); font-size: 22px; }
  .process-step__text { margin: 0; font-size: 16px; line-height: 1.55; }
}

@media (min-width: 1200px) {
  .home-process { padding-block: 64px 96px; }
}

/* About / promise --------------------------------------------------------- */
.home-about {
  background: var(--pg-sky-50);
  padding-block: 44px;
}

.home-about__grid { display: grid; gap: 18px; }
.home-about__intro { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

.home-about__quote { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.home-about__quote p { margin: 0; font-size: clamp(18px, 16.07px + 0.494vw, 22px); line-height: 1.5; }
.home-about__quote footer { font-weight: 700; color: var(--pg-blue); }

.mascot-card {
  display: flex;
  gap: 16px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--pg-line-sky);
  border-radius: var(--pg-radius-md);
  padding: 14px 18px 14px 14px;
  max-width: 540px;
}

.mascot-card picture { flex: none; }

.mascot-card img {
  display: block;
  width: 60px;
  height: 60px;
  border-radius: var(--pg-radius-pill);
  object-fit: cover;
}

.mascot-card__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.mascot-card__name { font-weight: 800; font-size: 16px; }
.mascot-card__role { font-weight: 600; font-size: 13px; color: var(--pg-blue); }
.mascot-card p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--pg-text); }

.promise-card {
  background: #fff;
  border-radius: 18px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.promise-card__title { font-size: 24px; }

.check-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 16px;
}

.check-list li { display: flex; gap: 10px; align-items: flex-start; }
.check-list svg { flex: none; width: 22px; height: 22px; color: var(--pg-green); }

@media (min-width: 768px) {
  .home-about { padding-block: 72px; }
  .home-about__intro { gap: 22px; }
  .home-about__quote { gap: 14px; }
  .mascot-card { border-radius: 18px; align-self: flex-start; }
  .mascot-card img { width: 72px; height: 72px; }
  .mascot-card__name { font-size: 17px; }
  .mascot-card__role { font-size: 14px; }
  .mascot-card p { font-size: 15px; }
  .promise-card { padding: 32px; border-radius: var(--pg-radius-xl); box-shadow: var(--pg-shadow-card); }
  .check-list { gap: 16px; font-size: 17px; }
  .check-list li { gap: 12px; }
  .check-list svg { width: 24px; height: 24px; }
}

@media (min-width: 992px) {
  .home-about__grid {
    /* 600px / 544px at 1200px, like the mockup's flex columns. */
    grid-template-columns: 50% minmax(0, 1fr);
    gap: 56px;
    align-items: center;
  }
}

@media (min-width: 1200px) {
  .home-about { padding-block: 96px; }
}

/* Reviews ----------------------------------------------------------------- */
.home-reviews { padding-block: 44px; }
.home-reviews__title { margin-bottom: 20px; }

.reviews { display: flex; flex-direction: column; gap: 16px; }
.review-card--first-on-phone { order: -1; }

.review-card {
  margin: 0;
  border: 1px solid var(--pg-line);
  border-radius: var(--pg-radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  background: #fff;
  min-width: 0;
}

.review-card blockquote { margin: 0; font-size: 16px; line-height: 1.6; color: var(--pg-quote); }

.review-card figcaption { display: flex; gap: 12px; align-items: center; }

.review-card__avatar {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: var(--pg-radius-pill);
  background: var(--pg-cyan-100);
  color: var(--pg-ink);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.review-card__who { display: flex; flex-direction: column; }
.review-card__role { font-size: 14px; color: var(--pg-muted); }

@media (min-width: 768px) {
  .home-reviews { padding-block: 72px; }
  .home-reviews__title { margin-bottom: 40px; }
  .reviews { flex-direction: row; flex-wrap: wrap; gap: 20px; }
  .review-card--first-on-phone { order: 0; }
  .review-card { flex: 1 1 358px; padding: 28px; gap: 20px; border-radius: var(--pg-radius-xl); }
  .review-card blockquote { font-size: 17px; }
  .review-card__avatar { width: 44px; height: 44px; }
}

@media (min-width: 1200px) {
  .home-reviews { padding-block: 96px; }
}

/* Account + quote --------------------------------------------------------- */
.home-account {
  background: var(--pg-navy);
  color: #fff;
  padding-block: 44px;
}

.home-account__grid { display: grid; gap: 30px; }

.home-account__intro { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.home-account__intro p { margin: 0; font-size: clamp(16px, 14.56px + 0.37vw, 19px); line-height: 1.55; color: var(--pg-on-dark); }

.home-account__divider { height: 1px; background: var(--pg-line-navy); margin: 8px 0; }

.contact-list {
  flex-direction: column;
  gap: 14px;
  font-size: 17px;
}

.contact-list a,
.contact-list div { display: flex; gap: 12px; align-items: center; color: #fff; }
.contact-list a:hover { color: var(--pg-cyan); }
.contact-list svg { flex: none; color: var(--pg-cyan); }

.quote-form {
  background: #fff;
  color: var(--pg-ink);
  border-radius: var(--pg-radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.quote-form__head { display: contents; }
.quote-form__title { font-size: 24px; }
.quote-form__intro { margin: 0; font-size: 15px; color: var(--pg-muted); }

.quote-form__row { display: flex; flex-direction: column; gap: 14px; }
.quote-form__field { min-width: 0; }
.quote-form__field .form-label { display: block; }

.quote-form__submit { --bs-btn-font-weight: 800; }

.quote-form__status {
  border-radius: var(--pg-radius-sm);
  padding: 12px 14px;
  font-size: 15px;
  font-weight: 600;
}

.quote-form__status.is-success { background: #EDF7F0; color: var(--pg-green); }
.quote-form__status.is-error { background: #FDF2F1; color: var(--pg-red); }

@media (min-width: 768px) {
  .home-account { padding-block: 72px; }
  .home-account__intro { gap: 22px; }
  .home-account__cta { align-self: flex-start; }
  .quote-form { padding: 36px; gap: 18px; border-radius: var(--pg-radius-xl); }
  .quote-form__title { font-size: 28px; }
  .quote-form__row { flex-direction: row; flex-wrap: wrap; gap: 16px; }
  .quote-form__field--half { flex: 1 1 200px; }
  .quote-form__field--company { flex: 2 1 220px; }
  .quote-form__field--license { flex: 1 1 160px; }
}

@media (min-width: 992px) {
  .home-account__grid {
    /* 540px / 612px at 1200px, like the mockup. */
    grid-template-columns: minmax(0, calc(50% - 60px)) minmax(0, 1fr);
    gap: 48px;
    align-items: start;
  }
}

@media (min-width: 1200px) {
  .home-account { padding-block: 96px; }
}
