/* ==========================================================
   Handy People • Signup (Premium)
   File: styles/signup.css
   - Keeps your HTML + JS intact
   - Adds: premium card, depth, glow, better hierarchy, micro UX
   ========================================================== */

:root{
  --hp:#10b981;
  --hp2:#06b6d4;
  --ink:#0b1220;
  --muted:#64748b;
  --line: rgba(15,23,42,.12);

  --bg:#ffffff;
  --soft:#f7f8fc;

  --shadow: 0 26px 70px rgba(2,6,23,.12);
  --shadow2: 0 12px 30px rgba(2,6,23,.10);

  --r:20px;
  --r2:26px;

  --safeTop: env(safe-area-inset-top, 0px);
  --safeBottom: env(safe-area-inset-bottom, 0px);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }

html{
  -webkit-text-size-adjust: 100%;
}

/* ✅ Use a stable viewport height on iOS Safari */
.hp-auth{
  min-height: 100dvh;                 /* modern iOS */
  min-height: calc(var(--vh, 1vh) * 100);  /* fallback driven by JS below */
}


body{
  margin:0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
}

a{ color: inherit; text-decoration: none; }
a:hover{ text-decoration: underline; text-underline-offset: 3px; }

/* =========================
   BACKGROUND (premium mesh)
========================= */
.hp-auth{
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: calc(96px + var(--safeTop)) 24px calc(92px + var(--safeBottom));
  position: relative;
  isolation: isolate;
  background:
    radial-gradient(900px 520px at 8% 18%, rgba(16,185,129,.12), transparent 60%),
    radial-gradient(820px 480px at 92% 20%, rgba(99,102,241,.10), transparent 62%),
    radial-gradient(680px 420px at 55% 92%, rgba(6,182,212,.10), transparent 62%),
    linear-gradient(180deg, #ffffff 0%, #fbfcff 55%, #ffffff 100%);
}

.hp-auth::before{
  content:"";
  position:absolute;
  inset:-120px;
  background:
    radial-gradient(600px 300px at 30% 25%, rgba(16,185,129,.10), transparent 60%),
    radial-gradient(520px 280px at 70% 35%, rgba(6,182,212,.08), transparent 60%),
    radial-gradient(520px 280px at 55% 70%, rgba(99,102,241,.06), transparent 60%);
  filter: blur(18px);
  z-index:-1;
  opacity: .9;
}

/* =========================
   SHELL
========================= */
.hp-shell{
  position: relative;
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 26px;
  align-items: start;
}

/* Keep form first */
.hp-brand{ order: 2; }
#signupForm, #codeSection{ order: 1; }

/* Both form containers occupy same grid cell */
#signupForm, #codeSection{
  grid-column: 1;
  grid-row: 1;
  width: 100%;
}

/* =========================
   FORM CARD (this is the big upgrade)
========================= */
.form-container{
  width: 100%;
  max-width: 640px;
  padding: 22px;
  border-radius: var(--r2);
  border: 1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.82);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.form-container::before{
  content:"";
  position:absolute;
  inset:-2px;
  background:
    radial-gradient(520px 220px at 18% 10%, rgba(16,185,129,.18), transparent 55%),
    radial-gradient(520px 220px at 92% 22%, rgba(6,182,212,.14), transparent 58%),
    radial-gradient(520px 220px at 60% 92%, rgba(99,102,241,.10), transparent 60%);
  opacity: .55;
  filter: blur(10px);
  z-index: 0;
  pointer-events: none;
}

.form-container > *{ position: relative; z-index: 1; }

.hp-card-head{
  margin-bottom: 16px;
}

.form-container h2{
  margin: 0;
  font-size: clamp(34px, 3vw, 46px);
  letter-spacing: -0.035em;
  line-height: 1.03;
}

.hp-sub{
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
  max-width: 56ch;
}

