/* Emailed-code sign-in page, step 1: the email and mobile number fields, messages and notices. */

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

.field {
  margin-top: 0.8rem;
}

.lede + .field {
  margin-top: 1.1rem;
}

.field label {
  display: block;
  margin-bottom: 0.375rem;
  font: 600 0.875rem/1.2 var(--font);
  color: var(--ink);
}

.label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.control {
  position: relative;
}

.field input {
  display: block;
  width: 100%;
  height: 3rem;
  padding: 0 2.9rem;
  border: 1px solid var(--field-line);
  border-radius: 0.625rem;
  background: #fff;
  color: var(--ink);
  font: 500 1rem/1.2 var(--font);
  caret-color: var(--brand);
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}

.field input::placeholder {
  color: #5a6a80;
  font-weight: 400;
  opacity: 1;
}

.field input:disabled {
  background: #f1f5f9;
}

.field input:hover:not(:disabled) {
  border-color: var(--field-line-hover);
}

.field input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand), 0 0 0 4px var(--brand-halo);
  outline: 2px solid transparent;
  outline-offset: 2px;
}

.field input:-webkit-autofill {
  -webkit-text-fill-color: var(--ink);
  caret-color: var(--ink);
  box-shadow: 0 0 0 100rem #fff inset;
}

.field input:-webkit-autofill:focus {
  box-shadow: 0 0 0 100rem #fff inset, 0 0 0 1px var(--brand), 0 0 0 4px var(--brand-halo);
}

.field-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  width: 1.2rem;
  height: 1.2rem;
  margin-top: -0.6rem;
  fill: none;
  stroke: #64748b;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
  transition: stroke 0.15s;
}

.field:focus-within .field-icon {
  stroke: var(--brand);
}

.field-msg {
  min-height: 1.2rem;
  margin: 0.25rem 0 0;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--danger);
}

.field.is-invalid input {
  border-color: var(--danger);
  box-shadow: 0 0 0 1px var(--danger), 0 0 0 4px rgba(180, 35, 24, 0.14);
}

.field.is-invalid input:-webkit-autofill,
.field.is-invalid input:-webkit-autofill:focus {
  box-shadow: 0 0 0 100rem #fff inset, 0 0 0 1px var(--danger), 0 0 0 4px rgba(180, 35, 24, 0.14);
}

.field.is-invalid .field-icon {
  stroke: var(--danger);
}

.count {
  font-size: 0.8125rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.count.is-full {
  color: var(--ok-text);
  font-weight: 600;
}

.eye {
  position: absolute;
  right: 0.375rem;
  top: 50%;
  width: 2.3rem;
  height: 2.3rem;
  margin-top: -1.15rem;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s, background-color 0.15s;
}

.eye:hover:not(:disabled) {
  color: var(--ink);
  background: #eef2f7;
}

.eye:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 0;
}

.eye svg {
  width: 1.2rem;
  height: 1.2rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.eye .eye-off,
.eye[aria-pressed='true'] .eye-on {
  display: none;
}

.eye[aria-pressed='true'] .eye-off {
  display: block;
}

.notice-slot {
  flex: none;
  min-height: 0.5rem;
}

/* When a message appears the card grows smoothly instead of jumping. */
@supports selector(:has(*)) {
  .notice-slot {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.3s var(--ease-out);
  }

  .notice-slot:has(.notice:not([hidden])) {
    grid-template-rows: 1fr;
  }

  .notice-clip {
    min-height: 0;
    overflow: hidden;
  }
}

.notice {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin: 0.25rem 0 0.6rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--danger-line);
  border-radius: 0.625rem;
  background: var(--danger-bg);
  color: var(--danger-text);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.45;
  animation: notice-in 0.3s var(--ease-out) both;
}

.notice[hidden] {
  display: none;
}

.notice svg {
  flex: none;
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.08rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.notice.is-info {
  border-color: #b7cff6;
  background: #eef4fe;
  color: #1b3a7a;
}

@keyframes notice-in {
  from { opacity: 0; transform: translate3d(0, 0.35rem, 0); }
  to { opacity: 1; transform: none; }
}

/* The small icon runs inline with the words, and the two lines are balanced so no single word is left alone on the second one. */
.help {
  margin: 0.9rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  text-align: center;
  text-wrap: balance;
  color: var(--muted);
}

.help svg {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  margin-right: 0.25rem;
  vertical-align: -0.2rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.noscript {
  margin: 1rem 0 0;
  padding: 0.7rem 0.85rem;
  border: 1px solid #f2cf8d;
  border-radius: 0.625rem;
  background: #fff8e8;
  color: #6b4200;
  font-size: 0.875rem;
  text-align: center;
}
