:root {
  color-scheme: dark;
  --background: #0e1b24;
  --surface: #152833;
  --surface-subtle: #1c3441;
  --primary: #74c7dc;
  --primary-strong: #9ad8e7;
  --text: #eaf2f5;
  --text-muted: #a9bbc4;
  --border: #35505e;
  --attention: #e2af62;
  --focus: #9ad8e7;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background:
    radial-gradient(circle at 50% 16%, rgba(116, 199, 220, 0.08), transparent 32rem),
    var(--background);
  color: var(--text);
  font-family: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
}

a {
  color: var(--primary);
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}

a:hover {
  color: var(--primary-strong);
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.auth-page {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  overflow: hidden;
  display: grid;
  place-items: start center;
  padding: clamp(2rem, 6vh, 4.75rem) 1.25rem clamp(13rem, 35vh, 24rem);
}

.auth-page::after {
  content: "";
  position: absolute;
  z-index: -2;
  inset: auto 0 0;
  height: min(47vh, 32rem);
  background-image:
    linear-gradient(to bottom, var(--background) 0%, rgba(14, 27, 36, 0.78) 18%, rgba(14, 27, 36, 0.18) 60%, rgba(14, 27, 36, 0.05) 100%),
    radial-gradient(ellipse 28% 96% at 50% 45%, var(--background) 0%, rgba(14, 27, 36, 0.9) 28%, rgba(14, 27, 36, 0.25) 72%, transparent 100%),
    url("assets/desk-login-background.webp");
  background-position: center, center, center bottom;
  background-repeat: no-repeat;
  background-size: cover, cover, cover;
  pointer-events: none;
}

.auth-page::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(to bottom, transparent 58%, rgba(14, 27, 36, 0.04) 72%, rgba(14, 27, 36, 0.28) 100%);
  pointer-events: none;
}