/* Inputs */
.form-container input[type="tel"],
.form-container input[type="text"],
.form-container input[type="email"],
#codeInputs input.digit{
  width: 100%;
  height: 54px;
  padding: 0 14px;
  border-radius: 16px;
  border: 1px solid rgba(15,23,42,.12);
  background: rgba(255,255,255,.92);
  outline: none;
  font-size: 16px; /* ✅ was 15px — iOS zoom trigger */
  transition: box-shadow .15s ease, border-color .15s ease, transform .08s ease;
}

.form-container input:focus,
#codeInputs input.digit:focus{
  border-color: rgba(16,185,129,.55);
  box-shadow: 0 0 0 4px rgba(16,185,129,.14);
}

.form-container input:active{ transform: scale(.997); }

/* Consent row */
.hp-consent{
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 14px 0 14px;
  color: rgba(11,18,32,.86);
  font-size: 13px;
  line-height: 1.45;
}

.hp-consent input{ margin-top: 3px; }

.hp-consent a{
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Primary button (premium gradient pill) */
.form-container button{
  width: 100%;
  height: 54px;
  border: 0;
  border-radius: 999px;
  font-weight: 900;
  font-size: 15px;
  cursor: pointer;
  color: #fff;

  background:
    linear-gradient(135deg, rgba(17,24,39,1) 0%,
                          rgba(17,24,39,1) 35%,
                          rgba(16,185,129,.92) 100%);
  box-shadow: 0 14px 34px rgba(2,6,23,.16);
  transition: transform .07s ease, filter .15s ease, opacity .15s ease, box-shadow .15s ease;
}

.form-container button:hover{
  filter: brightness(1.03);
  box-shadow: 0 18px 46px rgba(2,6,23,.18);
}
.form-container button:active{ transform: translateY(1px); }
.form-container button:disabled{ opacity: .45; cursor: not-allowed; box-shadow: none; }

/* Secondary link row */
.switch-auth{
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.switch-auth a{
  color: #2563eb;
  text-decoration: none;
  font-weight: 900;
}

.switch-auth a:hover{ text-decoration: underline; }

/* Code inputs */
#codeInputs{
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin: 14px 0 10px;
}

#codeInputs input.digit{
  text-align: center;
  padding: 0;
  font-size: 18px;
  border-radius: 16px;
}

/* Help row */
.help-row{
  margin-top: 12px !important;
  color: rgba(11,18,32,.78) !important;
  font-size: 13px;
}

