/* ============================================================
   PRO Smart Business Structure Selector — Stylesheet

   All classes are namespaced with "ps-" prefix to avoid
   conflicts with any existing website CSS.

   HOW TO USE:
   Link this file in your <head>:
   <link rel="stylesheet" href="path/to/selector.css">

   Font paths: update the url() paths below if you move
   the /fonts/ folder to a different location.
   ============================================================ */

/* ---------- Fonts ---------- */
@font-face {
  font-family: Montserrat;
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/montserrat-latin.woff2") format("woff2");
}
@font-face {
  font-family: Outfit;
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/outfit-latin.woff2") format("woff2");
}

/* ---------- Section root & CSS variables ---------- */
.ps-selector {
  --ps-blue:   #10127d;
  --ps-navy:   #111c3b;
  --ps-muted:  #4e5d75;
  --ps-stroke: #dce4f1;
  --ps-tint:   #eef3ff;
  --ps-ease:   cubic-bezier(.2, .65, .28, 1);

  background: #f6f8fd;
  color: var(--ps-navy);
  font: 400 16px/1.5 Montserrat, Outfit, "Segoe UI", sans-serif;
  padding: clamp(45px, 5.2vw, 80px) max(22px, calc((100% - 1280px) / 2)) 38px;
  text-align: left;
}

/* Scoped box-sizing reset — won't affect anything outside .ps-selector */
.ps-selector *,
.ps-selector *::before,
.ps-selector *::after { box-sizing: border-box; }

/* Reset common elements inside the section */
.ps-selector :where(h2, h3, p, dl, dd) { margin: 0; }
.ps-selector svg { display: block; width: 22px; height: 22px; flex: none; }

/* ---------- Intro header ---------- */
.ps-intro {
  text-align: center;
  margin: 0 auto clamp(29px, 3.2vw, 46px);
}
.ps-intro .ps-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ps-blue);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .17em;
  text-transform: uppercase;
  margin-bottom: 15px;
}
.ps-eyebrow::before {
  content: "";
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}
.ps-selector :is(h2, h3, .ps-cta) { font-family: Outfit, Montserrat, sans-serif; }
.ps-intro h2 {
  font-size: clamp(38px, 5.05vw, 72px);
  line-height: 1.02;
  font-weight: 600;
  letter-spacing: -.047em;
  color: var(--ps-navy);
}
.ps-intro .ps-description {
  color: var(--ps-muted);
  font-size: clamp(16px, 1.5vw, 20px);
  margin: 17px auto 0;
}

