body {
  font-family: var(--font-serif);
  background: #f5f5f0;
}

.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 48px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 1000;
  transition: background 0.3s, border-color 0.3s;
}

.back-link {
  padding: 6px 12px;
  border: 1px solid var(--text-primary);
  background: var(--bg-primary);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s;
}

.back-link:hover {
  background: var(--text-primary);
  color: var(--bg-primary);
}

.top-bar .theme-toggle {
  position: static;
  padding: 6px 12px;
  border: 1px solid var(--text-primary);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s;
  font-family: inherit;
}

.top-bar .theme-toggle:hover {
  background: var(--text-primary);
  color: var(--bg-primary);
}

.container {
  max-width: 420px;
  margin: 0 auto;
  padding: 88px 20px 40px;
}

.auth-card {
  background: #fff;
  border: 1px solid #ddd;
  padding: 40px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

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

.auth-header h2 {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 8px;
}

.auth-header p {
  color: #666;
  font-size: 0.95rem;
}

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

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 8px;
}

.form-group input[type="text"],
.form-group input[type="password"] {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s;
  background: #fff;
}

.form-group input:focus {
  outline: none;
  border-color: #000;
}

.form-group input::placeholder {
  color: #999;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: normal;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.checkbox-label span {
  font-size: 0.9rem;
}

.form-error {
  display: block;
  color: #dc3545;
  font-size: 0.8rem;
  margin-top: 4px;
  min-height: 18px;
}

.submit-btn {
  width: 100%;
  padding: 14px;
  background: #000;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 8px;
}

.submit-btn:hover {
  background: #333;
}

.submit-btn.secondary {
  background: transparent;
  color: #000;
  border: 1px solid #000;
}

.submit-btn.secondary:hover {
  background: #f5f5f0;
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid #eee;
}

.auth-footer p {
  color: #666;
  font-size: 0.9rem;
}

.auth-footer a {
  color: #000;
  font-weight: 500;
}

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

[data-theme="dark"] body {
  background: #1a1a1a;
}

[data-theme="dark"] .auth-card {
  background: #222;
  border-color: #444;
}

[data-theme="dark"] .auth-header h2 {
  color: #e8e8e8;
}

[data-theme="dark"] .auth-header p,
[data-theme="dark"] .auth-footer p {
  color: #888;
}

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

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

[data-theme="dark"] .form-group input[type="text"],
[data-theme="dark"] .form-group input[type="password"] {
  background: #161b22;
  border-color: #444;
  color: #e8e8e8;
}

[data-theme="dark"] .form-group input:focus {
  border-color: #fff;
}

[data-theme="dark"] .submit-btn {
  background: #fff;
  color: #000;
}

[data-theme="dark"] .submit-btn:hover {
  background: #ccc;
}

@media screen and (max-width: 768px) {
  .container {
    padding: 72px 16px 24px;
  }

  .auth-card {
    padding: 24px;
  }

  .auth-header h2 {
    font-size: 1.3rem;
  }
}

.custom-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 4000;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.custom-modal-overlay.active {
  display: flex;
  opacity: 1;
}

.custom-modal {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 24px 28px;
  min-width: 320px;
  max-width: 90vw;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  transform: scale(0.95);
  transition: transform 0.2s ease;
}

.custom-modal-overlay.active .custom-modal {
  transform: scale(1);
}

.custom-modal-title {
  font-size: 1.1rem;
  font-weight: bold;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.custom-modal-body {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
}

.custom-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.custom-modal-btn {
  padding: 8px 18px;
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.9rem;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s;
  font-family: inherit;
}

.custom-modal-btn.primary {
  background: var(--text-primary);
  color: var(--bg-primary);
  border-color: var(--text-primary);
}