/* Link-style buttons */
button.link-btn{
  background: transparent;
  border: 0;
  padding: 0;
  font: inherit;
  color: #2563eb;
  cursor: pointer;
  font-weight: 800;
}
button.link-btn:hover{
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* =========================
   RIGHT BRAND PANEL (bring it back + make it feel expensive)
========================= */
.hp-brand{
  border-radius: var(--r2);
  border: 1px solid rgba(15,23,42,.10);
  background:
    radial-gradient(520px 320px at 22% 18%, rgba(16,185,129,.24), transparent 60%),
    radial-gradient(520px 320px at 84% 28%, rgba(6,182,212,.16), transparent 62%),
    radial-gradient(520px 320px at 58% 92%, rgba(99,102,241,.10), transparent 62%),
    linear-gradient(180deg, #ffffff 0%, var(--soft) 100%);
  box-shadow: var(--shadow2);
  padding: clamp(18px, 2.6vw, 30px);
  position: relative;
  overflow: hidden;
  min-height: 380px;
}

.hp-brand::after{
  content:"";
  position:absolute;
  inset:-2px;
  background:
    radial-gradient(580px 240px at 30% 10%, rgba(255,255,255,.75), transparent 60%),
    radial-gradient(560px 260px at 85% 20%, rgba(255,255,255,.55), transparent 60%);
  opacity: .65;
  pointer-events:none;
}

.hp-logo{
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
}

.hp-mark{
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 950;
  background: rgba(16,185,129,.16);
  border: 1px solid rgba(16,185,129,.22);
  color: rgba(6,95,70,.95);
  box-shadow: 0 10px 22px rgba(2,6,23,.10);
}

.hp-brand h1{
  margin: 10px 0 10px;
  font-size: 22px;
  letter-spacing: -0.02em;
  line-height: 1.15;
  position: relative;
  z-index: 1;
}

.hp-brand p{
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  max-width: 46ch;
  position: relative;
  z-index: 1;
}

/* bullets */
.hp-bullets{
  margin-top: 18px;
  display: grid;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.hp-pill{
  display:flex;
  gap: 12px;
  align-items:flex-start;
  padding: 12px 12px;
  border-radius: 16px;
  border: 1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.72);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.hp-ico{
  width: 38px;
  height: 38px;
  border-radius: 14px;
  display:grid;
  place-items:center;
  background: rgba(16,185,129,.14);
  border: 1px solid rgba(16,185,129,.18);
  font-size: 18px;
}

.hp-pill b{
  display:block;
  font-size: 14px;
  letter-spacing: -0.01em;
}

.hp-pill span{
  display:block;
  margin-top: 2px;
  color: rgba(11,18,32,.68);
  font-size: 13px;
  line-height: 1.35;
}

/* =========================
   Floating Back Chevron (your same behavior, nicer)
========================= */
.floatingBack{
  position: fixed;
  top: calc(18px + var(--safeTop));
  left: max(14px, calc(50% - 590px));
  z-index: 9999;

  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;

  color: #0b1220;
  text-decoration: none;

  background: rgba(255,255,255,.78);
  border: 1px solid rgba(15,23,42,.10);
  border-radius: 14px;
  box-shadow: 0 12px 26px rgba(2,6,23,.12);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);

  transition: transform .12s ease, opacity .12s ease;
}

.floatingBack:hover{ opacity: .92; }
.floatingBack:active{ transform: scale(.98); }

.floatingBack:focus{
  outline: 2px solid rgba(14,165,233,.55);
  outline-offset: 3px;
}

.floatingBack .chev{
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
  transform: translateX(-1px);
}

@media (max-width: 640px){
  .floatingBack{
    top: calc(12px + var(--safeTop));
    left: 12px;
  }
}

/* =========================
   Toast (you already have this id)
========================= */
#toast{
  position: fixed;
  bottom: calc(16px + var(--safeBottom));
  left: 50%;
  transform: translateX(-50%);
  background: rgba(17,24,39,.92);
  color: #fff;
  padding: 10px 14px;
  border-radius: 999px;
  opacity: 0;
  transition: opacity .2s;
  pointer-events: none;
  z-index: 10000;
  max-width: calc(100vw - 24px);
  text-align: center;
  box-shadow: 0 14px 32px rgba(2,6,23,.22);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
#toast.show{ opacity: 1; }

/* =========================
   SMS Modal (same ids)
========================= */
#smsPolicyModal{
  position: fixed;
  inset: 0;
  background: rgba(2,6,23,.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  padding: 18px;
}
#smsPolicyModal.open{ display:flex; }

#smsPolicyModal > div{
  width: min(560px, 100%);
  border-radius: 18px;
  border: 1px solid rgba(15,23,42,.12);
  background: rgba(255,255,255,.90);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  padding: 20px;
}


/* Helps iOS keep focused inputs in view without crazy jumps */
body{
  overflow-x: hidden;
  overscroll-behavior-y: none;
}

.form-container{
  scroll-margin-top: 24px;
}

#codeInputs input.digit{
  transform: translateZ(0); /* reduces iOS repaint jitter */
}


/* =========================
   Responsive
========================= */
@media (max-width: 900px){
  .hp-auth{
    padding: calc(72px + var(--safeTop)) 18px calc(76px + var(--safeBottom));
  }

  .hp-shell{
    grid-template-columns: 1fr;
    width: min(620px, 100%);
    gap: 16px;
  }

  .hp-brand{ display:none; }

  .form-container{
    max-width: 620px;
    padding: 18px;
    border-radius: 22px;
  }

  .form-container h2{
    font-size: clamp(30px, 7vw, 40px);
  }
}

@media (max-width: 420px){
  #codeInputs{ gap: 8px; }
  #codeInputs input.digit{
    height: 50px;
    font-size: 17px;
  }
}
