/* ════════
 * v4.17 — Plan grid normalization (2026-05-12)
 * Root cause: VPS Nano launch-pricing block (42px FREE text + progress
 * bar + redundant strikethrough) was ~130px taller than other plans.
 * CSS Grid align-items:stretch propagated this to row-mates (Starter,
 * Basic Lite, Basic featured, Standard Lite) → all 5 became 510-525px
 * while Group 2 (Standard..Business) stayed 383px → broken rhythm.
 *
 * Fix: compress Nano launch block to fit same envelope as Group 2.
 *      Add min-height to .plan for cross-row uniformity.
 *      All plan-tags and plan-tag-new use unified pill style.
 * ════════ */

/* ── 1. VPS Nano launch-pricing block: compact to match Group 2 ── */

/* Top floating chip: scale down slightly */
html body #planCardNano > div[data-sty*="top:-12px"]{
  font-size: 10px !important;
  padding: 4px 11px !important;
  inset-block-start: -10px !important;
}

/* Tag row inside Nano: tighter top/bottom rhythm */
html body #planCardNano > div[data-sty*="margin:8px 0 10px 0"]{
  margin: 4px 0 6px 0 !important;
}

/* Progress bar block: keep but shrink dramatically */
html body #planCardNano > div[data-sty*="margin:14px 0 8px 0"]{
  margin: 6px 0 !important;
}
html body #planCardNano > div[data-sty*="margin:14px 0 8px 0"] > div:first-child{
  font-size: 9.5px !important;
  margin-bottom: 3px !important;
  line-height: 1 !important;
}
html body #planCardNano > div[data-sty*="margin:14px 0 8px 0"] > div:last-child{
  height: 5px !important;
}

/* ── 2. Plan card uniform envelope (cross-row consistency) ── */

/* Desktop: enforce min-height so single-card rows (Custom VPS) also
   match the rest. 380px is the natural height of Group 2 cards. */
@media (min-width: 641px){
  html body .plans-grid > .plan,
  html body .plans-grid > .plan-card{
    min-height: 380px;
  }
  /* Custom VPS in its own row: fill the slot */
  html body .plans-grid > .it4-custom-plan{
    min-height: 380px;
  }
}

/* Mobile: cards are 2-col and naturally shorter; just ensure equal-
   height for tidy row pairs */
@media (max-width: 640px){
  html body .plans-grid > .plan,
  html body .plans-grid > .plan-card{
    min-height: 0; /* let grid stretch handle it */
  }
}

/* ── 3. Equal-height balance: push button to bottom in every card ── */

html body .plan,
html body .plan-card{
  display: flex !important;
  flex-direction: column !important;
}
html body .plan .plan-specs,
html body .plan-card .plan-specs{
  flex: 1 0 auto !important;
}
html body .plan .plan-btn,
html body .plan-card .plan-btn{
  margin-top: auto !important;
}

/* ── 4. Normalize all plan tags (.plan-tag-new, .plan-tag-hot) ── */
/* They were inconsistent — some had blue bg, some grey, some inline-style.
   Unify to single pill-chip aesthetic. */
html body .plan .plan-tag-new,
html body .plan .plan-tag-hot,
html body .plan-card .plan-tag-new,
html body .plan-card .plan-tag-hot{
  display: inline-flex;
  align-items: center;
  font-family: "IBM Plex Mono", monospace;
  font-size: 9.5px !important;
  font-weight: 700 !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase;
  padding: 3px 8px !important;
  border-radius: 999px !important;
  line-height: 1.2 !important;
  white-space: nowrap;
}
html body .plan .plan-tag-new{
  background: rgba(66,153,225,0.10) !important;
  color: #2563eb !important;
  border: 1px solid rgba(66,153,225,0.25) !important;
}
html body .plan .plan-tag-hot{
  background: rgba(239,68,68,0.10) !important;
  color: #ef4444 !important;
  border: 1px solid rgba(239,68,68,0.25) !important;
}

