/* Sign in, sign up and device linking — the same world as the landing page.
 *
 * The artboard centres a single card on the dark ground with the hero's glow
 * behind it, so these pages reuse the landing tokens rather than introducing
 * a second visual language for the half of the product that needs a form.
 */

.sheet-wrap {
  position: relative;
  min-height: calc(100dvh - 76px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 20px 80px;
}

.sheet {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  padding: 40px;
  border-radius: 22px;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, .08);
  box-shadow: 0 40px 90px rgba(0, 0, 0, .5);
  animation: edPop .6s var(--ease) both;
}

.sheet h1 { margin: 0 0 8px; font-size: 30px; font-weight: 600; letter-spacing: -.9px; line-height: 1.1; }
.sheet .sub { margin: 0 0 30px; font-size: 15px; line-height: 1.55; color: var(--text-3); }
.sheet code {
  font-family: var(--mono);
  font-size: 13.5px;
  color: var(--text);
  background: var(--sunk);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 2px 7px;
}

form { display: flex; flex-direction: column; gap: 14px; }

.field { display: flex; flex-direction: column; gap: 7px; }
.label { font-size: 11px; letter-spacing: 1.1px; text-transform: uppercase; color: var(--text-3); font-weight: 500; }

.input {
  height: 52px;
  width: 100%;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, .1);
  padding: 0 16px;
  font-size: 15px;
  color: var(--text);
  font-family: var(--font);
  outline: none;
  transition: border-color .16s ease;
}
.input::placeholder { color: var(--text-4); }
.input:focus { border-color: var(--accent); }

.code-input {
  font-family: var(--mono);
  font-size: 20px;
  letter-spacing: 4px;
  text-align: center;
}

.pw-shell {
  height: 52px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, .1);
  display: flex;
  align-items: center;
  padding: 0 8px 0 16px;
  transition: border-color .16s ease;
}
.pw-shell:focus-within { border-color: var(--accent); }
.pw-shell input {
  flex: 1; min-width: 0;
  border: none; outline: none; background: transparent;
  font-size: 15px; color: var(--text); font-family: var(--font);
}
.pw-shell button {
  width: 34px; height: 34px;
  border: none; border-radius: 10px; background: transparent;
  color: var(--accent); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform .13s var(--ease);
}
.pw-shell button:active { transform: scale(.86); }

.full { width: 100%; justify-content: center; }

.note { font-size: 13px; line-height: 1.45; min-height: 18px; color: var(--text-4); }
.note.bad {
  color: var(--danger-text);
  background: rgba(192, 86, 59, .14);
  border: 1px solid rgba(192, 86, 59, .4);
  border-radius: 12px;
  padding: 10px 12px;
}
.note.good { color: var(--accent); }

.fine { margin: 22px 0 0; font-size: 12.5px; line-height: 1.6; color: var(--text-5); text-align: center; }

.alt { margin: 24px 0 0; text-align: center; font-size: 14px; color: var(--text-3); }
.alt a { font-weight: 600; }

.rule { display: flex; align-items: center; gap: 14px; margin: 22px 0; }
.rule::before, .rule::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.rule span { font-size: 12px; color: var(--text-3); }

.provider {
  height: 50px; width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .11);
  background: transparent;
  color: var(--text);
  font-family: var(--font); font-size: 15px; font-weight: 500;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  cursor: pointer;
  transition: transform .13s var(--ease), background .16s ease;
}
.provider:hover { background: rgba(255, 255, 255, .05); }
.provider:active { transform: scale(.97); }

.spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(24, 12, 6, .28); border-top-color: var(--ink);
  animation: edSpin .7s linear infinite;
}
@keyframes edSpin { to { transform: rotate(360deg); } }

.done {
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  animation: edFade .3s var(--ease) both;
}
.done .tick {
  width: 60px; height: 60px; border-radius: 19px;
  background: var(--accent); color: var(--ink);
  display: flex; align-items: center; justify-content: center;
}
.done h2 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -.5px; }
.done p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--text-3); }

@media (max-width: 560px) {
  .sheet { padding: 30px 24px; border-radius: 18px; }
  .sheet h1 { font-size: 26px; }
}

/* ------------------------------------------------- OAuth consent + linking */

.scopes { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 10px; }
.scopes li {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 14px 15px;
  border: 1px solid var(--line); border-radius: 14px;
  background: rgba(255, 255, 255, .02);
  font-size: 14.5px; line-height: 1.5; color: var(--text-2);
}
.scopes li::before {
  content: ""; flex: none;
  width: 7px; height: 7px; margin-top: 7px; border-radius: 50%;
  background: var(--accent);
}
.consent-actions { margin-top: 22px; display: grid; gap: 10px; }

/* iOS Safari zooms the whole page when a focused input's text is under 16px.
   The design's 15px is kept on desktop, where that behaviour does not exist;
   phones get exactly 16px so focusing a field no longer jerks the layout.
   16px is the threshold, not a preference — 15.5px still zooms. */
@media (max-width: 760px) {
  .input,
  .pw-shell input {
    font-size: 16px;
  }
  .code-input {
    font-size: 19px;      /* already above the threshold; just fits better */
    letter-spacing: 3px;
  }
  .sheet {
    padding: 26px 20px;
    border-radius: 20px;
  }
  /* Keep the card clear of the notch and the home indicator. */
  .sheet-wrap {
    padding-top: calc(28px + env(safe-area-inset-top));
    padding-bottom: calc(28px + env(safe-area-inset-bottom));
  }
}
