:root {
  --ink:    #0a0a0c;
  --deep:   #131318;
  --silk:   #e8e6e0;
  --stone:  #5a5a56;
  --gold:   #c4974a;
  --border: #1f1f24;
  --bear:   #e05a52;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--ink);
  color: var(--silk);
  font-family: 'Jost', sans-serif;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-shell {
  width: 100%;
  padding: 24px;
  display: flex;
  justify-content: center;
}

.login-card {
  width: 100%;
  max-width: 360px;
  background: var(--deep);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 44px 36px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.login-mark {
  font-family: 'Cormorant', serif;
  font-weight: 300;
  font-size: 28px;
  letter-spacing: 0.32em;
  color: var(--silk);
}

.login-rule {
  width: 32px;
  height: 1px;
  background: var(--gold);
  margin: 16px 0 32px;
}

#login-form,
#signup-form {
  width: 100%;
  display: flex;
  flex-direction: column;
}

.login-label {
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--stone);
  margin-bottom: 10px;
}

.login-input {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--silk);
  font-family: 'Jost', sans-serif;
  font-size: 16px;
  padding: 8px 0;
  outline: none;
  letter-spacing: 0.1em;
  transition: border-color .2s, box-shadow .2s;
}

.login-input:focus {
  border-bottom-color: var(--gold);
  box-shadow: 0 1px 0 0 var(--gold);
}

.login-input + .login-label,
.pw-field + .login-label {
  margin-top: 18px;
}

/* Password field + reveal toggle. The input is wrapped in .pw-field (by
   pw-toggle.js) so the eye button can sit inside the field; the type-flip is
   the only mutation, never persisted. */
.pw-field {
  position: relative;
  width: 100%;
}

.pw-field .login-input {
  width: 100%;
  padding-right: 30px;   /* keep typed text clear of the toggle */
}

.pw-toggle {
  position: absolute;
  right: 0;
  bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--stone);
  transition: color .2s;
}

.pw-toggle:hover,
.pw-toggle:focus-visible { color: var(--gold); }

.pw-toggle:focus-visible {
  outline: 1px solid var(--gold);
  outline-offset: 2px;
  border-radius: 2px;
}

.pw-toggle svg {
  display: block;
  width: 18px;
  height: 18px;
}

.login-error {
  min-height: 18px;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--bear);
  margin: 14px 0 8px;
}

.login-button {
  margin-top: 16px;
  padding: 12px 0;
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 2px;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.32em;
  cursor: pointer;
  transition: background .2s, transform .1s;
}

.login-button:hover  { background: rgba(196, 151, 74, 0.08); }
.login-button:active { transform: translateY(1px); }

.login-switch {
  margin-top: 22px;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--stone);
  text-align: center;
}

.login-switch a {
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}

.login-switch a:hover { border-bottom-color: var(--gold); }

.login-card.shake {
  animation: shake .35s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
