/* Detectives AI — shared base theme (noir) */

@import url("https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700;900&family=Source+Sans+Pro:wght@300;400;600;700&family=Special+Elite&display=swap");

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  line-height: 1.5;
  font-family: "Source Sans Pro", system-ui, sans-serif;
  font-weight: 400;
  background-color: var(--darker);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

input,
button,
textarea,
select {
  font: inherit;
}

a {
  color: inherit;
}

ul,
ol {
  list-style: none;
}

:root {
  --gold: #c9a84c;
  --gold-light: #e8d48b;
  --dark: #1a1a2e;
  --darker: #0f0f1f;
  --panel-blue: #16213e;
  --panel-mid: #1e2a4a;
  --red: #8b2500;
  --green: #2d6a4f;
  --green-light: #40916c;
  --text: #e8e8e8;
  --muted: #888;
  --border-subtle: #2a2a3e;
}

/* Forms */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="tel"],
input[type="url"],
textarea,
select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  background-color: #0f0f1f;
  border: 1px solid #333;
  border-radius: 6px;
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(201, 168, 76, 0.25);
}

input::placeholder,
textarea::placeholder {
  color: var(--muted);
}

label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
  color: var(--text);
}

/* Form groups */
.form-group {
  margin-bottom: 1rem;
}

.form-input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  background-color: #0f0f1f;
  border: 1px solid #333;
  border-radius: 6px;
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(201, 168, 76, 0.25);
}

.form-error {
  margin-top: 0.35rem;
  padding: 0.35rem 0.6rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #f0a0a0;
  background: rgba(139, 37, 0, 0.15);
  border-left: 3px solid var(--red);
  border-radius: 4px;
}

.non-field-errors {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #f0a0a0;
  background: rgba(139, 37, 0, 0.15);
  border: 1px solid var(--red);
  border-radius: 6px;
}

/* Buttons — match original index.html / admin.html */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: 6px;
  font-weight: 700;
  font-family: "Source Sans Pro", sans-serif;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease,
    border-color 0.2s ease, color 0.2s ease;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--dark);
  border: none;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0.85rem 1.75rem;
  box-shadow: none;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(201, 168, 76, 0.35);
}

.btn-outline {
  background: none;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-weight: 600;
}

.btn-outline:hover:not(:disabled) {
  background: var(--gold);
  color: var(--dark);
  border-color: var(--gold);
}

.btn-green {
  background: linear-gradient(135deg, var(--green), #40916c);
  color: #fff;
  border: none;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.btn-green:hover:not(:disabled) {
  box-shadow: 0 4px 20px rgba(45, 106, 79, 0.35);
  transform: translateY(-1px);
}

.btn-danger {
  background: none;
  border: 1px solid var(--red);
  color: var(--red);
  font-size: 0.85em;
  font-weight: 600;
}

.btn-danger:hover:not(:disabled) {
  background: rgba(139, 37, 0, 0.12);
  color: #e07050;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%) translateY(120%);
  z-index: 9999;
  min-width: min(90vw, 320px);
  max-width: min(90vw, 420px);
  padding: 0.85rem 1.25rem;
  border-radius: 8px;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--dark);
  color: var(--text);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease,
    visibility 0.3s ease;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  visibility: visible;
}

.toast.success {
  border-color: var(--green-light);
  background: linear-gradient(160deg, rgba(45, 106, 79, 0.35), var(--dark));
  color: #c8e6d4;
}

.toast.error {
  border-color: var(--red);
  background: linear-gradient(160deg, rgba(139, 37, 0, 0.35), var(--dark));
  color: #f0c4b8;
}

/* Loading spinner */
.loading {
  display: inline-block;
  width: 1.5rem;
  height: 1.5rem;
  border: 3px solid rgba(201, 168, 76, 0.25);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: loading-spin 0.75s linear infinite;
  vertical-align: middle;
}

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

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  border: 1px solid #333;
}

.badge-active {
  background: rgba(45, 106, 79, 0.35);
  color: #a8dcc4;
  border-color: var(--green);
}

.badge-closed {
  background: rgba(136, 136, 136, 0.15);
  color: var(--muted);
  border-color: #555;
}

/* Auth forms — Catalogue Caper / index.html style */
.signup-screen .form-group label,
.login-screen .form-group label {
  color: var(--gold);
  font-size: 0.85em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.signup-screen .form-input,
.login-screen .form-input {
  padding: 12px 16px;
  font-size: 1em;
  font-family: "Source Sans Pro", sans-serif;
}

.signup-screen .form-input::placeholder,
.login-screen .form-input::placeholder {
  color: #555;
  font-style: normal;
}

.auth-card .auth-title {
  font-family: "Playfair Display", Georgia, serif;
  color: var(--gold);
  font-size: 1.75em;
  font-weight: 900;
  margin-bottom: 0.5rem;
}

.auth-card .auth-subtitle {
  color: var(--muted);
  font-size: 0.95em;
  line-height: 1.5;
  margin-bottom: 1.75rem;
}

.auth-badge-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.25rem;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2em;
  line-height: 1;
  box-shadow: 0 8px 28px rgba(201, 168, 76, 0.25);
}

.auth-submit-btn {
  width: 100%;
  margin-top: 10px;
}

.auth-card.auth-card-narrow {
  max-width: 400px;
}

.auth-title.is-smaller {
  font-size: 1.35rem;
}

/* Responsive */
@media (max-width: 600px) {
  body {
    font-size: 0.95rem;
  }

  .btn {
    padding: 0.55rem 1rem;
    font-size: 0.9rem;
  }

  .toast {
    bottom: 1rem;
    min-width: calc(100vw - 2rem);
  }
}
