/* Builds on the tokens, fonts and reset already defined in welcome.css —
   this file only adds what the signup form needs. */

.signup-shell {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 28px 100px;
}

.signup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 26px 0 10px;
  flex-wrap: wrap;
  gap: 8px 16px;
}
.signup-header a { text-decoration: none; }
.back-link {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.back-link:hover { color: var(--accent); }

.signup-intro { padding: 26px 0 40px; }
.signup-intro .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
}
.signup-intro .eyebrow::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.signup-intro h1 {
  font-family: var(--font-ar);
  font-weight: 900;
  font-size: clamp(28px, 4vw, 40px);
  margin-top: 14px;
  text-wrap: balance;
}
.signup-intro p {
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.7;
  max-width: 56ch;
}

/* ---- step label ---- */
.step-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 800;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.step-label .n {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--accent-glow);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-num);
  font-size: 12px;
}

/* ---- plan picker ---- */
.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 44px;
}
.plan-card {
  position: relative;
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  background: var(--panel);
  padding: 20px 20px 18px;
  cursor: pointer;
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.plan-card:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.plan-card input {
  position: absolute;
  opacity: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.plan-card input:checked ~ .plan-card-body { }
.plan-card:has(input:checked) {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
  background: var(--panel-hover);
}
.plan-card:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.plan-card-check {
  position: absolute;
  top: 16px;
  /* Logical, not left: 16px — needs to sit on whichever side the plan
     name *doesn't* start from, so it never collides with the text. That
     happened to always be the left in Arabic (RTL text starts right), but
     a hardcoded left would sit under the text instead once it starts from
     the left too, in English. inset-inline-end always means "the far side
     from where text starts", in either direction. */
  inset-inline-end: 16px;
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  background: var(--panel-raised);
}
.plan-card:has(input:checked) .plan-card-check {
  border-color: var(--accent);
  background: var(--accent);
}
.plan-card:has(input:checked) .plan-card-check::after {
  content: "";
  display: block;
  width: 6px; height: 6px;
  margin: 5.5px auto 0;
  border-radius: 50%;
  background: var(--panel);
}
.plan-card-name-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 6px;
}
.plan-card-name { font-size: 15px; font-weight: 800; }
.plan-card-trial-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  color: var(--positive-text);
  background: var(--positive-bg);
  padding: 2px 8px;
  border-radius: 100px;
  white-space: nowrap;
}
.plan-card-price {
  font-family: var(--font-num);
  font-weight: 800;
  font-size: 22px;
}
.plan-card-price span {
  font-family: var(--font-ar);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-muted);
}
.plan-card-was-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 2px;
}
.plan-card-was {
  font-family: var(--font-num);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-faint);
  text-decoration: line-through;
  text-decoration-color: var(--danger);
  text-decoration-thickness: 1.5px;
}
.plan-card-discount-tag {
  font-size: 10px;
  font-weight: 800;
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 14%, transparent);
  padding: 2px 7px;
  border-radius: 100px;
}
.plan-card-discount-until {
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--text-faint);
  font-weight: 700;
}
.plan-card-yearly-savings {
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--positive-text);
  font-weight: 700;
}
/* Yearly price block starts hidden; only cards that actually have one
   (hasYearlyOption()) ever get shown, and only while that tab is picked —
   see the same pattern on the landing page's pricing section. */
