/* ===========================================================================
   Transact modal — shared partial
   ---------------------------------------------------------------------------
   The homepage and /partners/ get these rules from styles/home.css. The
   category pages (/metal/, /plastic/, /electronics/) run a different design
   system, so loading all of home.css there would collide with their own
   base/components layers. This file carries ONLY the .flow-* modal rules,
   extracted from home.css so the modal looks identical everywhere.

   Self-contained on purpose: no var(--ease) and no html[data-view] hooks,
   because those are defined by the home system's tokens and its JS view
   resolver. Literal values and a plain media query stand in.
   =========================================================================== */

.flow-modal[hidden] { display: none; }
.flow-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  padding: 22px;
}
.flow-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 4, 4, .78);
  backdrop-filter: blur(15px);
  animation: flowModalFade .28s ease both;
}
.flow-modal-panel {
  position: relative;
  width: min(468px, 100%);
  max-height: calc(100vh - 44px);
  overflow: auto;
  padding: 40px 36px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 28px;
  background: #fff;
  color: #111;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .45);
  animation: flowModalRise .42s cubic-bezier(.22, 1, .36, 1) both;
  outline: none;
}
.flow-modal-close {
  position: absolute;
  right: 19px;
  top: 19px;
  width: 44px;
  height: 44px;
  border: 1px solid #d3d3cd;
  border-radius: 50%;
  background: #fff;
  font-size: 27px;
  line-height: 1;
  cursor: pointer;
}
.flow-modal-eyebrow,
.flow-modal-panel h2,
.flow-modal-intro { text-align: center; }
.flow-modal-eyebrow {
  margin: 0 0 12px;
  color: #007554;
  font: 600 12px/1 "Kode Mono", monospace;
  letter-spacing: .14em;
}
.flow-modal-panel h2 {
  margin: 0;
  font: 500 34px/1.05 "Bricolage Grotesque", sans-serif;
  letter-spacing: -.05em;
}
.flow-modal-intro {
  max-width: 320px;
  margin: 14px auto 30px;
  color: #6b6b65;
}

/* ---------- form ---------- */
.flow-form { display: grid; grid-template-columns: 1fr; gap: 18px; }
.flow-form label { display: flex; flex-direction: column; gap: 8px; font-size: 12px; font-weight: 650; }
.flow-form label .flow-opt { color: #92928c; font-weight: 400; }
.flow-form .flow-label { font-size: 12px; font-weight: 650; color: #111; }
.flow-form .flow-req { color: #e5484d; font-weight: 700; margin-left: 1px; }
.flow-form input,
.flow-form select {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  border: 1px solid #cecec8;
  border-radius: 10px;
  background: #fff;
  color: #111;
  outline: none;
}
.flow-form input:focus,
.flow-form select:focus { border-color: #007554; box-shadow: 0 0 0 3px rgba(0, 117, 84, .12); }
.flow-form [aria-invalid="true"] { border-color: #c93640; }
.flow-form .flow-phone { display: flex; gap: 8px; }
.flow-form .flow-phone-cc {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  height: 50px;
  padding: 0 14px;
  border: 1px solid #cecec8;
  border-radius: 10px;
  background: #f2f2ee;
  font-weight: 600;
  color: #111;
}
.flow-form .flow-phone input { flex: 1; min-width: 0; }
.flow-role { border: 0; margin: 0; padding: 0; min-width: 0; }
.flow-role .flow-label { display: block; margin-bottom: 8px; }
.flow-role-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.flow-form .flow-role-option {
  position: relative;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0;
  height: 50px;
  border: 1px solid #cecec8;
  border-radius: 10px;
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.flow-form .flow-role-option input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.flow-form .flow-role-option:has(input:checked) { border-color: #050505; background: #050505; color: #fff; }
.flow-form .flow-role-option:has(input:focus-visible) { box-shadow: 0 0 0 3px rgba(0, 117, 84, .18); }
.flow-form-error { grid-column: 1 / -1; min-height: 18px; margin: 0; color: #b7222d; font-size: 12px; }
.flow-form-submit {
  grid-column: 1 / -1;
  height: 52px;
  border: 0;
  border-radius: 999px;
  background: #050505;
  color: #fff;
  cursor: pointer;
}
.flow-form-submit span { margin-left: 14px; }

/* ---------- success state ---------- */
.flow-modal-success { text-align: center; padding: 80px 20px; }
.flow-modal-success > span {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: 0 auto 22px;
  border-radius: 50%;
  background: #007554;
  color: #fff;
  font-size: 28px;
}
.flow-modal-success > p:first-of-type {
  font: 600 12px/1 "Kode Mono", monospace;
  color: #007554;
  letter-spacing: .12em;
}
.flow-modal-success > p:last-of-type { color: #6b6b65; }
.flow-modal-success button {
  min-width: 170px;
  height: 48px;
  margin-top: 22px;
  border: 0;
  border-radius: 99px;
  background: #050505;
  color: #fff;
  cursor: pointer;
}

body.modal-open { overflow: hidden; }

@keyframes flowModalFade { from { opacity: 0; } }
@keyframes flowModalRise { from { opacity: 0; transform: translateY(26px) scale(.975); } }

/* Full-screen sheet on phones — home.css keys this off html[data-view="mobile"];
   the category pages have no view resolver, so it keys off width instead. */
@media (max-width: 640px) {
  .flow-modal { padding: 0; }
  .flow-modal-panel {
    width: 100%;
    height: 100%;
    max-height: none;
    border-radius: 0;
    padding: 72px 22px 28px;
  }
  .flow-modal-panel h2 { font-size: 30px; }
  .flow-form { grid-template-columns: 1fr; }
  .flow-form-error,
  .flow-form-submit { grid-column: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .flow-modal-backdrop,
  .flow-modal-panel { animation: none; }
}