/* ---------- Tab buttons ---------- */
.ps-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.ps-tabs button {
  appearance: none;
  display: flex;
  position: relative;
  align-items: center;
  gap: 13px;
  min-height: 86px;
  min-width: 0;
  padding: 13px 32px 13px 15px;
  border-radius: 15px;
  border: 1px solid var(--ps-stroke);
  background: #fff;
  color: var(--ps-navy);
  text-align: left;
  font: inherit;
  cursor: pointer;
  box-shadow: 0 2px 5px #15285708;
  transition: border-color .2s, background-color .2s, box-shadow .2s, transform .2s;
}
.ps-tabs button[aria-selected="true"] {
  background: var(--ps-blue);
  border-color: var(--ps-blue);
  color: #fff;
  box-shadow: 0 6px 15px #10127d36;
}
.ps-tabs button[aria-selected="true"] small { color: #edf0ff; }

@media (hover: hover) {
  .ps-tabs button:hover { transform: translateY(-3px); box-shadow: 0 8px 16px #15285724; }
  .ps-tabs button[aria-selected="false"]:hover { background: var(--ps-tint); border-color: #5870b4; }
  .ps-tabs button[aria-selected="true"]:hover  { background: #0b0d64; }
}

/* ---------- Tab & fact icons ---------- */
.ps-tab-icon,
.ps-fact-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  color: var(--ps-blue);
  background: #f0f3fc;
}
.ps-tabs button[aria-selected="true"] .ps-tab-icon { background: #fff; }

.ps-tab-copy strong,
.ps-tab-copy small  { display: block; }
.ps-tab-copy strong { font-size: 17px; font-weight: 600; line-height: 1.2; }
.ps-tab-copy small  { font-size: 13px; color: var(--ps-muted); margin-top: 4px; line-height: 1.25; }

/* ---------- Check indicator on active tab ---------- */
.ps-check {
  position: absolute;
  display: grid;
  place-items: center;
  right: 11px;
  top: 12px;
  border-radius: 50%;
  width: 17px;
  height: 17px;
  background: #fff;
  color: var(--ps-blue);
  opacity: 0;
  transform: scale(.75);
  transition: opacity .2s, transform .2s;
}
.ps-check svg { width: 12px; height: 12px; stroke-width: 2.5; }
.ps-tabs button[aria-selected="true"] .ps-check { opacity: 1; transform: scale(1); }

/* Focus ring (scoped to this section) */
.ps-selector :is(button, a):focus-visible { outline: 3px solid #4265bf; outline-offset: 3px; }

/* ---------- Content stage ---------- */
.ps-stage {
  display: grid;
  border: 1px solid #acb7dd;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 10px 28px #1528570c;
}
.ps-panel {
  grid-area: 1 / 1;
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1.72fr) minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  grid-template-areas:
    "summary photo"
    "facts   photo"
    "cta     photo";
  gap: 24px clamp(24px, 3vw, 48px);
  padding: clamp(23px, 3vw, 44px);
  pointer-events: none;
}
.ps-panel[data-visible] { z-index: 1; pointer-events: auto; }

.ps-panel > * {
  visibility: hidden;
  opacity: 0;
  transition: opacity .32s var(--ps-ease), visibility 0s .32s;
}
.ps-panel[data-visible] > * {
  visibility: visible;
  opacity: 1;
  transition-delay: .055s, 0s;
}
.ps-panel[data-visible] .ps-visual { transition-delay: 0s; }

/* ---------- Summary ---------- */
.ps-summary {
  grid-area: summary;
  border-left: 3px solid var(--ps-blue);
  padding-left: 16px;
  align-self: start;
}
.ps-summary h3 {
  font-size: clamp(29px, 3.25vw, 49px);
  letter-spacing: -.045em;
  line-height: 1.05;
  font-weight: 600;
}
.ps-summary p { margin-top: 8px; color: var(--ps-muted); font-size: clamp(15px, 1.35vw, 18px); }

/* ---------- Facts grid ---------- */
.ps-facts {
  grid-area: facts;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 25px;
  align-content: center;
}
.ps-fact {
  position: relative;
  display: grid;
  grid-template-columns: 35px minmax(0, 1fr);
  column-gap: 11px;
  grid-template-areas: "icon title" "icon copy";
  align-content: start;
  border-top: 1px solid #e4eaf4;
  padding-top: 13px;
}
.ps-fact-icon {
  position: absolute;
  top: 13px;
  left: 0;
  width: 35px;
  height: 35px;
  border-radius: 9px;
}
.ps-fact-icon svg { width: 19px; height: 19px; }
.ps-fact dt { grid-area: title; font-weight: 600; font-size: 16px; line-height: 1.3; }
.ps-fact dd { grid-area: copy;  color: var(--ps-muted); font-size: 14px; line-height: 1.48; margin-top: 4px; }

/* ---------- CTA button ---------- */
.ps-cta {
  grid-area: cta;
  align-self: end;
  justify-self: start;
  display: inline-flex;
  gap: 18px;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 11px 18px;
  border-radius: 10px;
  background: var(--ps-blue);
  color: white;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 4px 10px #10127d24;
  transition: opacity .32s var(--ps-ease), visibility 0s .32s, background-color .2s, box-shadow .2s;
}
.ps-cta svg { width: 18px; height: 18px; transition: transform .2s; }
.ps-cta:hover { background: #0b0d64; box-shadow: 0 7px 16px #10127d32; }
.ps-cta:hover svg { transform: translateX(4px); }

/* ---------- Photo ---------- */
.ps-visual {
  grid-area: photo;
  position: relative;
  min-width: 0;
  aspect-ratio: 4 / 5;
  align-self: center;
}
.ps-visual::after {
  content: "";
  position: absolute;
  pointer-events: none;
  bottom: -7px;
  right: -7px;
  width: 60px;
  height: 60px;
  border: solid #8ba2db;
  border-width: 0 2px 2px 0;
  border-bottom-right-radius: 20px;
}
.ps-visual picture {
  display: block;
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 15px;
  background: #e5ebf6;
}
.ps-visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.025);
  transition: transform .42s var(--ps-ease);
}
.ps-panel[data-visible] img { transform: scale(1); }
.ps-panel .ps-visual { transition: opacity 0s .32s, visibility 0s .32s; }
.ps-panel[data-visible] .ps-visual { transition: opacity .32s var(--ps-ease), visibility 0s; }
.ps-panel:first-child .ps-visual img { object-position: center top; }

/* ---------- Disclaimer ---------- */
.ps-disclaimer {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  max-width: 960px;
  color: var(--ps-muted);
  font-size: 13px;
  line-height: 1.5;
  margin: 18px auto 0;
}
.ps-disclaimer svg { width: 16px; height: 16px; margin-top: 2px; color: var(--ps-blue); }

/* ---------- Entrance animations ---------- */
.ps-enter .ps-eyebrow       { animation: ps-reveal .42s var(--ps-ease) both; }
.ps-enter h2                { animation: ps-rise .53s var(--ps-ease) both; }
.ps-enter .ps-description   { animation: ps-reveal .46s .10s var(--ps-ease) both; }
.ps-enter .ps-tabs button   { animation: ps-reveal .36s calc(.16s + var(--ps-order) * .07s) var(--ps-ease) both; }
.ps-enter .ps-stage         { animation: ps-reveal .5s .41s var(--ps-ease) both; }

@keyframes ps-reveal { from { opacity: 0; }              to { opacity: 1; } }
@keyframes ps-rise   { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Subgrid (progressive enhancement) ---------- */
@supports (grid-template-rows: subgrid) {
  .ps-stage {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto 1fr auto;
    row-gap: 24px;
    padding: clamp(23px, 3vw, 44px);
  }
  .ps-panel {
    grid-area: 1 / 1 / -1 / -1;
    grid-template-rows: subgrid;
    padding: 0;
  }
  @media (max-width: 700px) {
    .ps-stage { grid-template-rows: auto auto 1fr auto; row-gap: 20px; padding: 18px; }
  }
}

/* ---------- Responsive ---------- */
@media (min-width: 1051px) {
  .ps-stage  { grid-template-columns: minmax(0, 1fr); }
  .ps-panel  { grid-template-columns: minmax(0, 1.82fr) minmax(0, 1fr); }
  .ps-visual { width: 100%; max-height: 465px; }
}

@media (max-width: 1050px) {
  .ps-tabs              { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ps-tabs button       { min-height: 74px; }
  .ps-facts             { gap: 14px 17px; }
  .ps-fact              { grid-template-columns: 28px minmax(0, 1fr); column-gap: 7px; }
  .ps-fact-icon         { width: 28px; height: 28px; }
  .ps-fact-icon svg     { width: 17px; height: 17px; }
}

@media (max-width: 700px) {
  .ps-selector          { padding-inline: clamp(12px, 4vw, 22px); }
  .ps-desktop-break     { display: none; }
  .ps-tabs              { gap: 8px; margin-bottom: 13px; }
  .ps-tabs button       { gap: 7px; padding: 10px 15px 10px 9px; min-height: 68px; border-radius: 11px; }
  .ps-tab-copy strong   { font-size: 14px; overflow-wrap: anywhere; }
  .ps-tab-copy small    { font-size: 12px; }
  .ps-tab-icon          { height: 30px; width: 30px; border-radius: 8px; }
  .ps-tab-icon svg      { width: 18px; height: 18px; }
  .ps-check             { width: 13px; height: 13px; top: 5px; right: 5px; }
  .ps-check svg         { width: 9px; height: 9px; }
  .ps-stage             { border-radius: 17px; }
  .ps-panel {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto 1fr auto;
    grid-template-areas: "summary" "photo" "facts" "cta";
    gap: 20px;
    padding: 18px;
  }
  .ps-visual            { aspect-ratio: 4 / 3; }
  .ps-visual picture    { border-radius: 12px; }
  .ps-facts             { grid-template-columns: minmax(0, 1fr); }
  .ps-cta               { justify-self: stretch; }
}

/* Respect user's motion preference */
@media (prefers-reduced-motion: reduce) {
  .ps-selector *,
  .ps-selector *::before,
  .ps-selector *::after { animation: none !important; transition: none !important; }
  .ps-selector :is(button, .ps-cta svg, .ps-visual img) { transform: none !important; }
}