.auth-shell {
  width: min(100%, 36rem);
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.brand-logo {
  width: min(100%, 36rem);
  height: auto;
  align-self: center;
  margin-bottom: clamp(1rem, 2.6vh, 1.6rem);
  filter: drop-shadow(0 12px 32px rgba(0, 0, 0, 0.16));
}

.auth-shell > .auth-form,
.auth-shell > .account-prompt {
  width: min(100%, 20rem);
  align-self: center;
}

.auth-form {
  display: grid;
  gap: 1rem;
}

.field {
  display: grid;
  gap: 0.45rem;
}

.field label {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.field input {
  width: 100%;
  min-height: 3.25rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: rgba(21, 40, 51, 0.94);
  color: var(--text);
  padding: 0.8rem 1rem;
  font: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035), 0 10px 28px rgba(0, 0, 0, 0.12);
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.field input::placeholder {
  color: #718995;
}

.field input:hover {
  border-color: #496877;
}

.field input:focus {
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 4px rgba(116, 199, 220, 0.12), 0 14px 32px rgba(0, 0, 0, 0.18);
}

.primary-action {
  min-height: 3.25rem;
  margin-top: 0.2rem;
  border: 0;
  border-radius: 0.75rem;
  background: var(--primary);
  color: var(--background);
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.015em;
  box-shadow: 0 10px 30px rgba(24, 113, 137, 0.22);
  transition: background-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.primary-action:hover {
  background: var(--primary-strong);
  box-shadow: 0 12px 34px rgba(24, 113, 137, 0.3);
  transform: translateY(-1px);
}

.primary-action:active {
  transform: translateY(0);
}

.account-prompt {
  margin: 1.15rem 0 0;
  color: var(--text-muted);
  text-align: center;
  font-size: 0.9375rem;
}

.account-prompt button,
.text-button {
  border: 0;
  background: transparent;
  color: var(--primary);
  padding: 0;
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
}

.account-prompt button:hover,
.text-button:hover {
  color: var(--primary-strong);
}

.account-dialog {
  width: min(calc(100% - 2rem), 34rem);
  max-height: calc(100svh - 2rem);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  background: var(--surface);
  color: var(--text);
  padding: 0;
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.48);
}

.account-dialog::backdrop {
  background: rgba(4, 13, 19, 0.78);
  backdrop-filter: blur(5px);
}

.account-dialog-card {
  padding: clamp(1.4rem, 5vw, 2.1rem);
}

.account-dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.35rem;
}

.account-dialog-heading span {
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.account-dialog-heading h1 {
  margin: 0.25rem 0 0;
  font-size: clamp(1.55rem, 5vw, 2rem);
}

.account-dialog-close {
  width: 2.35rem;
  height: 2.35rem;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  padding: 0;
  font: inherit;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.account-dialog-close:hover {
  border-color: var(--primary);
  color: var(--text);
}

.account-dialog-copy {
  margin: 0 0 0.25rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.field small {
  color: var(--text-muted);
  font-size: 0.76rem;
}

.verification-step {
  text-align: center;
}

.verification-icon {
  width: 3.25rem;
  height: 3.25rem;
  display: grid;
  place-items: center;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: rgba(116, 199, 220, 0.16);
  color: var(--primary);
  font-size: 1.35rem;
  font-weight: 700;
}

.verification-step h2 {
  margin: 0;
}

.verification-step p {
  color: var(--text-muted);
  line-height: 1.55;
}

.verification-step strong {
  color: var(--text);
}

.verification-step .prototype-note {
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: rgba(116, 199, 220, 0.06);
  padding: 0.75rem;
  font-size: 0.78rem;
}

.verification-step .primary-action {
  width: 100%;
  margin-top: 0.5rem;
}

.verification-step .text-button {
  margin-top: 1rem;
}

.form-message {
  min-height: 1.3rem;
  margin: 0.25rem 0 0;
  color: var(--text-muted);
  text-align: center;
  font-size: 0.875rem;
}

.site-description {
  position: absolute;
  z-index: 1;
  left: 50%;
  bottom: clamp(1.25rem, 3vh, 2rem);
  width: min(calc(100% - 3rem), 42rem);
  margin: 0;
  padding: 0;
  transform: translateX(-50%);
  color: #f7fbfc;
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.55;
  text-shadow:
    0 1px 2px rgba(3, 10, 15, 1),
    0 2px 8px rgba(3, 10, 15, 0.98),
    0 0 18px rgba(3, 10, 15, 0.95);
}

.create-page {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 2rem 1.25rem;
}

.create-card {
  width: min(100%, 28rem);
  padding: clamp(1.5rem, 5vw, 2.25rem);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  background: rgba(21, 40, 51, 0.94);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(14px);
}

.create-logo {
  display: block;
  width: min(100%, 22rem);
  height: auto;
  margin: 0 auto 1.25rem;
}

.create-card h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.55rem, 5vw, 2rem);
  font-weight: 650;
  letter-spacing: -0.02em;
}

.create-card > p {
  margin: 0 0 1.5rem;
  color: var(--text-muted);
}

.back-link {
  display: inline-block;
  margin-top: 1.2rem;
}

@media (max-height: 700px) and (min-width: 700px) {
  .auth-page {
    padding-top: 1.5rem;
    padding-bottom: 11rem;
  }

  .brand-logo {
    width: 28rem;
    margin-bottom: 0.8rem;
  }

  .auth-form {
    gap: 0.7rem;
  }
}

@media (max-width: 560px) {
  .auth-page {
    padding-top: max(1.5rem, 5vh);
    padding-bottom: 12rem;
  }

  .auth-page::after {
    height: 34vh;
    min-height: 13rem;
    background-size: cover, cover, auto 100%;
  }

  .brand-logo {
    width: min(100%, 25rem);
  }

  .auth-shell > .auth-form,
  .auth-shell > .account-prompt {
    width: min(100%, 18rem);
  }

  .site-description {
    bottom: 0.75rem;
    width: min(calc(100% - 2rem), 30rem);
    padding: 0;
    font-size: 0.9375rem;
    line-height: 1.45;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

