:root {
  --auth-ink: #14303a;
  --auth-copper: #b97c45;
  --auth-blue: #126bdd;
  --auth-fog: #f1f5f6;
  --auth-tab: #f1f4f8;
  --auth-border: #dde4ec;
  --auth-copy: #667587;
  --auth-muted: #7a8795;
  --auth-white: #ffffff;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--auth-fog);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--auth-ink);
  background: var(--auth-fog);
  font-family: "Inter", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  color: inherit;
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  z-index: 10;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  color: var(--auth-white);
  background: var(--auth-ink);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.auth-page {
  display: flex;
  min-height: 100vh;
  min-height: 100svh;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

.auth-shell {
  display: grid;
  width: min(1200px, 100%);
  min-height: 772px;
  grid-template-columns: 590px minmax(0, 582px);
}

.auth-panel {
  position: relative;
  display: flex;
  height: 772px;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  padding: 28px 64px 24px;
  background: var(--auth-white);
  border-radius: 20px 0 0 20px;
}

.auth-panel[data-view="verification"] {
  justify-content: flex-start;
  gap: 28px;
}

.auth-panel[data-view="pending"],
.auth-panel[data-view="forgotRequest"],
.auth-panel[data-view="forgotSent"],
.auth-panel[data-view="actionProcessing"],
.auth-panel[data-view="resetPassword"],
.auth-panel[data-view="actionSuccess"],
.auth-panel[data-view="actionError"] {
  justify-content: flex-start;
  gap: 36px;
}

.auth-brand {
  display: flex;
  width: 450px;
  height: 47px;
  flex: 0 0 47px;
  align-items: center;
  justify-content: center;
}

.auth-brand img {
  display: block;
  width: 180px;
  height: auto;
}

.auth-heading {
  display: flex;
  width: 390px;
  align-items: center;
  justify-content: center;
}

.auth-heading h1 {
  width: 100%;
  margin: 0;
  font-size: 36px;
  font-weight: 600;
  line-height: 43px;
  letter-spacing: -0.035em;
  text-align: center;
}

.auth-tabs {
  display: flex;
  width: 390px;
  height: 44px;
  flex: 0 0 44px;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
  padding: 4px;
  background: var(--auth-tab);
  border-radius: 22px;
}

.auth-tab {
  display: flex;
  width: 189px;
  height: 40px;
  flex: 0 0 189px;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: #7b8794;
  background: transparent;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  line-height: 18px;
}

.auth-tab.is-active {
  color: #102a43;
  background: var(--auth-white);
  box-shadow: 0 2px 8px rgb(15 35 65 / 8%);
  font-weight: 600;
}

.auth-form {
  display: flex;
  width: 390px;
  flex-direction: column;
  gap: 9px;
  padding-top: 16px;
}

.auth-field {
  position: relative;
  display: flex;
  width: 390px;
  height: 50px;
  flex: 0 0 50px;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 0 17px;
  background: var(--auth-white);
  border: 1px solid var(--auth-border);
  border-radius: 14px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.auth-field:focus-within {
  border-color: var(--auth-copper);
  box-shadow: 0 0 0 3px rgb(185 124 69 / 12%);
}

.auth-field > span,
.auth-field > label {
  color: #445365;
  font-size: 11px;
  font-weight: 600;
  line-height: 14px;
}

.auth-field input {
  width: 100%;
  min-width: 0;
  padding: 0;
  color: var(--auth-ink);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 13px;
  line-height: 17px;
}

.auth-field input::placeholder {
  color: #a1abb7;
  opacity: 1;
}

.auth-password-field {
  padding-right: 48px;
}

.password-toggle {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: #788696;
  background: transparent;
}

.password-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}

.password-toggle.is-visible {
  color: var(--auth-copper);
}

.auth-primary {
  display: flex;
  width: 390px;
  height: 48px;
  flex: 0 0 48px;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  color: var(--auth-white);
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  transition: transform 160ms ease, filter 160ms ease, opacity 160ms ease;
}

.auth-primary:hover,
.auth-primary:focus-visible {
  filter: brightness(0.96);
  transform: translateY(-1px);
}

.auth-primary:disabled,
.google-button:disabled,
.text-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.auth-primary-copper {
  margin-top: 4px;
  background: var(--auth-copper);
  box-shadow: 0 8px 20px rgb(18 107 221 / 18%);
}

.auth-primary-blue {
  background: var(--auth-blue);
  border-radius: 9px;
}

.signin-options {
  display: flex;
  width: 390px;
  height: 32px;
  flex: 0 0 32px;
  align-items: center;
  justify-content: space-between;
}

.remember-control {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--auth-copy);
  font-size: 12px;
  line-height: 16px;
}

.remember-control input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--auth-copper);
}