/* ── 5. plan-name + plan-desc rhythm ── */
html body .plan-name,
html body .plan-card .plan-name{
  font-size: 16px !important;
  line-height: 1.2 !important;
  font-weight: 700 !important;
  margin: 2px 0 4px !important;
  letter-spacing: -0.01em !important;
}
html body .plan-desc,
html body .plan-card .plan-desc{
  font-size: 11.5px !important;
  line-height: 1.4 !important;
  color: #64748b !important;
  margin: 0 0 8px !important;
  min-height: 32px; /* reserve 2-line slot so cards align even when desc varies */
}

/* ── 6. plan-price-wrap unified ── */
html body .plan-price-wrap{
  margin: 4px 0 8px !important;
  display: flex;
  align-items: baseline;
  gap: 4px;
}
html body .plan-price{
  font-size: 32px !important;
  line-height: 1 !important;
}
html body .plan-period{
  font-size: 11px !important;
  line-height: 1 !important;
}

/* ── 8. plan-divider: subtle ── */
html body .plan-divider{
  height: 1px !important;
  background: rgba(15,23,42,0.06) !important;
  margin: 6px 0 8px !important;
  border: none !important;
}

/* ── 9. plan-specs uniform spacing ── */
html body .plan-specs{
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
  margin: 0 0 10px !important;
}
html body .plan-specs .spec{
  font-size: 11.5px !important;
  line-height: 1.3 !important;
  padding: 4px 8px !important;
}

/* ── 10. Plan button uniform ── */
html body .plan-btn,
html body .plan .plan-btn,
html body .plan-card .plan-btn{
  margin-top: auto !important;
  padding: 9px 14px !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  border-radius: 9px !important;
  min-height: 38px !important;
  letter-spacing: 0.02em !important;
}

/* ── 11. MOBILE adjustments: tighter version of above ── */
@media (max-width: 640px){
  html body .plan-name{ font-size: 14px !important; margin: 2px 0 3px !important }
  html body .plan-desc{ font-size: 10.5px !important; min-height: 28px; margin: 0 0 6px !important }
  html body .plan-price{ font-size: 24px !important }
  html body .plan-period{ font-size: 10px !important }
  html body .plan-divider{ margin: 4px 0 6px !important }
  html body .plan-specs{ gap: 3px !important; margin: 0 0 8px !important }
  html body .plan-specs .spec{ font-size: 10.5px !important; padding: 3px 7px !important }
  html body .plan-btn{ padding: 8px 10px !important; font-size: 11.5px !important; min-height: 36px !important }
  /* Nano launch chip: even smaller on mobile */
  html body #planCardNano > div[data-sty*="top:-12px"]{
    font-size: 9px !important;
    padding: 3px 9px !important;
    inset-block-start: -8px !important;
  }
}

/* ── 12. Featured plan chip (.plan-chip): consistent position + tight ── */
html body .plan-chip{
  inset-block-start: -10px !important;
  padding: 4px 11px !important;
  font-size: 10px !important;
}
@media (max-width: 640px){
  html body .plan-chip{
    inset-block-start: -8px !important;
    padding: 3px 9px !important;
    font-size: 9px !important;
  }
}

/* ── 13. Custom VPS plan: match envelope but center its single CTA ── */
html body .it4-custom-plan{
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between;
}
html body .it4-custom-plan .plan-btn{
  margin-top: auto !important;
}

/* ── 14. Windows VPS plans: apply same rules (parallel grid) ── */
@media (min-width: 641px){
  html body #windows-vps .plans-grid > .plan,
  html body #windows-vps .plans-grid > .plan-card{
    min-height: 380px;
  }
}

/* ════════
 * v4.17b — Final card-height uniformity (2026-05-12)
 *
 * Strategy:
 *   1) Compress Nano further: single-line tags, hide progress bar on
 *      desktop, tighter top padding (chip overlaps card padding)
 *   2) Hard-enforce min-height on every .plan in the grid so the entire
 *      pricing table reads as ONE rhythm
 *   3) Apply same to Windows-VPS grid
 * ════════ */

/* ── 1. Nano: single-line tag row ── */
html body #planCardNano > div[data-sty*="display:flex"]:not(.plan-specs):not(.plan-price-wrap){
  flex-wrap: nowrap !important;
  margin: 4px 0 6px !important;
  overflow: hidden;
  gap: 4px !important;
}
html body #planCardNano .plan-tag-new,
html body #planCardNano .plan-tag-hot{
  font-size: 8.5px !important;
  padding: 2px 6px !important;
  white-space: nowrap;
}

