/* PW Studio front page UI */

.pw-hero{
  padding-top: clamp(2.75rem, 5vw, 5.35rem);
  padding-bottom: clamp(2.75rem, 5vw, 5.35rem);
}
.pw-hero h1{ letter-spacing: -0.02em; }

.pw-box{
  margin-top: 1.6rem;
  max-width: 1120px;
  padding-inline: clamp(0.4rem, 2.5vw, 0.85rem);
}

/* Main box */
.pw-searchbox{
  background: #fff;
  border: 1px solid rgba(32,33,36,0.18);
  border-radius: 999px;
  padding: 0.9rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  box-shadow: 0 1px 2px rgba(60,64,67,0.12);
  flex-wrap: nowrap;
}
.pw-searchbox:hover{ box-shadow: 0 3px 12px rgba(60,64,67,0.12); }
.pw-searchbox:focus-within{
  border-color: rgba(26,115,232,0.45);
  box-shadow: 0 1px 2px rgba(60,64,67,0.12), 0 0 0 4px rgba(26,115,232,0.12);
}

.pw-searchbox__input{
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  color: #202124;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  letter-spacing: 0.03em;
  text-align: center;
  font-size: 1.75rem;
  line-height: 1.15;
  padding: 0.7rem 0.25rem;
}
.pw-searchbox__input::placeholder{
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Arial, sans-serif;
  letter-spacing: 0;
  font-size: 1.05rem;
  color: rgba(95,99,104,0.75);
}

/* Left icon buttons */
.pw-leftbtn{
  border: 0;
  background: transparent;
  border-radius: 999px;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: 0 0 auto;
  color: rgba(95,99,104,0.92);
}
.pw-leftbtn:hover{ background: rgba(32,33,36,0.06); }
.pw-leftbtn svg{ width: 18px; height: 18px; display:block; }

/* Strength lock color */
#pw-strength[data-level="0"]{ color: #d93025; }
#pw-strength[data-level="1"]{ color: #ea8600; }
#pw-strength[data-level="2"]{ color: #fbbc05; }
#pw-strength[data-level="3"]{ color: #34a853; }