.text-button {
  padding: 0;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
}

.text-button-copper {
  color: var(--auth-copper);
}

.text-button-blue {
  color: var(--auth-blue);
  font-weight: 700;
}

.auth-divider {
  display: flex;
  width: 390px;
  height: 34px;
  flex: 0 0 34px;
  align-items: center;
  gap: 12px;
  padding-top: 8px;
}

.auth-divider span {
  width: 171px;
  height: 1px;
  flex: 0 0 171px;
  background: #e1e7ee;
}

.auth-divider b {
  width: 24px;
  color: var(--auth-muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 15px;
  text-align: center;
}

.google-button {
  position: relative;
  display: flex;
  width: 390px;
  height: 48px;
  flex: 0 0 48px;
  align-items: center;
  justify-content: center;
  padding: 0 46px;
  color: #1f1f1f;
  background: var(--auth-white);
  border: 1px solid #747775;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
}

.google-button svg {
  position: absolute;
  top: 14px;
  left: 12px;
  width: 18px;
  height: 18px;
}

.google-button:hover,
.google-button:focus-visible {
  background: #f8faff;
  box-shadow: 0 1px 2px rgb(0 0 0 / 12%);
}

.auth-legal {
  display: flex;
  width: 390px;
  align-items: center;
  justify-content: center;
  gap: 3px;
  margin: 0;
  padding-top: 17px;
  color: #6d7a89;
  font-size: 11px;
  line-height: 16px;
}

.auth-legal a {
  color: var(--auth-copper);
  font-weight: 600;
}

.verification-step {
  display: flex;
  width: 390px;
  height: 44px;
  flex: 0 0 44px;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding: 4px 14px 4px 4px;
  color: var(--auth-copper);
  background: var(--auth-tab);
  border-radius: 22px;
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
}

.verification-step > div {
  display: flex;
  height: 36px;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  color: var(--auth-ink);
  background: var(--auth-white);
  border-radius: 18px;
  box-shadow: 0 2px 8px rgb(15 35 65 / 8%);
}

.step-check {
  display: flex;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  align-items: center;
  justify-content: center;
  color: var(--auth-white);
  background: var(--auth-copper);
  border-radius: 50%;
}

.step-check svg {
  width: 11px;
  height: 11px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.verification-state {
  display: flex;
  width: 390px;
  flex-direction: column;
  align-items: center;
}

.verification-intro {
  display: flex;
  width: 390px;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding-top: 12px;
}

.mail-icon {
  display: flex;
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  align-items: center;
  justify-content: center;
  color: var(--auth-copper);
  background: var(--auth-fog);
  border-radius: 50%;
}

.mail-icon svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.verification-intro > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.verification-intro h2,
.pending-state h2 {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  line-height: 32px;
  letter-spacing: -0.025em;
}

.verification-intro p {
  width: 350px;
  margin: 0;
  color: var(--auth-copy);
  font-size: 13px;
  line-height: 20px;
  text-align: center;
}

.verification-email {
  display: flex;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
  padding: 7px 14px;
  background: var(--auth-fog);
  border-radius: 15px;
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
  letter-spacing: 0.01em;
}

.verification-actions {
  display: flex;
  width: 390px;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding-top: 16px;
}

.verification-actions p {
  margin: 0;
  color: var(--auth-muted);
  font-size: 11px;
  line-height: 16px;
  text-align: center;
}

.verification-recovery {
  display: flex;
  width: 390px;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding-top: 14px;
}

.verification-recovery p {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  color: var(--auth-copy);
  font-size: 12px;
  line-height: 16px;
}

.change-email {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  color: var(--auth-copy);
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
}

.change-email svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
  stroke-linejoin: round;
}

.pending-state {
  display: flex;
  width: 390px;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding-top: 72px;
  text-align: center;
}

.pending-check {
  display: flex;
  width: 72px;
  height: 72px;
  align-items: center;
  justify-content: center;
  color: var(--auth-white);
  background: var(--auth-copper);
  border-radius: 50%;
}

.pending-check svg {
  width: 36px;
  height: 36px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pending-state p {
  width: 340px;
  margin: 0 0 10px;
  color: var(--auth-copy);
  font-size: 14px;
  line-height: 21px;
}

.pending-state .auth-primary {
  margin-top: 4px;
}

.action-state {
  display: flex;
  width: 390px;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding-top: 34px;
  text-align: center;
}

.action-form {
  gap: 12px;
}

.action-intro {
  display: flex;
  width: 390px;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding-bottom: 10px;
}

.action-intro > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}

.action-intro h2,
.action-result h2,
.action-processing h2 {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  line-height: 32px;
  letter-spacing: -0.025em;
}

.action-intro p,
.action-result p,
.action-processing p,
.action-note {
  width: 350px;
  margin: 0;
  color: var(--auth-copy);
  font-size: 13px;
  line-height: 20px;
  text-align: center;
}

.action-icon {
  display: flex;
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  align-items: center;
  justify-content: center;
  color: var(--auth-copper);
  background: var(--auth-fog);
  border-radius: 50%;
}

.action-icon svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.action-icon-error {
  color: #a34350;
  background: #fff0f2;
}

.action-note {
  padding-block: 4px 10px;
}

.back-button {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  color: var(--auth-copy);
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
}

.back-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.action-processing,
.action-result {
  padding-top: 96px;
}

.action-result {
  gap: 14px;
}

.action-result p {
  margin-bottom: 10px;
}

.action-spinner {
  width: 56px;
  height: 56px;
  margin-bottom: 8px;
  border: 4px solid #e7edf0;
  border-top-color: var(--auth-copper);
  border-radius: 50%;
  animation: auth-spin 800ms linear infinite;
}

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

.auth-message {
  position: absolute;
  z-index: 2;
  right: 64px;
  bottom: 14px;
  left: 64px;
  margin: 0;
  padding: 9px 12px;
  color: #664318;
  background: #fff6e8;
  border: 1px solid #edcfaa;
  border-radius: 9px;
  font-size: 12px;
  line-height: 17px;
  text-align: center;
}

.auth-message.is-error {
  color: #8a2633;
  background: #fff0f2;
  border-color: #efc2c8;
}

.auth-message.is-success {
  color: #1e6248;
  background: #eefaf5;
  border-color: #b9dfce;
}

.auth-visual {
  height: 772px;
  overflow: hidden;
  background: #1265e5;
  border-radius: 0 20px 20px 0;
}

.auth-visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

@media (max-width: 980px) {
  .auth-shell {
    width: min(590px, 100%);
    grid-template-columns: minmax(0, 590px);
  }

  .auth-panel {
    border-radius: 20px;
  }

  .auth-visual {
    display: none;
  }
}

@media (max-width: 620px) {
  .auth-page {
    align-items: stretch;
    padding: 0;
  }

  .auth-shell {
    min-height: 100svh;
  }

  .auth-panel {
    width: 100%;
    height: auto;
    min-height: 100svh;
    gap: 28px;
    justify-content: flex-start;
    padding: 24px max(20px, calc((100vw - 390px) / 2)) 28px;
    border-radius: 0;
    overflow: visible;
  }

  .auth-panel[data-view="signup"],
  .auth-panel[data-view="signin"] {
    gap: 26px;
  }

  .auth-brand {
    width: 100%;
  }

  .auth-heading,
  .auth-tabs,
  .auth-form,
  .auth-field,
  .signin-options,
  .auth-divider,
  .google-button,
  .auth-legal,
  .verification-step,
  .verification-state,
  .verification-intro,
  .verification-actions,
  .verification-recovery,
  .pending-state,
  .action-state,
  .action-intro,
  .auth-primary {
    width: 100%;
    max-width: 390px;
  }

  .auth-tabs {
    margin-top: 0;
  }

  .auth-tab {
    width: calc(50% - 2px);
    flex-basis: calc(50% - 2px);
  }

  .auth-divider span {
    width: calc(50% - 24px);
    flex-basis: calc(50% - 24px);
  }

  .auth-legal {
    flex-wrap: wrap;
    padding-top: 0;
  }

  .auth-message {
    position: static;
    width: 100%;
    max-width: 390px;
    order: 20;
  }

  .verification-intro p,
  .pending-state p,
  .action-intro p,
  .action-result p,
  .action-processing p,
  .action-note {
    width: min(350px, 100%);
  }

  .verification-recovery p {
    flex-wrap: wrap;
    justify-content: center;
  }
}

@media (max-width: 380px) {
  .auth-panel {
    padding-inline: 16px;
  }

  .auth-heading h1 {
    font-size: 32px;
  }

  .auth-legal {
    font-size: 10px;
  }
}
