/* static/css/join.css — Sign-up page (/join)
 *
 * Deliberately matches the marketing site's /get-started page
 * (teloring.com/he/get-started) rather than inventing a look: a person clicking
 * "Join for free" over there and landing here should not feel a seam. The
 * tokens, the card geometry (24px radius, 3rem padding, hairline border, no
 * shadow), the button sizes and the Inter / Plus Jakarta Sans pairing are all
 * lifted from it.
 *
 * Everything is laid out with LOGICAL properties (inline-start/end,
 * text-align:start, margin-inline) so the page mirrors correctly in Hebrew with
 * no `[dir="rtl"]` overrides — a hard-coded `text-align:left` is what previously
 * left the Hebrew heading stranded on the wrong side.
 *
 * The one deliberate exception is the phone row, pinned LTR: a number is
 * dialled left-to-right in every language, so the country prefix stays on the
 * left of the digits even in Hebrew.
 */

.join-page {
  /* Local tokens, so this page is correct even though the console's own
     teloring.css doesn't define the marketing site's secondary text colour. */
  --join-text-secondary: #374444;
  --join-display: "Plus Jakarta Sans", "Arial Black", Arial, sans-serif;
  --join-body: "Inter", Arial, "Helvetica Neue", Helvetica, sans-serif;

  min-height: 100vh;
  display: flex;
  align-items: center;
  /* Tighter than the marketing page's 6rem: this card carries a form, and the
     whole point of the two-step split is that step 1 fits without scrolling. */
  padding: 48px 0;
  background: var(--color-bg);
  font-family: var(--join-body);
  color: var(--color-text);
}

.join-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  min-width: 0;
}

.join-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

/* ══════════════════════════════════════════════════════════
   Form card
   ══════════════════════════════════════════════════════════ */
.join-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 24px;
  padding: 40px;
  max-width: 520px;
  width: 100%;
}

.join-logo { margin-bottom: 20px; line-height: 0; }

.join-card h1 {
  font-family: var(--join-display);
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.5px;
  color: var(--color-dark);
  margin: 0 0 6px;
  text-align: start;
}

.join-subtitle {
  color: var(--join-text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0 0 22px;
  text-align: start;
}

/* ── Fields ── */
.join-form { text-align: start; }

.join-field { margin-bottom: 16px; }

.join-field label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 8px;
  text-align: start;
}

.join-field label .opt {
  font-weight: 400;
  color: var(--color-text-muted);
  margin-inline-start: 5px;
}

.join-input,
.join-select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  font-size: 0.9375rem;
  font-family: var(--join-body);
  color: var(--color-text);
  background: var(--color-white);
  transition: border-color 0.2s, box-shadow 0.2s;
  text-align: start;
}

.join-input::placeholder { color: var(--color-text-muted); }

.join-input:focus,
.join-select:focus {
  outline: none;
  border-color: var(--color-teal);
  box-shadow: 0 0 0 3px rgba(75, 191, 176, 0.12);
}

.join-input.field-error,
.join-select.field-error {
  border-color: var(--color-coral);
  box-shadow: 0 0 0 3px rgba(232, 82, 58, 0.1);
}

.join-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Phone: pinned left-to-right in every language — prefix, then digits. */
.join-phone {
  direction: ltr;
  display: grid;
  grid-template-columns: 156px minmax(0, 1fr);
  gap: 10px;
}

.join-phone .join-select,
.join-phone .join-input {
  direction: ltr;
  text-align: left;
}

/* ── Password rules ── */
.join-rules {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 10px 0 0;
  padding: 0;
}

.join-rules li {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  transition: color 0.2s;
}

.join-rules li::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  box-sizing: border-box;
  transition: all 0.2s;
}

.join-rules li.ok { color: var(--color-teal-dark); font-weight: 600; }

.join-rules li.ok::before {
  border-color: var(--color-teal);
  background: var(--color-teal)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center/9px no-repeat;
}

/* ── Optional-section label ── */
.join-section-label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 28px 0 20px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.join-section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

/* ══════════════════════════════════════════════════════════
   Two-step wizard
   ══════════════════════════════════════════════════════════
   Only the essentials are asked for up front; the optional business details
   come after. Splitting it keeps step 1 inside the viewport (no scrolling on
   the page a stranger judges the product by) and stops a long column of inputs
   reading as work.

   PROGRESSIVE ENHANCEMENT: the stepping is driven by `.is-wizard`, which the
   script adds on load. With JavaScript off, no class is added, every field is
   visible and the single submit button still works — a longer form, never a
   broken one. */

.join-progress {
  display: none;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}

.is-wizard .join-progress { display: flex; }

.join-progress-track {
  flex: 1;
  height: 4px;
  border-radius: 3px;
  background: var(--color-border);
  overflow: hidden;
}