/* ── 2. Nano: less top padding (chip floats above safely) ── */
html body #planCardNano{
  padding: 18px 14px 14px !important;
}
html body #planCardNano > div[data-sty*="top:-12px"]{
  inset-block-start: -9px !important;
}

/* ── 3. Nano: hide progress bar on desktop (keep on mobile) ── */
@media (min-width: 641px){
  html body #planCardNano > div[data-sty*="margin:14px 0 8px 0"]{
    display: none !important;
  }
}

/* ── 5. Featured plan chip: shrink top padding (chip needs less clearance) ── */
html body .plan.featured,
html body .plan:has(> .plan-chip){
  padding-top: 22px !important;
}
@media (max-width: 640px){
  html body .plan.featured,
  html body .plan:has(> .plan-chip){
    padding-top: 18px !important;
  }
}

/* ── 6. HARD-ENFORCE uniform card height across grid ── */
/* Use a CSS variable so it's easy to retune later */
:root{ --it4-plan-min-h: 390px }
@media (min-width: 641px){
  html body .plans-grid > .plan,
  html body .plans-grid > .plan-card,
  html body #windows-vps .plans-grid > .plan{
    min-height: var(--it4-plan-min-h) !important;
    height: var(--it4-plan-min-h);
  }
  /* Custom VPS matches */
  html body .plans-grid > .it4-custom-plan{
    min-height: var(--it4-plan-min-h) !important;
    height: var(--it4-plan-min-h);
  }
  /* Force grid to start-aligned items (no stretch) — each card uses its
     own height, but min-height ensures floor */
  html body #plans .plans-grid,
  html body #windows-vps .plans-grid{
    align-items: stretch;
  }
}

/* Mobile: looser height so 2-col grid breathes */
@media (max-width: 640px){
  :root{ --it4-plan-min-h: auto }
  html body .plans-grid > .plan,
  html body .plans-grid > .plan-card{
    min-height: 320px !important;
  }
}

/* ── 7. Make sure flex layout pushes button to bottom ── */
html body .plan,
html body .plan-card{
  display: flex !important;
  flex-direction: column !important;
}
html body .plan .plan-specs,
html body .plan-card .plan-specs{
  flex: 1 0 auto !important;
}
html body .plan .plan-btn,
html body .plan-card .plan-btn{
  margin-top: auto !important;
}

/* ── v4.17c: Custom VPS plan should NOT scale (only featured/popular pops) ── */
@media (min-width: 641px){
  html body .plans-grid > .it4-custom-plan,
  html body .plans-grid > .it4-custom-plan:has(> .plan-chip){
    transform: none !important;
    border: 1px solid rgba(15,23,42,0.08) !important;
    background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%) !important;
    box-shadow: 0 1px 3px rgba(15,23,42,0.04), 0 1px 2px rgba(15,23,42,0.02) !important;
  }
  html body .it4-custom-plan .plan-chip{
    /* Different visual — keep as a small build-to-order indicator, not popular */
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%) !important;
    inset-block-start: -10px !important;
  }
}

/* ── v4.17d: Mobile uniformity — force equal height per 2-col row ── */
@media (max-width: 640px){
  /* Set min-height that fits the tallest card (Nano with progress bar) */
  html body #plans .plans-grid > .plan,
  html body #plans .plans-grid > .plan-card,
  html body #plans .plans-grid > .it4-custom-plan{
    min-height: 360px !important;
    height: 100% !important;
    align-self: stretch !important;
  }
  /* Windows section has 4 plans with more content (RDP/Windows specs) */
  html body #windows-vps .plans-grid > .plan,
  html body #windows-vps .plans-grid > .plan-card{
    min-height: 420px !important;
    height: 100% !important;
  }
  /* Ensure grid track stretches */
  html body #plans .plans-grid,
  html body #windows-vps .plans-grid{
    grid-auto-rows: 1fr !important;
    align-items: stretch !important;
  }
}
