/* ============================================================
   AMSKU sign-in layout (templates/auth.html) — log in, invite
   sign-up, the code page and the first-time profile step.
   Loaded after style.css (its tokens), instead of portal.css.
   Phones: the form on its own under a slim logo bar.
   Wide screens: a navy brand panel on the left, the form on the right.
   ============================================================ */

.auth-body {
  background: #fff;
}
.auth {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
}

/* ---------- brand panel (wide screens only) ---------- */
.auth-brand {
  display: none;
}
@media (min-width: 900px) {
  .auth {
    grid-template-columns: minmax(360px, 5fr) minmax(0, 6fr);
  }
  .auth-brand {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 40px;
    padding: 40px clamp(36px, 4vw, 64px);
    color: #fff;
    background:
      radial-gradient(900px 520px at -10% -15%, rgba(59, 143, 224, 0.38), transparent 60%),
      radial-gradient(700px 480px at 115% 115%, rgba(11, 92, 173, 0.55), transparent 60%),
      linear-gradient(160deg, #0f2340 0%, #0c2b55 55%, #0b3a70 100%);
  }
}
.auth-brand > * {
  position: relative;
  z-index: 1;
}
.auth-brand-logo {
  align-self: flex-start;
  display: inline-flex;
  padding: 8px 14px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 6px 20px -8px rgba(0, 0, 0, 0.45);
}
.auth-brand-logo img {
  display: block;
  height: 34px;
  width: auto;
}
.auth-brand-copy {
  max-width: 460px;
}
.auth-brand-eyebrow {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #8fc0f2;
}
.auth-brand-title {
  margin: 0 0 14px;
  font-size: clamp(28px, 2.7vw, 40px);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.025em;
  color: #fff;
}
.auth-brand-sub {
  margin: 0 0 28px;
  font-size: 16px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.78);
}
.auth-brand-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
  line-height: 1.45;
}
.auth-brand-points li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 15px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.92);
}
.auth-tick {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-top: -1px;
  border-radius: 50%;
  background: rgba(143, 192, 242, 0.18);
  color: #8fc0f2;
}
.auth-tick .icon {
  width: 13px;
  height: 13px;
  vertical-align: 0;
}
.auth-brand-foot {
  margin: 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
}
/* The ultrasound fan drawn faintly behind the copy. */
.auth-brand-art {
  position: absolute;
  z-index: 0;
  right: -90px;
  bottom: -70px;
  width: 460px;
  height: 460px;
  color: rgba(143, 192, 242, 0.14);
  pointer-events: none;
}

/* ---------- form column ---------- */
.auth-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;
}
.auth-top {
  display: flex;
  align-items: center;
  padding: 14px 20px;
  padding-top: max(14px, env(safe-area-inset-top));
  border-bottom: 1px solid var(--line-2);
}
.auth-top img {
  display: block;
  height: 32px;
  width: auto;
}
@media (min-width: 900px) {
  .auth-top {
    display: none; /* the logo is on the brand panel */
  }
}
.auth-center {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 36px 20px 40px;
}
@media (min-width: 600px) {
  .auth-center {
    align-items: center;
    padding: 56px 32px;
  }
}
.auth-panel {
  width: 100%;
  max-width: 400px;
}
.auth-panel-wide {
  max-width: 560px;
}
.auth-main .site-footer {
  margin-top: 0;
  padding: 18px 20px;
  padding-bottom: max(22px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line-2);
  font-size: 12.5px;
}

/* ---------- heading block ---------- */
.auth-badge {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 20px;
  border-radius: 14px;
  background: var(--blue-tint);
  color: var(--primary);
}
.auth-badge .icon {
  width: 24px;
  height: 24px;
  vertical-align: 0;
}
.auth-badge-warn {
  background: var(--amber-tint);
  color: var(--amber);
}
.auth-eyebrow {
  margin: 0 0 8px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
}
.auth-title {
  margin: 0 0 8px;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--dark);
}
@media (min-width: 600px) {
  .auth-title {
    font-size: 30px;
  }
}
.auth-lead {
  margin: 0 0 28px;
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--text-mid);
}
.auth-lead strong {
  color: var(--text);
  font-weight: 600;
  word-break: break-word;
}
.auth-note {
  margin: -12px 0 28px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-mid);
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  border-radius: 10px;
}

/* ---------- alert ---------- */
.auth-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 20px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  color: #9b1c1c;
  background: var(--red-tint);
  border: 1px solid #f6c7c7;
  border-radius: 10px;
}
.auth-alert .icon {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  vertical-align: 0;
}

/* ---------- fields ---------- */
.auth-form {
  margin: 0;
}
.auth-field {
  margin: 0 0 18px;
}
.auth-field label {
  display: block;
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.auth-optional {
  font-weight: 400;
  color: var(--muted);
}
.auth-field input,
.auth-field textarea {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  font-family: inherit;
  font-size: 16px; /* 16px or more: iPhones don't zoom in on focus */
  line-height: 1.4;
  color: var(--text);
  background: #fff;
  border: 1px solid #cdd6e1;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.auth-field textarea {
  min-height: 112px;
  resize: vertical;
}
.auth-field input::placeholder,
.auth-field textarea::placeholder {
  color: #9aa6b5;
}
.auth-field input:hover,
.auth-field textarea:hover {
  border-color: #b4c0ce;
}
.auth-field input:focus,
.auth-field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(11, 92, 173, 0.15);
}
/* A personal invite's address: shown, not editable. */
.auth-field input[readonly] {
  color: var(--text);
  background: #f3f6fa;
  cursor: default;
}
.auth-field input[aria-invalid="true"] {
  border-color: var(--danger);
}
.auth-field input[aria-invalid="true"]:focus {
  box-shadow: 0 0 0 4px rgba(196, 30, 30, 0.14);
}
.auth-hint {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}
/* The 6-digit code: big, spaced, centered digits. */
.auth-field .auth-code {
  min-height: 60px;
  padding-left: calc(14px + 0.45em);
  font-family: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 0.45em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.auth-field .auth-code::placeholder {
  color: #cdd6e1;
}
@media (min-width: 560px) {
  .auth-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 16px;
  }
}

/* ---------- button ---------- */
.auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  margin: 6px 0 0;
  padding: 12px 20px;
  font-family: inherit;
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  color: #fff;
  background: var(--primary);
  border: 0;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08), inset 0 -1px 0 rgba(0, 0, 0, 0.12);
  cursor: pointer;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}
.auth-btn:hover {
  color: #fff;
  background: var(--primary-dark);
  transform: none;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08), inset 0 -1px 0 rgba(0, 0, 0, 0.12);
}
.auth-btn:active {
  background: #083f78;
}
.auth-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(11, 92, 173, 0.3);
}
/* Sending: a spinner, and no second click (see the script in auth.html). */
.auth-btn[aria-busy="true"] {
  cursor: progress;
  background: var(--primary-dark);
}
.auth-btn[aria-busy="true"]::before {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: auth-spin 0.7s linear infinite;
}
@keyframes auth-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .auth-btn[aria-busy="true"]::before {
    animation-duration: 2s;
  }
}

/* ---------- small print and links ---------- */
.auth-fine {
  margin: 20px 0 0;
  font-size: 13.5px;
  line-height: 1.6;
  text-align: center;
  color: var(--muted);
}
.auth-back {
  margin: 14px 0 0;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}
.auth-panel a:not(.auth-btn) {
  text-underline-offset: 2px;
}
.auth-panel a:not(.auth-btn):hover {
  text-decoration: underline;
}