.plan-card-price-yearly { display: none; }
form:has(#billing-yearly:checked) .plan-card:has(.plan-card-price-yearly) .plan-card-price-monthly { display: none; }
form:has(#billing-yearly:checked) .plan-card-price-yearly { display: block; }
.plan-card-meta {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.6;
}
.plan-card-badge {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 10.5px;
  font-weight: 800;
  color: var(--on-accent);
  background: linear-gradient(90deg, var(--accent-soft), var(--accent));
  padding: 4px 12px;
  border-radius: 100px;
  white-space: nowrap;
  box-shadow: 0 6px 16px -6px var(--accent-glow);
}
.plan-card:has(.plan-card-badge) { padding-top: 28px; }
.plan-card-count {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
}
.plan-card:has(input:checked) .plan-card-count { color: var(--accent); }
.plan-card-features {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.plan-card-features li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}
.plan-card-features li.is-unavailable { color: var(--text-faint); }
.plan-card-features .feature-icon {
  flex: none;
  width: 15px; height: 15px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.plan-card-features li.is-available .feature-icon { background: var(--positive-bg); color: var(--positive-text); }
.plan-card-features li.is-unavailable .feature-icon { background: var(--panel-hover); color: var(--text-faint); }

/* ---- form fields ---- */
.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field.full { grid-column: 1 / -1; }
.field label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
}
.field .required { color: var(--accent); }
.field input,
.field textarea {
  font-family: var(--font-ar);
  font-size: 15px;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 12px 14px;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.field input::placeholder,
.field textarea::placeholder { color: var(--text-faint); }
.field input:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.field textarea { resize: vertical; min-height: 90px; font-family: var(--font-ar); }
.field-error {
  font-size: 12.5px;
  color: var(--danger);
  font-weight: 700;
}
/* These spans/paragraphs are always in the DOM now (server-rendered errors
   and the live JS validation below both write into the same element) —
   collapse them out of the layout entirely while there's nothing to show. */
.field-error:empty { display: none; }

.field input.is-invalid,
.field .iti.is-invalid .iti__tel-input {
  border-color: var(--danger);
}
.field input.is-invalid:focus,
.field .iti.is-invalid .iti__tel-input:focus {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 18%, transparent);
}

.plan-error {
  font-size: 13px;
  color: var(--danger);
  font-weight: 700;
  margin: -28px 0 24px;
}
.plan-error:empty { display: none; margin: 0; }

/* ---- phone field (intl-tel-input) ----
   Wraps the plain-looking <input id="phone_input"> in a flag+dial-code
   picker at runtime (js/signup-validate.js). Re-themed here to match the
   site's own field styling instead of the library's default light skin —
   see public/vendor/intl-tel-input/. */
.field .iti { width: 100%; }
.field .iti__tel-input {
  width: 100%;
  font-family: var(--font-num);
}
/* The library themes the always-visible flag+dial-code button off its own
   --iti-country-selector-bg var (hardcoded to white upstream), which our
   dark palette never touches — left alone it's a white box sitting on the
   dark field in dark mode. Point it at the same panel color as the input
   it's attached to instead of hardcoding a background here directly, so
   light/dark/system all stay correct automatically. */
.iti { --iti-country-selector-bg: var(--panel-raised); }
.iti__country-selector { padding-inline-start: 4px; }
.iti__selected-country:hover,
.iti__selected-country:focus { background: var(--panel-hover); }
.iti__selected-country-primary { gap: 6px; }
.iti__selected-dial-code { color: var(--text-muted); font-family: var(--font-num); }
.iti__arrow { border-top-color: var(--text-faint); }
.iti__country-container {
  inset-inline-start: 0;
}
.iti__country-list {
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: var(--shadow-panel);
  margin-top: 6px;
}
.iti__country.iti__highlight,
.iti__country:hover { background: var(--panel-hover); }
.iti__country-name { color: var(--text); }
.iti__dial-code { color: var(--text-faint); }
.iti__search-input-wrapper { background: var(--panel); border-bottom: 1px solid var(--border); }
.iti__search-input {
  background: var(--panel-raised);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.iti__divider { border-bottom-color: var(--border); }

/* Button reflects the live validation state — a distinctly flat/neutral
   look (not just a fainter version of the same orange, which barely read
   as "off") while the required fields + terms box aren't all filled in
   yet. Deliberately a CSS class, not the disabled="" attribute — a truly
   disabled button can't receive a click at all, which is exactly what
   should still happen here: js/signup-validate.js's submit handler needs
   that click to show the visitor what's still missing. */
.submit-btn.is-blocked {
  background: var(--panel-hover);
  color: var(--text-faint);
  cursor: not-allowed;
}
.submit-btn.is-blocked:hover {
  transform: none;
  box-shadow: none;
}

.agree-row { margin: 26px 0 4px; }
.agree-check {
  display: inline-flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  line-height: 1.7;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
}
.agree-check input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.agree-box {
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border: 1.5px solid var(--border-strong);
  border-radius: 6px;
  background: var(--panel);
  position: relative;
  transition: background .15s ease, border-color .15s ease;
}
.agree-check input:checked + .agree-box {
  background: linear-gradient(90deg, var(--accent-soft), var(--accent));
  border-color: var(--accent);
}
.agree-check input:checked + .agree-box::after {
  content: "";
  position: absolute;
  inset-inline-start: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid var(--on-accent);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.agree-check input:focus-visible + .agree-box {
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.agree-check a {
  color: var(--accent);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.agree-check a:hover { color: var(--accent-soft); }

.submit-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.submit-btn {
  font-family: var(--font-ar);
  font-weight: 800;
  font-size: 15.5px;
  color: var(--on-accent);
  background: linear-gradient(90deg, var(--accent-soft), var(--accent));
  border: none;
  border-radius: 12px;
  padding: 14px 32px;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.submit-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 24px -12px var(--accent-glow); }
.submit-note {
  font-size: 12.5px;
  color: var(--text-faint);
  font-weight: 700;
}

/* ---- thanks page ---- */
.thanks-panel {
  max-width: 560px;
  margin: 90px auto;
  text-align: center;
  padding: 0 28px;
}
.thanks-icon {
  width: 64px; height: 64px;
  margin: 0 auto 24px;
  border-radius: 50%;
  background: var(--positive-bg);
  color: var(--positive-text);
  display: flex; align-items: center; justify-content: center;
}
.thanks-panel h1 {
  font-family: var(--font-ar);
  font-weight: 900;
  font-size: 28px;
}
.thanks-panel p {
  margin-top: 14px;
  color: var(--text-muted);
  font-size: 15.5px;
  line-height: 1.7;
}
.thanks-panel a {
  display: inline-block;
  margin-top: 28px;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
}

@media (max-width: 640px) {
  .field-grid { grid-template-columns: 1fr; }
  .field { grid-column: 1 / -1; }
}
