/* Tokens come from ../tokens.css. Override only what auth needs custom. */
:root {
  --text: #000000;
  --shadow: 0 14px 44px rgba(0, 0, 0, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
}

.auth-page {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 5vw, 2rem);
}

.auth-card {
  width: min(100%, 27rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: clamp(1.25rem, 5vw, 2rem);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.auth-logo {
  margin: 0;
  font-family: "Times New Roman", Times, serif;
  font-size: clamp(2.6rem, 12vw, 4rem);
  font-weight: 420;
  letter-spacing: 0;
  color: #34487a;
}

.toggle {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem;
  padding: 0.25rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--soft);
}

.toggle__btn {
  min-height: 2.35rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.94rem;
  font-weight: 700;
  cursor: pointer;
}

.toggle__btn--active {
  background: #34487a;
  color: #fff;
}

.initials-preview {
  width: 4.25rem;
  height: 4.25rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #34487a;
  color: #fff;
  font-size: 1.35rem;
  font-weight: 850;
  letter-spacing: -0.04em;
}

.auth-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
}

.auth-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 760;
}

.signup-fields {
  width: 100%;
  display: contents;
}

.field {
  width: min(100%, 20rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.field__label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.field__input {
  width: 100%;
  min-height: 2.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 1rem;
  background: #fff;
  color: var(--text);
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  text-align: center;
  outline: none;
}

.password-field {
  position: relative;
  width: 100%;
}

.password-field__input {
  padding-right: 3rem;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 0.45rem;
  transform: translateY(-50%);
  width: 2.2rem;
  height: 2.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  color: #34487a;
}

.password-toggle:focus-visible {
  outline: 2px solid #34487a;
  outline-offset: 2px;
}

/* Icon reflects current state: crossed eye when hidden (default),
   open eye when password is shown (aria-pressed="true"). */
.password-toggle__show,
.password-toggle[aria-pressed="true"] .password-toggle__hide {
  display: none;
}

.password-toggle[aria-pressed="true"] .password-toggle__show {
  display: block;
}

.field-message {
  width: 100%;
  min-height: 1rem;
  margin: -0.1rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
  text-align: center;
}

.field-message--error {
  color: #b00020;
}

.field-message--success {
  color: #1f7a3f;
}

.field__input:focus {
  border-color: var(--text);
}

.field__input:-webkit-autofill,
.field__input:-webkit-autofill:hover,
.field__input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px #fff inset;
  caret-color: var(--text);
}

.auth-submit {
  width: min(100%, 20rem);
  min-height: 2.9rem;
  border: 1px solid #34487a;
  border-radius: 999px;
  background: #34487a;
  color: #fff;
  font: inherit;
  font-weight: 760;
  cursor: pointer;
}

.auth-submit:disabled {
  opacity: 0.65;
  cursor: wait;
}

.auth-status {
  min-height: 1.1rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
  text-align: center;
}

.auth-status--error {
  color: #b00020;
}

.auth-status--success {
  color: #1f7a3f;
}

.auth-forgot,
.auth-back {
  align-self: center;
  margin-top: -0.35rem;
  padding: 0.25rem 0.5rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 650;
  cursor: pointer;
  text-decoration: underline;
}

.auth-forgot:hover,
.auth-back:hover {
  color: var(--text);
}

.auth-link {
  width: min(100%, 20rem);
  min-height: 2.9rem;
  border: 1px solid #34487a;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #34487a;
  color: #fff;
  font: inherit;
  font-weight: 760;
  text-decoration: none;
}

.hidden {
  display: none !important;
}
