:root {
  color-scheme: dark;
  --gold: #c9a227;
  --gold-light: #d4b84a;
  --gold-dark: #a68821;
  --black: #0a0a0a;
  --black-light: #1a1a1a;
  --gray-100: #f5f5f5;
  --gray-400: #a0a0a0;
  --gray-600: #666666;
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  margin: 0;
  padding: 0;
  background: linear-gradient(135deg, var(--black) 0%, var(--black-light) 50%, var(--black) 100%);
  color: #fff;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(ellipse at center top, rgba(201, 162, 39, 0.08) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.auth-shell {
  position: relative;
  z-index: 1;
  max-width: 440px;
  width: 100%;
  margin: 48px 20px;
  display: grid;
  gap: 24px;
  background: rgba(26, 26, 26, 0.95);
  padding: 40px 36px;
  border-radius: 20px;
  border: 1px solid rgba(201, 162, 39, 0.2);
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.5),
    0 0 100px rgba(201, 162, 39, 0.05);
  backdrop-filter: blur(20px);
}

.auth-logo {
  text-align: center;
  margin-bottom: 8px;
}

.auth-logo img {
  height: 213px;
  width: auto;
  filter: drop-shadow(0 4px 20px rgba(201, 162, 39, 0.3));
}

.auth-logo h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2rem;
  color: var(--gold);
  margin: 16px 0 0;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.auth-lede {
  color: var(--gray-400);
  margin: 0;
  line-height: 1.6;
  text-align: center;
  font-size: 15px;
}

.auth-form {
  display: grid;
  gap: 20px;
}

.auth-form--secondary {
  padding-top: 20px;
  border-top: 1px solid rgba(201, 162, 39, 0.15);
  margin-top: 8px;
}

.form-group {
  display: grid;
  gap: 8px;
}

.auth-label {
  font-weight: 600;
  font-size: 13px;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

input,
button {
  padding: 14px 16px;
  font-size: 16px;
  border-radius: 12px;
}

input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  transition: all 0.2s ease;
}

input::placeholder {
  color: var(--gray-600);
}

input:focus {
  outline: none;
  border-color: var(--gold);
  background: rgba(201, 162, 39, 0.05);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.15);
}

input:hover:not(:focus) {
  border-color: rgba(255, 255, 255, 0.2);
}

/* Password input wrapper */
.password-wrapper {
  position: relative;
}

.password-wrapper input {
  width: 100%;
  padding-right: 50px;
}

.password-toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  color: var(--gray-400);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: none;
  border-radius: 4px;
}

.password-toggle:hover {
  color: var(--gold);
  transform: translateY(-50%);
  box-shadow: none;
}

button {
  border: none;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: var(--black);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 8px 24px rgba(201, 162, 39, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 14px;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(201, 162, 39, 0.4);
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 100%);
}

button:active {
  transform: translateY(0);
  box-shadow: 0 4px 16px rgba(201, 162, 39, 0.3);
}

.auth-link-btn {
  background: transparent;
  color: var(--gold);
  box-shadow: none;
  padding: 8px 0;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  text-transform: none;
  letter-spacing: 0;
}

.auth-link-btn:hover {
  transform: none;
  box-shadow: none;
  text-decoration: underline;
  background: transparent;
  color: var(--gold-light);
}

small {
  color: var(--gray-600);
  font-size: 13px;
}

.auth-message {
  min-height: 24px;
  color: #fff;
  text-align: center;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
}

.auth-message:empty {
  display: none;
}

.auth-message.error {
  background: rgba(185, 28, 28, 0.15);
  color: #f87171;
  border: 1px solid rgba(185, 28, 28, 0.3);
}

.auth-message.success {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.magic-link-availability {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 16px;
  border-radius: 14px;
  display: grid;
  gap: 10px;
}

.magic-link-status {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.status-chip.enabled {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.3);
}
}

.status-chip.disabled {
  background: rgba(185, 28, 28, 0.15);
  color: #f87171;
  border-color: rgba(185, 28, 28, 0.3);
}

.status-chip.restricted {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.3);
}

.role-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(201, 162, 39, 0.15);
  color: var(--gold);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  border: 1px solid rgba(201, 162, 39, 0.3);
}

.auth-hint {
  margin: 0;
  color: var(--gray-400);
  line-height: 1.6;
  font-size: 14px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--gray-600);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}

.is-hidden {
  display: none !important;
}

/* Subtle animation for the shell */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-shell {
  animation: fadeInUp 0.5s ease-out;
}

/* Footer link */
.auth-footer {
  text-align: center;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.auth-footer a {
  color: var(--gray-400);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.2s;
}

.auth-footer a:hover {
  color: var(--gold);
}
