/* The sign-in sheet and the Delete everything confirmation, on every page
   (auth.js). Lifted from the Sep 26 hub boards (design/handoff/
   2026-09-26-hub: sheet-signin-methods, sheet-signin-provider-failure,
   sheet-delete, at 560 and 390): a centered sheet over a forest scrim on
   wide screens, a bottom sheet on phones. */

.auth-sheet-open,
.auth-sheet-open body {
  overflow: hidden;
}

/* Above everything on every page: the flow pages raise the nav to 1100
   over Leaflet's 1000 (site-plan.css), and a modal sits over the nav. */
.auth-scrim {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
  background: rgba(28, 58, 42, .55);
  overflow-y: auto;
}

.auth-sheet {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 560px;
  background: var(--surface);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .2);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
}

.auth-sheet-head {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px 24px;
  border-radius: 0;
}

.auth-sheet-eyebrow {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .6);
}

.auth-sheet-title {
  margin: 0;
  padding-right: 36px;
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 400;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -.3px;
  color: #fff;
}

.auth-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.auth-close:hover {
  background: rgba(255, 255, 255, .22);
}
.auth-sheet--delete .auth-close {
  background: var(--surface-2);
  color: var(--text-2);
}
.auth-sheet--delete .auth-close:hover {
  background: var(--border);
}

.auth-sheet-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 24px 24px;
}

.auth-notice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  max-width: 360px;
  padding: 10px 12px;
  box-sizing: border-box;
  background: var(--priority-bg);
  border: 1px solid #E8D4A8;
  border-radius: var(--r-sm);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--priority-text);
}
.auth-notice::before {
  content: '';
  flex: none;
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--sun);
}
.auth-notice[hidden] {
  display: none;
}

.auth-methods {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 360px;
}

/* Sign in with Apple, per Apple's button rules: black, the Apple mark,
   the system typeface. */
.auth-apple {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 16px;
  box-sizing: border-box;
  background: #000;
  color: #fff;
  border: 1px solid #000;
  border-radius: var(--r-sm);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', 'DM Sans', sans-serif;
  font-weight: 500;
  font-size: 15px;
  text-decoration: none;
  cursor: pointer;
}
.auth-apple:hover {
  background: #1A1A1A;
}
.auth-apple svg {
  margin-top: -2px;
}
.auth-apple[disabled] {
  opacity: .45;
  cursor: not-allowed;
}
.auth-apple--going {
  opacity: .7;
  pointer-events: none;
}

.auth-note {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-2);
}

/* The email code (D44, D64; the Sep 26 boards). The flow holds the lead
   and the method stack, then the code step in their place. */
.auth-flow {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.auth-method {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.auth-email-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
}
.auth-input {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-family: 'DM Sans', sans-serif;
  font-size: 14.5px;
  color: var(--text);
}
.auth-input:focus {
  outline: none;
  border-color: var(--teal-border);
  box-shadow: 0 0 0 3px rgba(168, 221, 228, .35);
}
.auth-input[aria-invalid="true"] {
  border-color: var(--urgent-text);
}
.auth-email-submit {
  width: 100%;
  min-height: 44px;
  padding: 10px 18px;
  font-size: 13.5px;
}
.auth-email-submit[disabled] {
  opacity: .6;
  cursor: default;
}
/* A remembered provider in the top slot: email keeps its place below,
   outlined (D45, one filled button). */
.auth-email-submit--quiet {
  background: var(--surface);
  color: var(--pool-dark);
  border: 1px solid var(--border);
}
.auth-email-submit--quiet:hover {
  background: var(--pool-light);
}
.auth-or {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  line-height: 1;
  color: var(--text-2);
}
.auth-or-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}
.auth-pill-row {
  display: flex;
}
.auth-pill {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  line-height: 1.2;
  color: var(--pool-dark);
  background: var(--pool-light);
  border-radius: var(--r-pill);
  padding: 3px 8px;
}
.auth-code-lead strong {
  font-weight: 600;
  overflow-wrap: anywhere;
}
.auth-code {
  display: flex;
  gap: 8px;
  max-width: 360px;
  transition: opacity .3s ease;
}
.auth-code-box {
  flex: 1 1 0;
  min-width: 0;
  width: 100%;
  height: 52px;
  padding: 0;
  text-align: center;
  font-family: 'DM Mono', ui-monospace, Menlo, monospace;
  font-size: 22px;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
}
.auth-code-box:focus {
  outline: none;
  border-color: var(--teal-border);
  box-shadow: 0 0 0 3px rgba(168, 221, 228, .35);
}
.auth-code--dim {
  opacity: .4;
}
.auth-code-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  max-width: 360px;
}
.auth-link-button {
  min-height: 32px;
  padding: 0;
  background: none;
  border: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--pool);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.auth-link-button[disabled] {
  color: var(--text-3);
  text-decoration: none;
  cursor: default;
  font-variant-numeric: tabular-nums;
}
/* Expired or exhausted: Resend code is the sheet's one amber action. */
.auth-resend--primary {
  width: 100%;
  min-height: 44px;
  padding: 10px 18px;
  font-size: 13.5px;
  text-decoration: none;
}

