/* Les Cinq Rois — design system partagé (DESIGN.md) */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,500;0,600;1,500&family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&display=swap');

:root {
  --bg-deep: #0c0e18;
  --bg-panel: #14182a;
  --bg-elevated: #1a2038;
  --bg-input: rgba(8, 10, 22, 0.72);
  --gold: #d4af37;
  --gold-soft: #e8c96a;
  --gold-dim: #9a7b28;
  --text: #e2e8f4;
  --text-muted: #8b93b8;
  --text-faint: #5c6488;
  --border: rgba(212, 175, 55, 0.18);
  --border-strong: rgba(212, 175, 55, 0.42);
  --success: #3dd68c;
  --danger: #f07178;
  --warning: #e8a84a;
  --info: #6cb6ff;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-card: 0 18px 48px rgba(0, 0, 0, 0.38);
  --shadow-neutral: 0 2px 8px rgba(0, 0, 0, 0.35);
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-ui: 'DM Sans', 'Segoe UI', system-ui, sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

/* Fond ambiant (pages auth / admin) */
.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 55% at 12% -8%, rgba(212, 175, 55, 0.11), transparent 55%),
    radial-gradient(ellipse 60% 45% at 92% 8%, rgba(108, 182, 255, 0.06), transparent 50%),
    linear-gradient(168deg, #0a0c16 0%, #121628 48%, #0e101c 100%);
}

.ambient::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
}

/* Marque */
.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: linear-gradient(145deg, rgba(212, 175, 55, 0.22), rgba(212, 175, 55, 0.06));
  border: 1px solid var(--border-strong);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--gold);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.brand-text h1 {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 600;
  color: var(--gold-soft);
  letter-spacing: 0.02em;
  line-height: 1.1;
  margin: 0;
}

.brand-text p {
  font-size: 0.78rem;
  color: var(--text-faint);
  margin: 2px 0 0;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Page auth (login) */
.auth-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  font-family: var(--font-ui);
  color: var(--text);
  background: var(--bg-deep);
  -webkit-font-smoothing: antialiased;
}

.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  background: linear-gradient(165deg, rgba(26, 32, 56, 0.96) 0%, rgba(20, 24, 42, 0.98) 100%);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 32px 28px 28px;
  box-shadow: var(--shadow-card);
  animation: theme-rise 0.55s var(--ease-out) both;
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.35), transparent);
}

.auth-intro {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.auth-intro h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--gold-soft);
  margin: 0 0 6px;
  font-weight: 600;
}

.auth-intro p {
  font-size: 0.86rem;
  color: var(--text-muted);
  margin: 0;
}

.brand-credit {
  position: fixed;
  bottom: 10px;
  right: 14px;
  font-size: 0.7rem;
  color: rgba(212, 175, 55, 0.55);
  font-style: italic;
  letter-spacing: 0.03em;
  pointer-events: none;
  z-index: 100;
  user-select: none;
}

/* Champs & boutons partagés */
.field-label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  letter-spacing: 0.03em;
  font-weight: 500;
}

.field-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 11px 13px;
  font-size: 0.9rem;
  font-family: inherit;
  margin-bottom: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
}

.field-input::placeholder { color: var(--text-faint); }

.field-input:focus {
  border-color: rgba(212, 175, 55, 0.55);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35);
}

.theme-btn {
  padding: 11px 18px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.15s var(--ease-out), box-shadow 0.2s, background 0.2s;
  -webkit-appearance: none;
}

.theme-btn:active { transform: scale(0.98); }

.theme-btn-gold {
  background: linear-gradient(145deg, #a8840a, var(--gold));
  color: #141018;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset, 0 2px 6px rgba(0, 0, 0, 0.35);
}

.theme-btn-gold:hover {
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.22) inset, 0 4px 12px rgba(0, 0, 0, 0.42);
}

.theme-btn-block { width: 100%; }

.theme-alert {
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.84rem;
  margin-bottom: 14px;
  display: none;
}

.theme-alert-error {
  background: rgba(240, 113, 120, 0.1);
  border: 1px solid rgba(240, 113, 120, 0.35);
  color: var(--danger);
}

.theme-hint {
  text-align: center;
  margin-top: 18px;
  font-size: 0.78rem;
  color: var(--text-faint);
}

@keyframes theme-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .auth-card { animation: none; }
}

.link-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--gold-soft);
  text-decoration: underline;
  cursor: pointer;
}

.link-btn:hover { color: var(--gold); }

.theme-alert-success {
  background: rgba(61, 214, 140, 0.1);
  border: 1px solid rgba(61, 214, 140, 0.35);
  color: var(--success);
}

.auth-panel h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--gold-soft);
  margin: 0 0 8px;
  font-weight: 600;
}

.auth-panel p {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin: 0 0 14px;
}

.theme-btn-danger {
  background: rgba(240, 113, 120, 0.15);
  border: 1px solid rgba(240, 113, 120, 0.4);
  color: var(--danger);
}

.theme-btn-danger:hover {
  background: rgba(240, 113, 120, 0.22);
}

.footer-links {
  text-align: center;
  margin-top: 20px;
  font-size: 0.75rem;
  color: var(--text-faint);
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
}

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

.show-pwd-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: -8px 0 12px;
  cursor: pointer;
}

.show-pwd-check input { width: auto; margin: 0; accent-color: var(--gold); }

.pwd-match-hint {
  display: block;
  font-size: 0.8rem;
  margin: -10px 0 14px;
  min-height: 1.1em;
}

.pwd-match-ok { color: var(--success); }
.pwd-match-bad { color: var(--danger); }

input.pwd-mismatch { border-color: rgba(240, 113, 120, 0.65) !important; }
input.pwd-match { border-color: rgba(61, 214, 140, 0.55) !important; }

.hp-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.delete-warning {
  font-size: 0.82rem;
  color: var(--danger);
  margin-bottom: 12px;
}
