/* ============================================================
   Login page (/login/). Builds on base.css.
   ============================================================ */

.auth-page {
  position: relative;
  display: flex;
  justify-content: center;
  padding: max(48px, env(safe-area-inset-top)) var(--page-pad) 40px;
  background:
    radial-gradient(700px 360px at 50% -120px, color-mix(in srgb, var(--purple) 16%, transparent), transparent 70%),
    var(--bg);
}

.auth-container {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  animation: fade-up 0.35s var(--ease) both;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-brand-name {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.auth-card {
  width: 100%;
  padding: 28px;
  border-radius: 20px;
  background: var(--surface-1);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.auth-title {
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.auth-subtitle {
  margin-top: -10px;
  color: var(--text-2);
  font-size: var(--text-m);
}

/* Status message */
.status-msg {
  padding: 12px 14px;
  border-radius: var(--radius-m);
  font-size: 13px;
  line-height: 1.45;
  background: var(--surface-2);
  color: var(--text-2);
}

.status-msg--info {
  background: color-mix(in srgb, var(--purple) 14%, transparent);
  color: #d6c6fb;
}

.status-msg--success {
  background: var(--win-soft);
  color: #9be8c5;
}

.status-msg--error {
  background: var(--loss-soft);
  color: #f6b1bc;
}

/* Welcome back: saved cookie, token ran out. Continue (cookie) or Sign in with Riot (link). */
.welcome-back {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: var(--radius-m);
  background: var(--surface-2);
  animation: fade-up 0.25s var(--ease) both;
}

.welcome-back-title {
  margin: 0;
  color: var(--text-1);
  font-weight: 600;
}

.welcome-back-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.welcome-back-actions .btn {
  height: auto;
  min-height: 48px;
  padding-block: 8px;
}

.welcome-back-actions .btn-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.2;
}

.welcome-back-actions small {
  font-size: 11px;
  font-weight: 500;
  opacity: 0.75;
}

@media (max-width: 360px) {
  .welcome-back-actions {
    grid-template-columns: 1fr;
  }
}

/* "Send to aetest" bookmarklet: desktop only (phones can't drag to a bookmarks bar). */
.bookmarklet-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bookmarklet-chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: var(--radius-s);
  background: var(--surface-3);
  color: var(--text-1);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: grab;
  transition: background var(--motion-fast) var(--ease-out);
}

.bookmarklet-chip:hover {
  background: var(--surface-4);
}

.bookmarklet-chip:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

@media (hover: none), (max-width: 640px) {
  .bookmarklet-row {
    display: none;
  }
}

/* Steps */
.step-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: fade-up 0.25s var(--ease) both;
}

.step-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.step-badge {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.step-label {
  font-size: 15px;
  font-weight: 600;
}

.step-desc {
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.55;
}

.step-desc strong {
  color: var(--text-1);
  font-weight: 600;
}

.step-divider {
  height: 4px;
}

/* "or" divider: a word between two soft fades, not grey rules */
.or-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-3);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.or-divider::before,
.or-divider::after {
  content: '';
  flex: 1;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--surface-3));
}

.or-divider::after {
  background: linear-gradient(90deg, var(--surface-3), transparent);
}

/* Cookie sign-in dropdown */
.cookie-panel {
  border-radius: var(--radius-m);
  background: var(--surface-2);
}

.cookie-panel summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 600;
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 12px;
  align-items: center;
}

.cookie-panel summary::-webkit-details-marker {
  display: none;
}

.cookie-panel summary::after {
  content: '';
  grid-row: 1 / span 2;
  grid-column: 2;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--text-3);
  border-bottom: 2px solid var(--text-3);
  transform: rotate(45deg) translateY(-3px);
  transition: transform var(--dur) var(--ease);
}

.cookie-panel[open] summary::after {
  transform: rotate(225deg) translateY(-3px);
}

.cookie-panel summary span {
  grid-column: 1;
  margin-top: 2px;
  font-size: var(--text-s);
  font-weight: 500;
  color: var(--text-3);
}

.cookie-panel .cookie-signin {
  padding: 0 16px 16px;
}

.cookie-howto {
  padding: 12px 14px;
  border-radius: var(--radius-s);
  background: var(--surface-1);
}

.cookie-steps {
  display: grid;
  gap: 6px;
  margin-bottom: 8px;
  padding-left: 18px;
  list-style: disc;
}

.cookie-steps li::marker {
  color: var(--text-3);
}

/* auth.riotgames.com as a click-to-copy chip (copy only; it doesn't open the page) */
.copy-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  margin: 0 2px;
  padding: 3px 9px;
  border: 0;
  border-radius: var(--radius-xs);
  background: var(--surface-3);
  color: var(--text-1);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  vertical-align: middle;
  transition: background var(--motion-fast) var(--ease-out);
}

.copy-chip:hover {
  background: color-mix(in srgb, var(--purple) 22%, var(--surface-3));
}

.copy-chip:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.copy-chip-icon {
  width: 14px;
  height: 14px;
  flex: none;
  color: var(--text-2);
}

.copy-chip.is-copied .copy-chip-icon {
  color: var(--win);
}

.copy-chip-status {
  margin-left: 4px;
  font-size: var(--text-s);
  font-weight: 600;
  color: var(--win);
}

.cookie-smallprint {
  font-size: var(--text-s);
  color: var(--text-3);
}

@media (max-width: 640px) {
  .copy-chip {
    min-height: 40px;
  }
}

/* Sign in on phone: a 4-letter code from a signed-in device */
.handoff-signin {
  margin-top: 4px;
  padding: 14px 16px;
  border-radius: var(--radius-m);
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.handoff-signin-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 14px;
  font-weight: 650;
  color: var(--text-1);
}

.handoff-signin-label span {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
}

.handoff-signin-row {
  display: flex;
  gap: 8px;
}

.handoff-code-input {
  flex: 1;
  min-width: 0;
  height: 44px;
  background: var(--surface-3); /* the card is surface-2, so the field needs the next shade to show */
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

.cookie-howto-title {
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 650;
  color: var(--text-1);
}

/* One-line paste: fills the boxes below (stacked, unlike the name | value rows) */
.cookie-field.cookie-paste {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  margin-bottom: 4px;
}

.cookie-paste .cookie-field-name {
  font-family: inherit;
  font-weight: 600;
}

.cookie-paste-input {
  min-height: 56px;
  padding-top: 10px;
  resize: vertical;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
  line-height: 1.4;
  word-break: break-all;
}

.cookie-paste-result {
  min-height: 16px;
  font-size: 12px;
  color: var(--text-2);
}

.cookie-paste-result[data-state="ok"] { color: var(--win); }
.cookie-paste-result[data-state="warn"] { color: var(--draw); }
.cookie-paste-result[data-state="error"] { color: var(--loss); }

.cookie-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cookie-field {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.cookie-field-name {
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  font-size: 13px;
  font-weight: 600;
}

.cookie-field-name em {
  display: block;
  font-family: var(--font);
  font-size: 10px;
  font-style: normal;
  font-weight: 600;
  color: var(--accent-red-text);
}

.cookie-input {
  height: 38px;
  background: var(--surface-1);
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  font-size: 13px;
}

.auth-footnote {
  color: var(--text-3);
  font-size: var(--text-s);
  text-align: center;
}

@media (max-width: 480px) {
  .auth-page {
    padding-top: max(28px, env(safe-area-inset-top));
  }

  .auth-card {
    padding: 22px 18px;
    border-radius: 18px;
  }

  .auth-title {
    font-size: 22px;
  }
}