.join-progress-fill {
  display: block;
  height: 100%;
  width: 50%;
  border-radius: 3px;
  background: var(--color-teal);
  transition: width 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

.join-progress-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Steps are only hidden once the wizard is active. */
.is-wizard .join-step[data-step-hidden] { display: none; }

.join-step-enter { animation: join-step-in 0.28s cubic-bezier(0.22, 0.8, 0.3, 1); }

@keyframes join-step-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* Next / Back exist only for the wizard — without JS they would be dead
   controls, so they stay hidden until the script switches it on. */
.join-next,
.join-back { display: none; }

.is-wizard .join-next,
.is-wizard .join-back { display: block; }

.join-back {
  width: 100%;
  margin-top: 10px;
  padding: 12px;
  border: 0;
  background: transparent;
  color: var(--color-text-muted);
  font-family: var(--join-body);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 10px;
}

.join-back:hover { background: var(--color-bg); color: var(--color-text); }

/* The final submit belongs to step 2 once stepping is on; without JS it is the
   form's only button and must stay visible. */
.is-wizard .join-step[data-step-hidden] .join-btn { display: none; }

.join-field-error {
  color: var(--color-coral);
  font-size: 0.8125rem;
  margin-top: 6px;
  min-height: 1em;
}

/* ── Anti-bot ── */
.join-turnstile { margin: 4px 0 20px; display: flex; justify-content: flex-start; }

/* Honeypot: positioned off-screen rather than display:none — a bot that skips
   hidden fields still fills this one. */
.join-hp {
  position: absolute;
  inset-inline-start: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

/* ── Buttons (marketing-site geometry) ── */
.join-btn {
  display: block;
  width: 100%;
  text-align: center;
  padding: 18px 36px;
  border-radius: 12px;
  font-family: var(--join-body);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  border: 2px solid transparent;
  text-decoration: none;
  transition: filter 0.2s, box-shadow 0.2s, background 0.2s, color 0.2s;
}

.join-btn-primary {
  background: var(--color-coral);
  color: var(--color-white);
  box-shadow: var(--shadow-sm);
}

.join-btn-primary:hover:not(:disabled) {
  filter: brightness(1.05);
  box-shadow: var(--shadow-glow-coral);
}

.join-btn-primary:disabled { opacity: 0.6; cursor: not-allowed; box-shadow: none; }

.join-btn-outline {
  background: transparent;
  color: var(--color-teal);
  border-color: var(--color-teal);
}

.join-btn-outline:hover { background: var(--color-teal); color: var(--color-white); }

.join-terms {
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--color-text-muted);
  text-align: center;
  margin: 16px 0 0;
}

.join-terms a { color: var(--color-teal); text-decoration: none; font-weight: 600; }
.join-terms a:hover { text-decoration: underline; }

/* ── Terms consent ──
   A real checkbox, not a styled div: it is what `required` hangs off, what a
   screen reader announces, and what the keyboard reaches. The whole row is the
   <label>, so the text is a hit target too. The anchors inside must open the
   document without also flipping the box — browsers skip label activation for
   interactive content, and join.html stops the click as well. */
.join-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 16px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-bg);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.join-consent:hover { border-color: var(--color-teal); }

.join-consent.field-error {
  border-color: var(--color-coral);
  box-shadow: 0 0 0 3px rgba(232, 82, 58, 0.1);
}

.join-consent input[type="checkbox"] {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--color-teal);
  cursor: pointer;
}

.join-consent:focus-within {
  border-color: var(--color-teal);
  box-shadow: 0 0 0 3px rgba(75, 191, 176, 0.12);
}

.join-consent-text {
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--color-text-muted);
}

.join-consent-text a {
  color: var(--color-teal);
  text-decoration: none;
  font-weight: 600;
}

.join-consent-text a:hover { text-decoration: underline; }

.join-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
  color: var(--color-text-muted);
  font-size: 0.8125rem;
}

.join-divider::before,
.join-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

.join-alert {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.875rem;
  line-height: 1.55;
  margin-bottom: 20px;
  text-align: start;
}

.join-alert-error {
  background: var(--color-coral-pale);
  color: #8f2d1c;
  border: 1px solid rgba(232, 82, 58, 0.25);
}

.join-alert-success {
  background: var(--color-teal-pale);
  color: var(--color-teal-dark);
  border: 1px solid rgba(75, 191, 176, 0.28);
}

/* ══════════════════════════════════════════════════════════
   Benefits column
   ══════════════════════════════════════════════════════════ */
.join-benefits { text-align: start; }

.join-benefits h2 {
  font-family: var(--join-display);
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -1px;
  color: var(--color-dark);
  margin: 0 0 12px;
}

.join-benefits > p {
  color: var(--join-text-secondary);
  font-size: 1.0625rem;
  line-height: 1.65;
  margin: 0 0 40px;
}

.join-benefit-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 48px;
}

.join-benefit {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.join-benefit-icon { flex-shrink: 0; margin-top: 2px; line-height: 0; }

.join-benefit strong {
  display: block;
  margin-bottom: 2px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-dark);
}

.join-benefit p {
  color: var(--join-text-secondary);
  font-size: 0.9375rem;
  line-height: 1.6;
  margin: 0;
}

.join-testimonial {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 28px;
}

.join-testimonial blockquote {
  font-size: 1rem;
  font-style: italic;
  line-height: 1.6;
  margin: 0 0 16px;
  color: var(--color-text);
}

.join-testimonial-author {
  display: flex;
  gap: 12px;
  align-items: center;
}

.join-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-coral);
  color: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.join-testimonial-author strong {
  display: block;
  font-size: 0.875rem;
  color: var(--color-dark);
}

.join-testimonial-author span {
  font-size: 0.8125rem;
  color: var(--join-text-secondary);
}

/* ══════════════════════════════════════════════════════════
   Responsive — benefits drop BELOW the form on mobile, so the
   thing someone came to do is the thing they see first.
   ══════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .join-page { padding: 48px 0; align-items: flex-start; }
  .join-grid { grid-template-columns: 1fr; gap: 40px; }
  .join-card { max-width: 100%; padding: 32px; }
  .join-benefits { order: 2; }
  .join-benefits h2 { font-size: 1.75rem; }
}

@media (max-width: 560px) {
  .join-container { padding: 0 16px; }
  .join-card { padding: 24px 20px; border-radius: 18px; }
  .join-row { grid-template-columns: 1fr; gap: 0; }
  .join-phone { grid-template-columns: 128px minmax(0, 1fr); }
}
