/* ============================================================
   CST Academy — Homepage v1 shared component styles (self-contained)
   Standalone copy of the home2 component library so home1 has no
   dependency on the /home2/ folder. Scoped to .cst-home-page.
   home1/cst-home1.css loads AFTER this and adds/overrides v1 styles.
   ============================================================ */

.cst-home-page {
  --navy: #163A4C;
  --navy-deep: #112337;
  --blue: #3B7EAB;
  --blue-age: #6DAADD;
  --powder: #9EC7E4;
  --pale: #F2F8FD;
  --pale-deep: #DEEFF9;
  --purple: #49264F;
  --gold: #FFC233;
  --white: #FFFFFF;
  --body: #1C1C20;
  --muted: rgba(28, 28, 32, 0.8);
  --card-border: #C9C9C9;
  --card-shadow: 0 6px 14.5px rgba(0,0,0,0.09);
  --maxw: 1200px;
  --radius-card: 20px;
  --radius-btn: 999px;

  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--body);
  font-size: 16px;
  line-height: 1.6;
  background: var(--white);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;

  & *, & *::before, & *::after { box-sizing: border-box; }
  & img { max-width: 100%; display: block; }
  & a { color: var(--blue); text-decoration: none; }
  & a:hover { color: var(--navy); }

  & .wrap { width: 88%; max-width: var(--maxw); margin: 0 auto; }
  & section { padding: 40px 0; }
  & section[id] { scroll-margin-top: 110px; }
  & .bg-white { background: var(--white); }
  & .bg-paledeep { background: var(--pale-deep); }
  & .bg-soft { background: var(--pale); }
  & .bg-navy { background: var(--navy); color: var(--white); }

  & h1, & h2, & h3 { color: var(--navy); margin: 0; font-weight: 700; text-wrap: balance; }
  & h2 { font-size: clamp(30px, 4vw, 50px); line-height: 1.2; }
  & .bg-navy h1, & .bg-navy h2 { color: var(--white); }
  & .lede { font-size: 19px; line-height: 1.55; color: var(--navy); }
  & .bg-navy .lede { color: rgba(255,255,255,0.9); }

  & .section-head { text-align: center; margin: 0 auto 44px; }
  & .section-head .lede { margin: 14px auto 0; }
  & .section-head.purple h2 { color: var(--purple); }

  /* Buttons */
  & .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; font-size: 17px; border-radius: var(--radius-btn); padding: 13px 24px; min-height: 46px; text-decoration: none; transition: background .15s, color .15s, transform .12s; white-space: nowrap; }
  & .btn:hover { transform: translateY(-1px); }
  & .btn-primary { background: var(--navy); color: #fff; }
  & .btn-primary:hover { background: var(--navy-deep); color: #fff; }
  & .btn-secondary { background: var(--white); color: var(--navy); border: 1px solid var(--navy); }
  & .btn-secondary:hover { background: var(--navy); color: #fff; }
  & .btn-white-on-dark { background: #fff; color: var(--navy); }
  & .btn-white-on-dark:hover { background: var(--gold); color: var(--navy); }
  & .btn-outline-white { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,0.55); }
  & .btn-outline-white:hover { background: #fff; color: var(--navy); border-color: #fff; }
  & .btn .btn-ico { display: inline-flex; width: 18px; height: 18px; }
  & .btn .btn-ico svg { width: 100%; height: 100%; }
  & .btn .arrow { width: 17px; height: 17px; display: inline-flex; }
  & .btn .arrow svg { width: 100%; height: 100%; }
  & .center-cta { text-align: center; margin-top: 40px; }

  /* Stats */
  & .stats { padding: 20px 0; }
  & .stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; text-align: center; }
  & .stat { display: flex; flex-direction: column; align-items: center; gap: 4px; }
  & .stat-num { font-weight: 800; font-size: 28px; color: var(--navy); line-height: 1.1; }
  & .stat-label { font-size: 16px; color: rgba(22,58,76,0.7); }

  /* Services */
  & .svc-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px; }
  & .svc-grid > .svc-card { grid-column: span 3; }
  & .svc-grid > .svc-card:nth-child(n+5) { grid-column: span 4; }
  & .svc-card { background: #fff; color: var(--body); border: 1px solid var(--card-border); border-radius: var(--radius-card); box-shadow: var(--card-shadow); padding: 26px 22px; display: flex; flex-direction: column; gap: 12px; transition: transform .15s, box-shadow .15s; text-decoration: none; }
  & a.svc-card:hover { color: var(--body); }
  & .svc-card:hover { border-color: #5c9cc1; box-shadow: 0 3px 10px 1px #5c9cc1; background-color: #f6fcff; }
  & .svc-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  & .svc-icon { width: 70px; height: 70px; display: flex; align-items: center; justify-content: center; padding: 0; }
  & .svc-icon img { width: 70px; height: 70px; object-fit: contain; }
  & .age-pill { background: var(--blue-age); color: #fff; font-weight: 700; font-size: 12px; line-height: 1.1; border-radius: 10px; padding: 5px 10px; text-align: center; }
  & .svc-card h3 { font-size: 22px; line-height: 1.25; }
  & .svc-card p { margin: 0; font-size: 16px; line-height: 1.6; color: var(--body); opacity: 0.8; }

  /* Step timeline (vertical) */
  & .hiw-section { background: #F4F8FC; }
  & .hiw-card { background: #fff; border: 1px solid var(--card-border); border-radius: var(--radius-card); box-shadow: var(--card-shadow); padding: 40px; display: grid; grid-template-columns: 1.05fr 1fr; gap: 44px; align-items: stretch; }
  & .hiw-steps { display: flex; flex-direction: column; justify-content: space-between; gap: 26px; }
  & .hiw-step { position: relative; display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: start; }
  & .hiw-step:not(:last-child)::before { content: ""; position: absolute; left: 31px; top: 20px; height: calc(100% + 6px); width: 2px; transform: translateX(-50%); background: var(--powder); z-index: 0; }
  & .hiw-num { position: relative; z-index: 1; width: 62px; height: 40px; border-radius: 999px; background: linear-gradient(114.24deg, rgb(59,126,171) 16.25%, rgb(103,166,200) 147.27%); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; flex-shrink: 0; }
  & .hiw-text h3 { font-size: 19px; color: var(--navy); margin: 0 0 4px; }
  & .hiw-text p { margin: 0; color: rgba(22, 58, 76, 1); opacity: 1; font-size: 16px; line-height: 1.55; }
  & .hiw-photo { border-radius: 14px; overflow: hidden; box-shadow: var(--card-shadow); min-height: 360px; }
  & .hiw-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

  /* Photo gallery */
  & .room-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: 32px; }
  & .room { margin: 0; background: #fff; border: 1px solid var(--card-border); border-radius: var(--radius-card); box-shadow: var(--card-shadow); padding: 12px 12px 18px; display: flex; flex-direction: column; }
  & .room img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; border-radius: 12px; }
  & .room figcaption { margin-top: 14px; padding: 0 6px; }
  & .room figcaption strong { display: block; color: var(--navy); font-size: 24px; }
  & .room figcaption span { color: var(--muted); font-size: 16px; }

  /* Consultation */
  & .consult-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; align-items: stretch; }
  & .consult-visual { border-radius: var(--radius-card); overflow: hidden; box-shadow: var(--card-shadow); min-height: 320px; }
  & .consult-visual img { width: 100%; height: 100%; object-fit: cover; }
  & .consult-card { background: var(--blue); color: #fff; border: none; border-radius: var(--radius-card); box-shadow: var(--card-shadow); padding: 32px; }
  & .consult-card h3 { color: #fff; font-size: 24px; margin-bottom: 16px; }
  & .consult-note { margin: 14px 0 0; color: rgba(255,255,255,0.85); font-size: 14px; }
  & .gf-home-wrap .gfield_label, & .gf-home-wrap legend, & .gf-home-wrap label,
  & .gf-home-wrap .gform-field-label, & .gf-home-wrap .gfield_required,
  & .gf-home-wrap .gfield_required_asterisk, & .gf-home-wrap .gfield_description { color: #fff !important; }
  & .gf-home-wrap .gform_fields { gap: 14px !important; row-gap: 14px !important; }
  & .gf-home-wrap .gfield { margin-bottom: 0 !important; }
  & .gf-home-wrap .gfield_label, & .gf-home-wrap legend { margin-bottom: 4px !important; }
  & .gf-home-wrap input[type=text], & .gf-home-wrap input[type=email], & .gf-home-wrap input[type=tel],
  & .gf-home-wrap input[type=number], & .gf-home-wrap select, & .gf-home-wrap textarea {
    background: #fff !important; border: 1px solid transparent !important; border-radius: 10px !important; padding: 11px 14px !important; font-size: 16px; color: var(--body); font-family: inherit;
  }
  & .gf-home-wrap input:focus, & .gf-home-wrap select:focus, & .gf-home-wrap textarea:focus { outline: none; border-color: var(--navy) !important; box-shadow: 0 0 0 3px rgba(255,255,255,0.25) !important; }
  & .gf-home-wrap select {
    height: auto !important; min-height: 46px !important; line-height: 1.4 !important;
    -webkit-appearance: none !important; -moz-appearance: none !important; appearance: none !important;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' stroke='%23163A4C' stroke-width='1.7' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 14px center / 12px 8px !important;
    padding-right: 38px !important;
    /* Fix Chromium paint glitch on appearance:none <select> + webfont:
       promote to its own GPU layer so the collapsed text repaints cleanly. */
    transform: translateZ(0);
    will-change: transform;
    -webkit-font-smoothing: antialiased;
  }
  & .gf-home-wrap .gform_footer { margin-top: 6px; padding: 0; }
  & .gf-home-wrap input[type=submit], & .gf-home-wrap .gform_button {
    background: var(--navy) !important; color: #fff !important; border: none !important; border-radius: var(--radius-btn) !important;
    padding: 14px 24px !important; font-weight: 700 !important; font-size: 16px !important; font-family: inherit; cursor: pointer; width: 100% !important;
  }
  & .gf-home-wrap input[type=submit]:hover, & .gf-home-wrap .gform_button:hover { background: var(--navy-deep) !important; }

  /* Testimonials */
  & .t-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; align-items: stretch; }
  & .t-card { background: #fff; border: 1px solid var(--card-border); border-radius: var(--radius-card); box-shadow: var(--card-shadow); padding: 28px; display: flex; flex-direction: column; gap: 14px; }
  & .t-google-img { height: 28px; width: auto; display: block; max-width: fit-content; }
  & .t-quote { margin: 0; font-size: 16px; line-height: 1.7; color: var(--body); }
  & .t-attr { font-weight: 700; color: var(--navy); margin-top: auto; }
  & .t-attr span { display: inline; font-weight: 400; color: var(--muted); }

  /* Insurance */
  & .ins-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; max-width: 980px; margin: 0 auto; }
  & .ins-card { background: var(--purple); color: #fff; border: none; border-radius: var(--radius-card); box-shadow: var(--card-shadow); padding: 28px 32px; text-align: left; }
  & .ins-card h3 { color: #fff; font-size: 20px; margin-bottom: 8px; }
  & .ins-card p { margin: 0 0 10px; color: rgba(255,255,255,0.82); font-size: 16px; line-height: 1.55; }
  & .ins-note { max-width: 760px; margin: 24px auto 0; text-align: center; color: var(--muted); font-size: 16px; line-height: 1.55; }

  /* Disclaimer band */
  & .home-disclaimer { background: var(--pale); padding: 28px 0; }
  & .home-disclaimer p { margin: 0; text-align: center; color: var(--muted); font-size: 13px; line-height: 1.6; max-width: 820px; margin-left: auto; margin-right: auto; }

  /* Locations */
  & .loc-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 20px; }
  & .loc-grid > .loc-card { grid-column: span 2; }
  & .loc-grid > .loc-card:nth-child(n+7) { grid-column: span 3; }
  & .loc-card { position: relative; background: #fff; border: 1px solid var(--card-border); border-radius: var(--radius-card); box-shadow: var(--card-shadow); padding: 22px; display: flex; gap: 14px; transition: border-color .15s, box-shadow .15s; }
  & .loc-card:hover { border-color: #5c9cc1; box-shadow: 0 3px 10px 1px #5c9cc1; background-color: #f6fcff; }
  & .loc-stretch { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
  & .loc-pin { width: 39px; height: 50px; color: var(--purple); flex-shrink: 0; }
  & .loc-pin svg { width: 100%; height: 100%; }
  & .loc-body { display: flex; flex-direction: column; gap: 4px; }
  & .loc-body strong { color: var(--purple); font-size: 20px; }
  & .loc-addr { color: var(--body); opacity: 0.8; font-size: 16px; line-height: 1.4; }
  & .loc-phone { position: relative; z-index: 2; display: inline-flex; align-items: center; gap: 6px; color: var(--blue); font-weight: 600; font-size: 16px; margin-top: 2px; align-self: flex-start; }
  & .loc-phone svg { width: 14px; height: 14px; }
  & .loc-eval { font-style: italic; font-size: 14px; color: var(--muted); margin-top: 4px; line-height: 1.4; }
  & .loc-foot { text-align: center; font-style: italic; color: var(--muted); font-size: 14px; margin: 28px 0 0; }

  /* Final CTA */
  & .final-cta { text-align: center; }
  & .final-cta-btns { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; }
  & .final-cta h2 { color: #fff; }
  & .final-cta .lede { color: rgba(255,255,255,0.9); margin: 14px auto 26px; }
  & .final-cta .hours { color: rgba(255,255,255,0.85); font-size: 16px; margin: 24px 0 0; }
  & .final-cta .hours strong { color: #fff; }

  /* FAQ */
  & .faq { max-width: 1000px; margin: 0 auto; }
  & .faq details { border: 1px solid rgba(73,38,79,0.18); border-radius: 8px; padding: 18px 22px; background: #fff; margin-bottom: 12px; }
  & .faq summary { list-style: none; cursor: pointer; font-weight: 700; color: var(--navy); font-size: 18px; line-height: 1.4; display: flex; align-items: center; gap: 12px; }
  & .faq summary::-webkit-details-marker { display: none; }
  & .faq summary::before { content: ""; width: 12px; height: 12px; background: var(--navy); clip-path: polygon(0 0, 0 100%, 100% 50%); transition: transform .2s, background .2s; flex-shrink: 0; }
  & .faq details[open] summary { color: var(--purple); }
  & .faq details[open] summary::before { background: var(--purple); transform: rotate(90deg); }
  & .faq .answer { margin: 12px 0 0 24px; color: var(--body); opacity: 0.85; font-size: 16px; line-height: 1.6; }

  /* Reveal */
  & .reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s, transform .6s; }
  & .reveal.is-visible { opacity: 1; transform: none; }
  & .svc-grid > *, & .room-grid > *, & .t-grid > *, & .loc-grid > *, & .ins-grid > * { min-width: 0; }

  /* Responsive */
  @media (max-width: 1000px) {
    & .svc-grid { grid-template-columns: repeat(2, 1fr); }
    & .svc-grid > .svc-card, & .svc-grid > .svc-card:nth-child(n+5) { grid-column: auto; }
    & .room-grid { grid-template-columns: repeat(2, 1fr); }
    & .loc-grid { grid-template-columns: repeat(2, 1fr); }
    & .loc-grid > .loc-card, & .loc-grid > .loc-card:nth-child(n+7) { grid-column: auto; }
    & .t-grid { grid-template-columns: 1fr; }
    & .hiw-card { grid-template-columns: 1fr; gap: 32px; padding: 28px; }
    & .consult-grid { grid-template-columns: 1fr; }
  }
  @media (max-width: 640px) {
    & section { padding: 56px 0; }
    & .stats-row { grid-template-columns: repeat(2, 1fr); gap: 28px 16px; }
    & .svc-grid { grid-template-columns: 1fr; }
    & .svc-grid > .svc-card, & .svc-grid > .svc-card:nth-child(n+5) { grid-column: auto; }
    & .room-grid { grid-template-columns: 1fr; }
    & .loc-grid { grid-template-columns: 1fr; }
    & .loc-grid > .loc-card, & .loc-grid > .loc-card:nth-child(n+7) { grid-column: auto; }
    & .ins-grid { grid-template-columns: 1fr; }
  }
}

@media (prefers-reduced-motion: reduce) {
  .cst-home-page .reveal { opacity: 1; transform: none; transition: none; }
}