.auth-footer {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-2);
}

/* Delete everything (D47). */
.auth-delete-title {
  margin: 0;
  padding-right: 36px;
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -.3px;
  color: var(--forest);
}
.auth-delete-lead {
  margin: 0 0 -8px;
  font-size: 13.5px;
  line-height: 1.55;
}
.auth-delete-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 0;
  padding: 0 0 0 18px;
  font-size: 13.5px;
  line-height: 1.55;
}
.auth-delete-when {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-2);
}
.auth-delete-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.auth-delete-yes,
.auth-delete-no {
  min-height: 44px;
  margin: 0;
  border-radius: var(--r-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 13.5px;
  cursor: pointer;
}
.auth-delete-yes {
  padding: 10px 18px;
  background: var(--urgent-text);
  color: #fff;
  border: 1px solid var(--urgent-text);
  font-weight: 600;
}
.auth-delete-yes:hover {
  background: #7A1515;
  border-color: #7A1515;
}
.auth-delete-no {
  padding: 10px 16px;
  background: var(--surface);
  color: var(--text-2);
  border: 1px solid var(--border);
  font-weight: 500;
}
.auth-delete-no:hover {
  color: var(--text);
  border-color: var(--border-2);
}
.auth-delete-yes[disabled],
.auth-delete-no[disabled] {
  opacity: .6;
  cursor: default;
}

/* The lead line under the head (D109; the Sep 26 board's 14/1.6). */
.auth-lead {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
}

/* The save sheet's head carries the project (the Sep 26 board): the
   address with its place, and the pool's size as a chip. */
.auth-save-what {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.auth-save-where {
  margin-right: 4px;
  font-size: 12.5px;
  line-height: 1.5;
  color: rgba(255, 255, 255, .85);
}
.auth-save-chip {
  padding: 2px 9px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .14);
  font-size: 11px;
  font-weight: 500;
  color: #fff;
}

/* The chooser (D46, D109): the lead in the head, two cards as a radio
   group, then Keep and what it discards. */
.auth-chooser-lead {
  max-width: 440px;
  margin: 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: rgba(255, 255, 255, .85);
}
.auth-choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.auth-choice {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  margin: 0;
  padding: 14px 16px;
  text-align: left;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  font-family: 'DM Sans', sans-serif;
  color: var(--text);
  cursor: pointer;
}
.auth-choice:hover {
  border-color: var(--pool);
}
.auth-choice[aria-checked="true"] {
  border-color: var(--pool);
  box-shadow: 0 0 0 3px var(--pool-light);
}
.auth-choice:focus-visible {
  outline: 2px solid var(--teal-border);
  outline-offset: 2px;
}
.auth-choice[disabled] {
  cursor: default;
}
.auth-choice-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.auth-choice-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--pool-dark);
}
.auth-choice--device .auth-choice-label {
  color: var(--sun-dark);
}
.auth-choice-dot {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  box-sizing: border-box;
  border: 1.5px solid var(--border);
  border-radius: 50%;
}
.auth-choice-dot::after {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: transparent;
}
.auth-choice[aria-checked="true"] .auth-choice-dot {
  border-color: var(--pool);
}
.auth-choice[aria-checked="true"] .auth-choice-dot::after {
  background: var(--pool);
}
.auth-choice-where {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.auth-choice-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.auth-choice-chip {
  padding: 2px 9px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 500;
  color: var(--text);
}
.auth-choice-lines {
  display: flex;
  flex-direction: column;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-2);
}
.auth-keep {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.auth-keep-button {
  align-self: flex-start;
  min-height: 44px;
  padding: 10px 18px;
  font-size: 13.5px;
  transition: opacity .2s ease, background-color .2s ease;
}
.auth-keep-button[disabled] {
  opacity: .5;
  cursor: default;
}
.auth-keep-line {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-2);
}

/* Phones: a bottom sheet, the full width, top corners rounded. */
@media (max-width: 599px) {
  .auth-scrim {
    align-items: flex-end;
    padding: 0;
  }
  .auth-sheet {
    max-width: none;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
  }
  .auth-methods,
  .auth-notice,
  .auth-code,
  .auth-code-actions {
    max-width: none;
  }
}