/* Filters popover */
.pw-filters{ position: relative; }
.pw-popover{
  position: absolute;
  left: 0;
  top: calc(100% + 10px);
  width: 250px;
  border-radius: 16px;
  border: 1px solid rgba(32,33,36,0.14);
  background: rgba(255,255,255,0.98);
  box-shadow: 0 10px 30px rgba(60,64,67,0.12);
  padding: 0.85rem 0.85rem;
  z-index: 50;
  display: none;
}
.pw-popover.is-open{ display: block; }
.pw-popover h4{ margin: 0 0 0.55rem 0; font-size: 0.95rem; color: #202124; }
.pw-check{
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.2rem;
  color: rgba(32,33,36,0.92);
  font-size: 0.95rem;
}
.pw-check input{ width: 18px; height: 18px; }
.pw-popover .pw-mini{ margin-top: 0.5rem; font-size: 0.88rem; color: rgba(95,99,104,0.78); }

/* Actions */
.pw-actions{
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex: 0 0 auto;
}

.pw-iconbtn{
  border: 0;
  background: transparent;
  border-radius: 999px;
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(95,99,104,0.92);
  cursor: pointer;
}
.pw-iconbtn:hover{ background: rgba(32,33,36,0.06); }
.pw-iconbtn:disabled{ opacity: 0.35; cursor: default; }
.pw-iconbtn svg{ width: 20px; height: 20px; display:block; }

/* Generate (runner border) */
.pw-genbtn{
  position: relative;
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: 0.75rem 1.1rem;
  font-weight: 650;
  color: #202124;
  cursor: pointer;
  height: 48px;
  min-width: 132px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.pw-genbtn__label{ position: relative; z-index: 3; }
.pw-genbtn__icon{
  display: none;
  position: relative;
  z-index: 3;
  align-items:center;
  justify-content:center;
}
.pw-genbtn__icon svg{ width: 20px; height: 20px; display:block; }

.pw-genbtn__fill{
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: rgba(255,255,255,0.96);
  z-index: 1;
}

/* Nice click animation */
.pw-genbtn.is-clicked{ animation: pwclick 560ms cubic-bezier(.2,.8,.2,1); }
@keyframes pwclick{
  0%{ transform: translateY(0) scale(1); filter: none; }
  30%{ transform: translateY(-1px) scale(1.03); filter: drop-shadow(0 8px 18px rgba(26,115,232,0.10)); }
  100%{ transform: translateY(0) scale(1); filter: none; }
}

/* Border SVG */
.pw-ring{
  position: absolute;
  inset: -1px;
  width: calc(100% + 2px);
  height: calc(100% + 2px);
  z-index: 2;
  pointer-events: none;
}
.pw-ring rect{ fill: none; vector-effect: non-scaling-stroke; }
.pw-ring .pw-base{ stroke: rgba(26,115,232,0.16); stroke-width: 2; }
.pw-ring .pw-anim{
  stroke: url(#pwGrad);
  stroke-width: 2.7;
  stroke-linecap: round;
  stroke-dasharray: 14 284;
  animation: pwdash 4.2s cubic-bezier(.4,0,.2,1) infinite;
  filter: drop-shadow(0 0 2px rgba(26,115,232,0.14));
  opacity: 0.95;
}
@keyframes pwdash{ to { stroke-dashoffset: -298; } }

.pw-subhint{
  margin-top: 0.75rem;
  font-size: 0.92rem;
  color: rgba(95,99,104,0.72);
}

/* Services grid */
.pw-services{
  margin-top: 1.2rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}
.pw-svc{
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.95rem 1rem;
  border: 1px solid rgba(32,33,36,0.14);
  background: rgba(246,248,251,0.72);
  border-radius: 18px;
  transition: 180ms ease;
  cursor: pointer;
  user-select: none;
}
.pw-svc:hover{ transform: translateY(-1px); box-shadow: 0 10px 24px rgba(60,64,67,0.10); }
.pw-svc:focus-visible{ outline: 3px solid rgba(26,115,232,0.25); outline-offset: 2px; }

.pw-svc__left{ display: flex; align-items: center; gap: 0.75rem; min-width: 0; padding-right: 44px; }
.pw-svc__logo{
  width: 28px; height: 28px; border-radius: 8px;
  border: 1px solid rgba(32,33,36,0.10); background: #fff;
  flex: 0 0 auto;
}
.pw-svc__name{ font-weight: 750; color: #202124; font-size: 1rem; line-height: 1.2; }
.pw-svc__req{ font-size: 0.92rem; color: rgba(95,99,104,0.92); line-height: 1.25; }

.pw-svc__right{
  position: relative;
  width: 34px; height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(32,33,36,0.12);
  background: rgba(255,255,255,0.72);
  flex: 0 0 auto;
  overflow: hidden;
}

/* Status icons centered */
.pw-status svg{
  position: absolute;
  inset: 0;
  margin: auto;
  width: 18px;
  height: 18px;
  opacity: 0;
}
.pw-status .check path{
  stroke: #188038;
  stroke-width: 2.6;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
}
.pw-svc.is-pass .pw-status .check{ opacity: 1; }
.pw-svc.is-pass .pw-status .check path{ animation: draw 520ms ease forwards; }
@keyframes draw{ to { stroke-dashoffset: 0; } }

.pw-status .cross line{
  stroke: #d93025;
  stroke-width: 2.6;
  stroke-linecap: round;
}
.pw-svc.is-fail .pw-status .cross{ opacity: 1; animation: fadein 220ms ease forwards; }
@keyframes fadein{ to{ opacity: 1; } }

/* Hover CTA (bottom-left, stays inside, never overlaps status) */
.pw-svc__cta{
  position: absolute;
  left: 0.9rem;
  bottom: 0.85rem;
  padding: 0.26rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(32,33,36,0.14);
  background: rgba(255,255,255,0.92);
  color: rgba(32,33,36,0.88);
  font-size: 0.84rem;
  opacity: 0;
  transform: translateY(2px);
  transition: 160ms ease;
  pointer-events: none;
}
.pw-svc:hover .pw-svc__cta{ opacity: 1; transform: translateY(0); }

/* Analysis panel */
.pw-analysis{
  margin-top: 1.1rem;
  display: none;
  border: 1px solid rgba(32,33,36,0.14);
  background: rgba(246,248,251,0.72);
  border-radius: 18px;
  padding: 1rem 1rem;
}
.pw-analysis.is-visible{ display: block; }

.pw-analysis__grid{
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 0.9rem;
}
.pw-analysis h3{
  margin: 0 0 0.35rem 0;
  font-size: 1.05rem;
  color: #202124;
}
.pw-analysis p, .pw-analysis li{
  color: rgba(95,99,104,0.95);
  margin: 0.25rem 0;
  font-size: 0.95rem;
}
.pw-analysis ul{ margin: 0.35rem 0 0 1.15rem; }

.pw-pill{
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(32,33,36,0.14);
  background: rgba(255,255,255,0.8);
  font-size: 0.9rem;
  color: rgba(32,33,36,0.9);
}
.pw-math li strong{ color:#202124; }

/* Mobile */
@media (max-width: 720px){
  .pw-searchbox{
    padding: 0.7rem 0.75rem;
    gap: 0.35rem;
  }
  .pw-searchbox__input{
    font-size: 1.22rem;
    padding: 0.55rem 0.2rem;
    text-align: left;
  }
  .pw-leftbtn{ width: 40px; height: 40px; }
  .pw-iconbtn{ width: 44px; height: 44px; }
  .pw-genbtn{ min-width: 48px; width: 48px; padding: 0; }
  .pw-genbtn__label{ display: none; }
  .pw-genbtn__icon{ display: inline-flex; } /* ensure visible */
  .pw-services{ grid-template-columns: 1fr; }
  .pw-svc__cta{ display:none; }
  .pw-analysis__grid{ grid-template-columns: 1fr; }
  .pw-popover{ left: -40px; width: 260px; }
}

@media (max-width: 420px){
  #pw-copy{ display:none; }
}
