.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f8f6f3 0%, #f0ece5 100%);
  padding: 24px;
  transition: background 0.2s ease;
}

.login-card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  padding: 48px;
  max-width: 420px;
  width: 100%;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.login-monogram {
  font-family: 'Playfair Display', serif;
  font-size: 48px;
  color: #8b7355;
  margin-bottom: 8px;
}

.login-title {
  font-size: 24px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0 0 4px 0;
  transition: color 0.2s ease;
}

.login-subtitle {
  font-size: 14px;
  color: #666;
  margin: 0;
  transition: color 0.2s ease;
}

.login-form {
  margin-top: 32px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #333;
  margin-bottom: 8px;
  transition: color 0.2s ease;
}

.form-group input {
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: white;
  color: #1a1a1a;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s, color 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: #8b7355;
  box-shadow: 0 0 0 3px rgba(139, 115, 85, 0.1);
}

.login-btn {
  width: 100%;
  padding: 16px;
  font-size: 16px;
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, #8b7355 0%, #6b5a45 100%);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.login-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139, 115, 85, 0.3);
}

.login-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.login-actions {
  display: grid;
  gap: 12px;
  margin-top: 8px;
}

.login-secondary-btn {
  width: 100%;
  min-height: 46px;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 600;
  color: #6b5a45;
  background: #fff;
  border: 1px solid rgba(139, 115, 85, 0.28);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.login-secondary-btn:hover {
  border-color: rgba(139, 115, 85, 0.52);
  box-shadow: 0 2px 10px rgba(139, 115, 85, 0.12);
}

.login-secondary-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.login-help-text {
  color: #777;
  font-size: 13px;
  line-height: 1.5;
  margin: 10px 0 0;
  text-align: center;
}

.login-message {
  margin-top: 20px;
  padding: 16px;
  border-radius: 8px;
  font-size: 14px;
  text-align: center;
}

.login-message.success {
  background: #e8f5e9;
  color: #2e7d32;
}

.login-message.error {
  background: #ffebee;
  color: #c62828;
}

.login-message.info {
  background: #e3f2fd;
  color: #1565c0;
}

.login-message-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 12px;
}

.login-inline-action {
  border: 1px solid rgba(21, 101, 192, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: #1565c0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-weight: 600;
  min-height: 34px;
  padding: 7px 14px;
  text-decoration: none;
}

.login-inline-action.secondary {
  background: transparent;
}

.login-footer {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid #eee;
  text-align: center;
  font-size: 13px;
  color: #888;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.login-footer a {
  color: #8b7355;
  text-decoration: none;
}

.login-footer a:hover {
  text-decoration: underline;
}

/* Token verification state */
.verifying-token {
  text-align: center;
  padding: 32px 0;
  color: #666;
  transition: color 0.2s ease;
}

.verifying-token .spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #eee;
  border-top-color: #8b7355;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
  transition: border-color 0.2s ease;
}

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

.password-setup {
  margin-top: 24px;
}

.password-setup-title {
  color: #1a1a1a;
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 8px;
  text-align: center;
}

.password-setup-copy {
  color: #666;
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 20px;
  text-align: center;
}

.password-setup-actions {
  display: grid;
  gap: 12px;
  margin-top: 8px;
}

.hidden {
  display: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Theme toggle button */
.theme-toggle-login {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.theme-toggle-login:hover {
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.theme-toggle-login .icon-sun,
.theme-toggle-login .icon-moon {
  display: none;
}

/* Dark mode styles */
[data-theme="dark"] .login-page {
  background: linear-gradient(135deg, #121212 0%, #1a1a1a 100%);
}

[data-theme="dark"] .login-card {
  background: #1e1e1e;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .login-monogram {
  color: #b89b7a;
}

[data-theme="dark"] .login-title {
  color: #e8e8e8;
}

[data-theme="dark"] .login-subtitle {
  color: #a0a0a0;
}

[data-theme="dark"] .form-group label {
  color: #e8e8e8;
}

[data-theme="dark"] .form-group input {
  background: #252525;
  border-color: #444;
  color: #e8e8e8;
}

[data-theme="dark"] .form-group input:focus {
  border-color: #b89b7a;
  box-shadow: 0 0 0 3px rgba(184, 155, 122, 0.2);
}

[data-theme="dark"] .form-group input::placeholder {
  color: #707070;
}

[data-theme="dark"] .login-btn {
  background: linear-gradient(135deg, #b89b7a 0%, #9a8366 100%);
}

[data-theme="dark"] .login-secondary-btn {
  background: #252525;
  border-color: rgba(184, 155, 122, 0.32);
  color: #d7c0a5;
}

[data-theme="dark"] .login-secondary-btn:hover {
  border-color: rgba(184, 155, 122, 0.58);
  box-shadow: 0 2px 10px rgba(184, 155, 122, 0.14);
}

[data-theme="dark"] .login-help-text,
[data-theme="dark"] .password-setup-copy {
  color: #a0a0a0;
}

[data-theme="dark"] .password-setup-title {
  color: #e8e8e8;
}

[data-theme="dark"] .login-message.success {
  background: rgba(74, 222, 128, 0.15);
  color: #4ade80;
}

[data-theme="dark"] .login-message.error {
  background: rgba(248, 113, 113, 0.15);
  color: #f87171;
}

[data-theme="dark"] .login-message.info {
  background: rgba(96, 165, 250, 0.15);
  color: #60a5fa;
}

[data-theme="dark"] .login-inline-action {
  background: rgba(96, 165, 250, 0.12);
  border-color: rgba(96, 165, 250, 0.28);
  color: #93c5fd;
}

[data-theme="dark"] .login-footer {
  border-top-color: #333;
  color: #707070;
}

[data-theme="dark"] .login-footer a {
  color: #b89b7a;
}

[data-theme="dark"] .verifying-token {
  color: #a0a0a0;
}

[data-theme="dark"] .verifying-token .spinner {
  border-color: #333;
  border-top-color: #b89b7a;
}

[data-theme="dark"] .theme-toggle-login {
  background: rgba(30, 30, 30, 0.9);
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .theme-toggle-login:hover {
  background: #252525;
}

/* Show sun icon in dark mode */
[data-theme="dark"] .theme-toggle-login .icon-sun {
  display: block;
}

/* Show moon icon in light mode */
html:not([data-theme="dark"]) .theme-toggle-login .icon-moon {
  display: block;
}
