/* The open beta sign-up (beta-signup.js) and the Start free dialog that carries it. The form is
   always on navy: at the foot of the page and in the dialog. */

/* ---- fields ---------------------------------------------------------------------------------------- */

.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 0.86rem; font-weight: 500; color: var(--on-dark); }
.field.is-wide { grid-column: 1 / -1; }
.field-hint { font-size: 0.82rem; color: var(--on-dark-3); }

.field input,
.field select {
  min-height: 48px;
  padding: 11px 14px;
  font: inherit;
  font-size: 1rem;
  color: var(--paper);
  background: var(--ink-2);
  border: 1px solid #2c4460;
  border-radius: 8px;
  transition: border-color 120ms ease;
}
.field select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--on-dark-3) 50%), linear-gradient(135deg, var(--on-dark-3) 50%, transparent 50%);
  background-position: calc(100% - 20px) 54%, calc(100% - 15px) 54%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
.field input:hover, .field select:hover { border-color: var(--blue); }
.field input:focus, .field select:focus { outline: 2px solid var(--teal); outline-offset: 1px; border-color: var(--teal); }
.field input.invalid, .field select.invalid { border-color: #ff8f7a; }
.field-error { font-size: 0.84rem; color: #ff8f7a; }
.field-error[hidden] { display: none; }

.trap { position: absolute; left: -6000px; top: -6000px; }

.form-foot {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.form-foot > .btn, .form-foot > .beta-actions { margin-left: auto; }
.form-status { font-size: 0.88rem; color: var(--on-dark-2); min-height: 1.4em; }
.form-status.error { color: #ff8f7a; }

/* ---- the steps ----------------------------------------------------------------------------------------- */

.beta { min-width: 0; align-self: start; }
.beta-loading { color: var(--on-dark-3); font-size: 0.93rem; }
.beta-step { display: grid; gap: 18px; align-content: start; min-width: 0; }
.beta-step[hidden] { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .beta-step:not([hidden]) { animation: beta-in 240ms var(--settle); }
}
@keyframes beta-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.beta-progress { font-size: 0.86rem; font-weight: 500; color: var(--teal); margin-bottom: -10px; }
.beta-title { font-size: 1.3rem; line-height: 1.2; letter-spacing: -0.02em; color: var(--paper); }
.beta-title:focus { outline: none; }
.beta-title:focus-visible { outline: 2px solid var(--teal); outline-offset: 4px; }
.beta-copy { color: var(--on-dark-2); max-width: 34em; overflow-wrap: anywhere; }
.beta-copy strong { color: var(--paper); font-weight: 560; }
.beta-aside { font-size: 0.88rem; color: var(--on-dark-3); }

.beta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 18px; }
.beta-grid .is-wide { grid-column: 1 / -1; }

.turnstile-holder:empty { display: none; }

.password-rules {
  list-style: none;
  margin: 2px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--on-dark-3);
}
.password-rules li { position: relative; padding-left: 20px; }
.password-rules li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.45em;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: 1.5px solid var(--on-dark-3);
}
.password-rules li.is-met { color: var(--on-dark); }
.password-rules li.is-met::before { border-color: var(--teal); background: var(--teal); }

.check {
  position: relative;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 0.9rem;
  color: var(--on-dark);
  cursor: pointer;
}
.check input {
  flex: none;
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: var(--teal);
  cursor: pointer;
}
.check input.invalid { outline: 2px solid #ff8f7a; outline-offset: 2px; }
.check input:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.check a { color: var(--paper); text-underline-offset: 3px; }
.beta-consent .field-error { margin-top: 6px; padding-left: 32px; }

.link-btn {
  padding: 0;
  font: inherit;
  color: var(--paper);
  background: none;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.link-btn:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

.beta-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.beta-done { justify-items: start; }
.beta-waiting { display: flex; align-items: center; gap: 10px; }
.beta-spinner {
  display: none;
  flex: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(0, 191, 179, 0.25);
  border-top-color: var(--teal);
  animation: beta-spin 0.9s linear infinite;
}
.beta-done.is-waiting .beta-spinner { display: inline-block; }
.beta-wait-note { font-size: 0.9rem; }
@keyframes beta-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .beta-spinner { animation-duration: 2.4s; }
}

.beta a:focus-visible, .beta .btn:focus-visible { outline-color: var(--teal); }

/* ---- the Start free dialog -------------------------------------------------------------------------------- */

html.has-dialog { overflow: hidden; }

.start-dialog {
  margin: auto;
  width: min(560px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100dvh - 48px);
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: var(--ink);
  color: var(--mist);
  overflow: auto;
  overscroll-behavior: contain;
  box-shadow: 0 0 0 1px rgba(159, 182, 206, 0.16), 0 40px 120px -30px rgba(0, 0, 0, 0.7);
}
.start-dialog::backdrop { background: rgba(10, 20, 32, 0.62); }
.start-dialog-inner { padding: 24px 28px 32px; }

.start-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 20px;
  margin-bottom: 24px;
  border-bottom: 1px solid rgba(159, 182, 206, 0.18);
}
.start-dialog-title { color: var(--paper); font-size: 1.3rem; line-height: 1.2; letter-spacing: -0.025em; padding-top: 8px; }
.start-dialog-title:focus { outline: none; }
.start-dialog-risk { margin-top: 6px; color: var(--on-dark-3); font-size: 0.88rem; line-height: 1.45; }
.start-dialog.is-closed-beta .start-dialog-head > div { display: none; }
.start-dialog.is-closed-beta .start-dialog-head { justify-content: flex-end; padding-bottom: 0; margin-bottom: 0; border: 0; }

.start-dialog-close {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: -2px -10px 0 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--on-dark-2);
  cursor: pointer;
}
.start-dialog-close:hover { background: rgba(159, 182, 206, 0.14); color: var(--paper); }
.start-dialog-close:focus-visible { outline: 2px solid var(--teal); outline-offset: 0; }

@media (prefers-reduced-motion: no-preference) {
  .start-dialog[open] { animation: dialog-in 220ms var(--settle); }
  .start-dialog[open]::backdrop { animation: backdrop-in 220ms ease; }
}
@keyframes dialog-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes backdrop-in { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 640px) {
  .beta-grid { grid-template-columns: 1fr; }
  .form-foot > .btn, .form-foot .beta-actions, .form-foot .beta-actions .btn { width: 100%; margin-left: 0; }

  /* a sheet from the bottom of the screen */
  .start-dialog {
    width: 100%;
    max-height: 92dvh;
    margin: auto 0 0;
    border-radius: 20px 20px 0 0;
  }
  .start-dialog-inner { padding: 18px var(--gutter) calc(28px + env(safe-area-inset-bottom)); }
  @media (prefers-reduced-motion: no-preference) {
    .start-dialog[open] { animation: sheet-in 260ms var(--settle); }
  }
}
@keyframes sheet-in { from { transform: translateY(40px); opacity: 0.4; } to { transform: none; opacity: 1; } }

/* Turnstile's widget is never narrower than 300 px, so the narrowest phones give the form the full width */
@media (max-width: 340px) {
  .register { padding-inline: 0; }
  .register-panel { border-radius: 0; padding: 28px 10px; }
  .register-head { padding-inline: 6px; }
  .start-dialog-inner { padding-inline: 10px; }
}
