:root {
  --auth-ink: #1b211f;
  --auth-red: #cf3529;
  --auth-red-light: #e34031;
  --auth-cream: #fff9eb;
  --auth-yellow: #ffdb28;
  --auth-muted: #535950;
  --auth-green: #3b7049;
  --auth-font: "Trebuchet MS", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

.auth-symbols { position: absolute; overflow: hidden; }

.auth-dialog {
  width: min(680px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--auth-ink);
  overflow-x: hidden;
  overflow-y: auto;
  font: 400 16px/1.5 var(--auth-font);
}

.auth-dialog::backdrop { background: rgba(20, 29, 26, .66); }
.auth-dialog [hidden] { display: none !important; }
.auth-dialog svg { display: block; flex-shrink: 0; }

.auth-shell {
  width: min(590px, 100%);
  min-width: 0;
  position: relative;
  margin: 0 auto;
  padding: 8px 0 18px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  filter: drop-shadow(0 8px 0 rgba(25, 27, 22, .18));
}

.auth-shell::before { content: none; }

.auth-dialog button,
.auth-dialog input { font: inherit; color: inherit; }

.auth-dialog button:focus-visible,
.auth-dialog input:focus-visible { outline: 3px solid #006396; outline-offset: 4px; }

.auth-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 2px 14px;
}

.auth-mode { display: flex; align-items: center; gap: 8px; min-width: 0; }

.auth-mode button,
.close-auth,
.text-action {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 13px;
  border: 2px solid var(--auth-ink);
  border-radius: 13px 11px 14px 12px;
  background: var(--auth-cream);
  box-shadow: 2px 3px 0 var(--auth-ink);
  font-size: .875rem;
  font-weight: 800;
  line-height: 1.3;
}

.auth-mode button:nth-child(2) { border-radius: 11px 14px 12px 13px; transform: rotate(.7deg); }
.auth-mode button:first-child { transform: rotate(-.7deg); }
.auth-mode button[aria-pressed="true"] { background: #fff1b0; }
.auth-mode button:hover,
.close-auth:hover,
.text-action:hover { background: #ffefb5; transform: translateY(-1px); }
.auth-mode button:active,
.close-auth:active,
.text-action:active { transform: translate(2px, 2px); box-shadow: none; }

.close-auth { width: 44px; padding: 9px; flex: none; }
.close-auth .auth-icon { width: 22px; height: 22px; }

.auth-marquee {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1400 / 584;
  position: relative;
  z-index: 0;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.auth-form-body { position: relative; z-index: 1; margin-top: -13px; }

.auth-loading-panel,
.account-summary {
  max-width: 540px;
  margin: 0 auto;
  padding: 18px 20px;
  border: 3px solid var(--auth-ink);
  border-radius: 19px 23px 18px 21px;
  background: var(--auth-cream);
  box-shadow: 4px 5px 0 var(--auth-ink);
  text-align: center;
}

.auth-loading-panel h3,
.account-summary h3 { margin: 0; font-size: 1.25rem; line-height: 1.3; }
.auth-loading-panel p,
.account-summary p { margin: 6px 0 0; color: var(--auth-muted); font-size: .875rem; }
.auth-loading-mark,
.account-summary-mark { width: 48px; height: 48px; display: grid; place-items: center; margin: 0 auto 12px; border: 2px solid var(--auth-ink); border-radius: 50%; background: var(--auth-yellow); box-shadow: 2px 3px 0 var(--auth-ink); }
.auth-loading-mark .spinner { display: block; }
.account-summary { display: flex; align-items: center; gap: 14px; text-align: left; }
.account-summary-mark { flex: none; margin: 0; color: var(--auth-green); }
.account-summary-mark .auth-icon { width: 28px; height: 28px; stroke-width: 2.7; }
.account-summary strong { display: block; max-width: 410px; margin-top: 3px; overflow-wrap: anywhere; }

.auth-dialog[data-auth-loading="true"] .auth-fields,
.auth-dialog[data-auth-loading="true"] .auth-mode,
.auth-dialog[data-auth-loading="true"] .signed-in-actions,
.auth-dialog[data-auth-loading="true"] .account-summary,
.auth-dialog[data-auth-loading="true"] .auth-boundary,
.auth-dialog[data-auth-loading="true"] .auth-action-panel,
.auth-dialog[data-auth-loading="true"] .auth-notice-stack { display: none; }

.field-frame {
  position: relative;
  padding: 9px;
  border: 3px solid #151916;
  border-radius: 37px 43px 37px 41px / 36px 37px 34px 35px;
  background: var(--auth-red);
  box-shadow: 0 4px 0 #20211d;
  transition: background .16s, box-shadow .16s;
}

.field-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 61px;
  padding: 0 15px 0 20px;
  border: 2.5px solid #191c18;
  border-radius: 25px 29px 25px 27px / 26px 24px 24px 25px;
  background: var(--auth-cream);
}

.field-frame:focus-within { background: var(--auth-red-light); box-shadow: 0 4px 0 #1b201a, 0 0 0 3px var(--auth-yellow); }
.field-frame.invalid { background: #ac293e; }
.field-frame.invalid:focus-within { box-shadow: 0 4px 0 #1b201a, 0 0 0 3px #f1a8b8; }

.auth-icon {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.field-icon { width: 33px; height: 33px; fill: #e3e0d8; }

.auth-dialog .field-inner input {
  min-width: 0;
  width: 100%;
  padding: 14px 0;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  box-shadow: none;
  caret-color: #b92e21;
  font-size: 1.375rem;
  font-weight: 600;
  line-height: 1.35;
}

.auth-dialog .field-inner input::placeholder { color: #626358; opacity: 1; font-weight: 600; }
.auth-dialog .field-inner input:-webkit-autofill { -webkit-box-shadow: 0 0 0 1000px var(--auth-cream) inset; -webkit-text-fill-color: var(--auth-ink); }

.email-check { width: 25px; height: 25px; flex: none; color: var(--auth-green); opacity: 0; transform: scale(.7); transition: opacity .18s, transform .18s; }
.email-check.visible { opacity: 1; transform: none; }
.email-check .auth-icon { width: 25px; height: 25px; stroke-width: 2.5; }

.lower-zone { min-height: 244px; position: relative; }

.intro-note {
  width: fit-content;
  max-width: 100%;
  margin: 18px auto 0;
  padding: 11px 17px;
  border: 2px solid var(--auth-ink);
  border-radius: 15px 12px 14px 11px;
  background: var(--auth-cream);
  box-shadow: 2px 3px 0 var(--auth-ink);
  text-align: center;
}

.intro-note strong { display: block; font-size: 1rem; font-weight: 800; }
.intro-note span { display: block; margin-top: 2px; color: var(--auth-muted); font-size: .875rem; }

.expander {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: grid-template-rows .34s ease, opacity .24s ease, transform .34s ease;
}

.expander.open { grid-template-rows: 1fr; opacity: 1; visibility: visible; transform: none; }
.expander-content { min-width: 0; min-height: 0; overflow: hidden; }
.expander.open .expander-content { overflow: visible; }
.password-wrap { padding-top: 15px; }
.password-frame { border-radius: 39px 35px 42px 35px / 35px 33px 36px 34px; }
.password-frame .field-inner { padding-right: 7px; border-radius: 26px 22px 29px 22px / 24px 25px 24px 23px; }

.auth-dialog .eye-button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
}

.auth-dialog .eye-button:hover { background: #efdfb9; }
.auth-dialog .eye-button:focus-visible { outline-offset: 0; }
.auth-dialog .eye-button .auth-icon { width: 24px; height: 24px; }
.auth-dialog .eye-button .slash { display: none; }
.auth-dialog .eye-button[aria-pressed="true"] .slash { display: block; }

.action-row { display: flex; justify-content: center; padding: 15px 3px 8px; }

.auth-dialog .continue {
  min-width: 280px;
  max-width: 100%;
  min-height: 59px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 22px;
  margin: 0;
  padding: 13px 28px;
  border: 3px solid var(--auth-ink);
  border-radius: 17px 21px 15px 19px;
  background: var(--auth-yellow);
  box-shadow: 4px 5px 0 var(--auth-ink);
  font-size: 1.1875rem;
  font-weight: 900;
  line-height: 1.25;
  text-align: center;
  transition: background .16s, box-shadow .16s, transform .16s;
}

.auth-dialog .continue .auth-icon { width: 25px; height: 25px; stroke-width: 2.5; }
.auth-dialog .continue:disabled { background: #e6d093; color: #5b533c; box-shadow: 2px 3px 0 var(--auth-ink); }
.auth-dialog .continue:hover:not(:disabled) { background: #ffe866; transform: translate(-1px, -1px); box-shadow: 5px 6px 0 var(--auth-ink); }
.auth-dialog .continue:active:not(:disabled) { transform: translate(3px, 4px); box-shadow: 1px 1px 0 var(--auth-ink); }
.auth-dialog .continue.loading .arrow { display: none; }

.spinner { display: none; width: 22px; height: 22px; border: 3px solid #a49977; border-top-color: var(--auth-ink); border-radius: 50%; animation: auth-spin .8s linear infinite; }
.auth-dialog .continue.loading .spinner { display: block; }

.form-notice,
.auth-boundary,
.account-status {
  width: fit-content;
  max-width: calc(100% - 12px);
  margin: 12px auto 0;
  padding: 8px 12px;
  border: 1.5px solid #272b23;
  border-radius: 9px 11px 8px 10px;
  background: var(--auth-cream);
  box-shadow: 1px 2px 0 rgba(27, 33, 31, .7);
  font-size: .875rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.form-notice { text-align: center; }
.form-notice.error { background: #fff0e9; color: #952735; font-weight: 700; }
.auth-notice-stack { display: grid; justify-items: center; }
.auth-retry { margin-top: 8px; }
.auth-boundary { display: flex; align-items: flex-start; gap: 7px; color: var(--auth-muted); }
.auth-boundary .auth-icon { width: 17px; height: 17px; margin-top: 2px; }

.text-action { font-family: var(--auth-font); }
.signed-in-actions { display: none; flex-wrap: wrap; justify-content: center; gap: 9px; margin: 12px auto 0; }
.auth-dialog[data-signed-in="true"] .signed-in-actions { display: flex; }
.auth-dialog[data-signed-in="true"] .auth-fields,
.auth-dialog[data-signed-in="true"] .auth-mode { display: none; }
.auth-dialog[data-signed-in="true"] .account-summary { display: flex; }
.auth-dialog[data-action-view] .auth-fields,
.auth-dialog[data-action-view] .auth-mode,
.auth-dialog[data-action-view] .signed-in-actions,
.auth-dialog[data-action-view] .account-summary { display: none; }
.auth-action-panel { width: 100%; text-align: center; }
.auth-action-panel h3 { width: fit-content; max-width: 100%; margin: 0 auto 7px; padding: 7px 13px; border: 2px solid var(--auth-ink); border-radius: 13px 16px 12px 15px; background: var(--auth-cream); box-shadow: 2px 3px 0 var(--auth-ink); font-size: 1.5rem; }
.auth-action-panel > p { width: fit-content; max-width: 520px; margin: 0 auto 5px; padding: 6px 11px; border-radius: 10px; background: rgba(255, 249, 235, .94); color: var(--auth-muted); }
.auth-inline-actions { display: flex; justify-content: center; padding: 5px 3px 10px; }
.auth-link {
  min-height: 44px;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 13px;
  border: 2px solid var(--auth-ink);
  border-radius: 12px 15px 11px 14px;
  background: var(--auth-cream);
  box-shadow: 2px 3px 0 var(--auth-ink);
  color: #8d281f;
  font-weight: 800;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
}
.auth-link:hover { background: #ffefb5; color: #521713; transform: translateY(-1px); box-shadow: 3px 4px 0 var(--auth-ink); }
.auth-link:active { transform: translate(2px, 2px); box-shadow: none; }

.session-list { display: grid; gap: 10px; max-width: 540px; margin: 16px auto 4px; text-align: left; }
.session-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 13px 14px; border: 2px solid var(--auth-ink); border-radius: 14px 11px 15px 12px; background: var(--auth-cream); box-shadow: 2px 3px 0 var(--auth-ink); }
.session-card:nth-child(even) { border-radius: 11px 15px 12px 14px; }
.session-card strong,
.session-card small { display: block; }
.session-card small { margin-top: 3px; color: var(--auth-muted); font-size: .8125rem; line-height: 1.4; }
.session-current { display: inline-flex; margin-left: 5px; padding: 2px 7px; border: 1.5px solid var(--auth-ink); border-radius: 999px; background: var(--auth-yellow); font-size: .75rem; line-height: 1.3; vertical-align: 1px; }
.session-revoke { min-height: 44px; padding: 8px 11px; border: 2px solid var(--auth-ink); border-radius: 11px 13px 10px 12px; background: #fff0e9; box-shadow: 2px 2px 0 var(--auth-ink); color: #8d281f; font: 800 .8125rem/1.25 var(--auth-font); }
.session-revoke:hover { background: #ffd8ce; }
.session-revoke:active { transform: translate(2px, 2px); box-shadow: none; }

@keyframes auth-spin { to { transform: rotate(360deg); } }

@media (min-width: 1400px) {
  .auth-shell { width: 620px; }
  .lower-zone { min-height: 254px; }
}

@media (max-width: 640px) {
  .auth-dialog { width: calc(100% - 16px); max-height: calc(100dvh - 16px); }
  .auth-shell { width: 100%; max-width: 440px; padding-bottom: 12px; filter: drop-shadow(0 6px 0 rgba(25, 27, 22, .18)); }
  .auth-toolbar { margin-inline: 1px; margin-bottom: 11px; gap: 8px; }
  .auth-mode { gap: 6px; }
  .auth-mode button { padding: 9px 10px; }
  .auth-form-body { margin-top: -8px; }
  .auth-loading-panel,
  .account-summary { margin-inline: 3px; padding: 15px; }
  .account-summary { align-items: flex-start; }
  .field-frame { padding: 6px; border-width: 2.5px; border-radius: 27px 30px 27px 29px / 29px 30px 27px 29px; }
  .field-inner { min-height: 50px; gap: 10px; padding: 0 12px 0 13px; border-width: 2px; border-radius: 20px 22px 21px 22px; }
  .field-icon { width: 27px; height: 27px; }
  .auth-dialog .field-inner input { padding: 14px 0; font-size: 1.0625rem; line-height: 1.35; }
  .email-check,
  .email-check .auth-icon { width: 21px; height: 21px; }
  .password-wrap { padding-top: 13px; }
  .password-frame .field-inner { padding-right: 3px; border-radius: 20px 19px 23px 20px; }
  .lower-zone { min-height: 243px; }
  .intro-note { max-width: calc(100% - 10px); margin-top: 17px; padding: 11px 14px; }
  .action-row { padding-top: 14px; }
  .auth-dialog .continue { min-width: 245px; min-height: 56px; padding: 12px 21px; gap: 19px; border-radius: 15px 19px 16px 18px; font-size: 1.125rem; }
  .session-card { grid-template-columns: 1fr; }
  .session-revoke { width: 100%; }
}

@media (max-width: 370px) {
  .auth-toolbar { flex-wrap: wrap; }
  .close-auth { margin-left: auto; }
  .auth-mode button { padding-inline: 8px; }
  .auth-mode button:nth-child(2) { font-size: .8125rem; }
  .field-icon { width: 24px; height: 24px; }
  .field-inner { gap: 8px; padding-left: 10px; }
  .auth-dialog .field-inner input { font-size: 1rem; }
  .email-check,
  .email-check .auth-icon { width: 18px; height: 18px; }
  .auth-dialog .continue { min-width: 225px; font-size: 1.0625rem; }
}

@media (max-height: 680px) and (min-width: 641px) {
  .auth-shell { width: 480px; }
  .lower-zone { min-height: 235px; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-dialog *,
  .auth-dialog *::before,
  .auth-dialog *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
