/* =========================================================================
   ROOF TYPE CARDS — FINAL AUTHORITATIVE STYLING
   Restores: clean rounded image on top + a separate YELLOW label box
   (yellow background, yellow outline, blue text) below. No divider lines.
   Works on desktop, tablet, mobile.
   Loaded LAST so it overrides the "images only / no labels" experiment.
   ========================================================================= */

/* Grid: 3 across on desktop, responsive down */
#stepRoofType .roof-type-grid,
.roof-type-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 22px !important;
  align-items: stretch !important;
  max-width: 980px !important;
  margin: 0 auto !important;
}

/* Card: ONE yellow outline around the whole thing. Image fills top,
   label box fills bottom, sharing the single frame — no doubled lines. */
#stepRoofType .roof-type-card,
.roof-type-card {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  width: 100% !important;
  max-width: 100% !important;
  padding: 0 !important;
  gap: 0 !important;
  background:#D01A28 !important;           /* YELLOW default (match frame, no gap) */
  border:3px solid #D01A28 !important;     /* single YELLOW outline by default */
  border-radius: 16px !important;
  overflow: hidden !important;              /* clip image + label to the frame */
  cursor: pointer !important;
  box-shadow:0 8px 20px rgba(6,36,83, .12) !important;
  position: relative !important;
}

/* kill any pseudo-element overlays from older fixes */
#stepRoofType .roof-type-card::before,
#stepRoofType .roof-type-card::after,
.roof-type-card::before,
.roof-type-card::after {
  display: none !important;
  content: none !important;
}

/* Image: fills the top, flush to the frame, NO border/line of its own */
#stepRoofType .roof-type-card img,
.roof-type-card img {
  display: block !important;
  width: 100% !important;
  height: 200px !important;
  aspect-ratio: auto !important;
  object-fit: cover !important;
  object-position: center center !important;
  margin: 0 !important;
  border:0 !important;
  border-radius: 0 !important;
  outline:0 !important;
  background:#f5f5f5 !important;
  filter: none !important;
  box-shadow:none !important;
}

/* LABEL: box at the bottom inside the same frame — NO border of its own */
#stepRoofType .roof-type-label,
#stepRoofType .roof-type-card span,
.roof-type-card .roof-type-label {
  display: flex !important;
  visibility: visible !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  min-height: 56px !important;
  height: auto !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 12px 10px !important;
  box-sizing: border-box !important;
  background:#D01A28 !important;          /* YELLOW background by default */
  color:#ffffff !important;               /* WHITE text by default */
  border:0 !important;                    /* no extra line — frame is the card's */
  border-radius: 0 !important;
  font-family: Impact, Haettenschweiler, 'Arial Narrow Bold', 'Oswald', sans-serif !important;
  font-weight: 900 !important;
  letter-spacing: .04em !important;
  text-transform: uppercase !important;
  text-align: center !important;
  line-height: 1.05 !important;
  font-size: clamp(1rem, 1.6vw, 1.45rem) !important;
  overflow: visible !important;
  white-space: normal !important;
  overflow-wrap: normal !important;
  word-break: normal !important;
}

/* Selected/pressed: STAY yellow, just add a blue outer border around the box */
#stepRoofType .roof-type-card.selected,
.roof-type-card.selected {
  border-color:#0B2A5B !important;        /* blue outer border when selected */
  background:#D01A28 !important;          /* stays yellow */
  outline:0 !important;
  box-shadow:0 0 0 3px #0B2A5B !important; /* crisp blue outer ring */
}
#stepRoofType .roof-type-card.selected img,
.roof-type-card.selected img {
  outline:0 !important;
  border:0 !important;
}
#stepRoofType .roof-type-card.selected .roof-type-label,
.roof-type-card.selected .roof-type-label {
  background:#D01A28 !important;          /* label stays yellow */
  color:#ffffff !important;               /* white text stays */
  border:0 !important;
}

/* ---------- TABLET ---------- */
@media (max-width: 900px) {
  #stepRoofType .roof-type-grid,
  .roof-type-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    max-width: 720px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    justify-items: center !important;
  }
  #stepRoofType .roof-type-card img,
  .roof-type-card img {
    height: 180px !important;
  }
}

/* ---------- MOBILE ---------- */
@media (max-width: 560px) {
  #stepRoofType .roof-type-grid,
  .roof-type-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
    max-width: 420px !important;     /* keep cards a comfortable width */
    margin-left: auto !important;
    margin-right: auto !important;
    justify-items: center !important;
  }
  #stepRoofType .roof-type-card,
  .roof-type-card {
    width: 100% !important;
    max-width: 380px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
  #stepRoofType .roof-type-card img,
  .roof-type-card img {
    height: 200px !important;
  }
  #stepRoofType .roof-type-label,
  .roof-type-card .roof-type-label {
    min-height: 52px !important;
    font-size: 1.2rem !important;
  }
}

/* ============================================================
   Address step: every field gets the same outlined box.
   Email and the spam check were falling through to the base
   `border:0; background:#f4f4f4` rule, so they rendered as
   bare text next to the outlined Name / Phone / Address.
   ============================================================ */
#stepAddress .field-row input,
#stepAddress .search-row input{
  border:2px solid rgba(11,42,91,.30) !important;
  background:#ffffff !important;
  color:#0B2A5B !important;
  min-height:58px !important;
  border-radius:6px !important;
  box-sizing:border-box !important;
}
#stepAddress .field-row input::placeholder,
#stepAddress .search-row input::placeholder{
  color:#7C89A0 !important;
  opacity:1 !important;
}
#stepAddress .field-row input:focus,
#stepAddress .search-row input:focus{
  border-color:#0B2A5B !important;
  outline:3px solid rgba(208,26,40,.28) !important;
  outline-offset:0 !important;
}
/* the spam question is a long placeholder — give it room */
#stepAddress #roofSpamCheck{grid-column:span 2 !important;}

/* Roof type card labels: white on red (was navy on red — too low contrast).
   Selected card flips to navy so the state still reads. */
#stepRoofType .roof-type-label,
.roof-type-card .roof-type-label{
  background:#D01A28 !important;
  color:#FFFFFF !important;
  -webkit-text-fill-color:#FFFFFF !important;
}
#stepRoofType .roof-type-card.selected .roof-type-label,
.roof-type-card.selected .roof-type-label{
  background:#0B2A5B !important;
  color:#FFFFFF !important;
  -webkit-text-fill-color:#FFFFFF !important;
}
