/* ══════════════════════════════════════════════
   VARIABLES & RESET
   ══════════════════════════════════════════════ */
:root {
  --gold:         #c9a84c;
  --gold-bright:  #f0c040;
  --gold-dim:     #7a5f25;
  --crimson:      #8b1a1a;
  --bg:           #ffffff;
  --surface:      rgba(10,10,15,0.85);
  --text:         #e8e0d0;
  --muted:        #7a7060;
  --online-color: #3ecf6a;
  --offline-color:#cf3e3e;
}

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

body {
  font-family: 'Rajdhani', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ══════════════════════════════════════════════
   FOND ANIMÉ
   ══════════════════════════════════════════════ */
#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.city-overlay {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% 100%, rgba(139,26,26,0.18) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 20% 80%, rgba(201,168,76,0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(201,168,76,0.06) 0%, transparent 60%),
    linear-gradient(to bottom, rgba(5,5,7,0.4) 0%, rgba(5,5,7,0.1) 40%, rgba(5,5,7,0.7) 100%);
  z-index: 1;
  pointer-events: none;
}

.scanlines {
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.06) 2px,
    rgba(0,0,0,0.06) 4px
  );
  z-index: 2;
  pointer-events: none;
}

/* ══════════════════════════════════════════════
   LAYOUT PRINCIPAL
   ══════════════════════════════════════════════ */
.page {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  gap: 2.5rem;
}

/* ══════════════════════════════════════════════
   TOP BAR
   ══════════════════════════════════════════════ */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2.5rem;
  background: linear-gradient(to bottom, rgba(5,5,7,0.95), transparent);
  border-bottom: 1px solid rgba(201,168,76,0.08);
}

.topbar-brand {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.4rem;
  letter-spacing: 0.15em;
  color: var(--gold);
  text-shadow: 0 0 20px rgba(201,168,76,0.4);
}

.topbar-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(10,10,15,0.8);
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: 999px;
  padding: 0.3rem 0.9rem;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.05em;
}

/* ══════════════════════════════════════════════
   LOGO
   ══════════════════════════════════════════════ */
.logo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
}

.logo-emblem {
  width: 120px;
  height: 120px;
  position: relative;
  margin-bottom: 0.5rem;
}

.logo-emblem svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 30px rgba(201,168,76,0.6));
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

.logo-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(3.5rem, 10vw, 7rem);
  letter-spacing: 0.06em;
  line-height: 0.9;
  color: var(--gold-bright);
  text-shadow:
    0 0 60px rgba(201,168,76,0.5),
    0 0 120px rgba(201,168,76,0.2),
    2px 2px 0 rgba(0,0,0,0.8);
  animation: pulse-logo 4s ease-in-out infinite;
}

@keyframes pulse-logo {
  0%, 100% {
    text-shadow:
      0 0 60px rgba(201,168,76,0.5),
      0 0 120px rgba(201,168,76,0.2),
      2px 2px 0 rgba(0,0,0,0.8);
  }
  50% {
    text-shadow:
      0 0 80px rgba(201,168,76,0.7),
      0 0 160px rgba(201,168,76,0.3),
      2px 2px 0 rgba(0,0,0,0.8);
  }
}

.logo-sub {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  font-size: clamp(0.9rem, 2.5vw, 1.3rem);
  letter-spacing: 0.5em;
  color: var(--muted);
  text-transform: uppercase;
}

/* ══════════════════════════════════════════════
   CARTE STATUT
   ══════════════════════════════════════════════ */
.status-card {
  width: min(520px, 100%);
  background: var(--surface);
  border: 1px solid rgba(201,168,76,0.2);
  border-top: 2px solid var(--gold-dim);
  border-radius: 4px;
  padding: 1.5rem 2rem;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.status-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.5;
}

.status-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 12px,
    rgba(201,168,76,0.015) 12px,
    rgba(201,168,76,0.015) 13px
  );
  pointer-events: none;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid rgba(201,168,76,0.12);
}

.card-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: var(--muted);
  text-transform: uppercase;
}

/* ── Badge statut ── */
.status-badge {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  padding: 0.25rem 0.8rem;
  border-radius: 2px;
  transition: all 0.4s;
}

.status-badge.online {
  color: var(--online-color);
  background: rgba(62,207,106,0.1);
  border: 1px solid rgba(62,207,106,0.3);
}

.status-badge.offline {
  color: var(--offline-color);
  background: rgba(207,62,62,0.1);
  border: 1px solid rgba(207,62,62,0.3);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.status-badge.online .status-dot {
  box-shadow: 0 0 0 0 currentColor;
  animation: ping 1.5s ease-out infinite;
}

@keyframes ping {
  0%   { box-shadow: 0 0 0 0 rgba(62,207,106,0.6); }
  100% { box-shadow: 0 0 0 8px rgba(62,207,106,0); }
}

/* ── Statistiques ── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.stat-box {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.stat-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  color: var(--muted);
  text-transform: uppercase;
}

.stat-value {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2rem;
  letter-spacing: 0.05em;
  color: var(--gold-bright);
  line-height: 1;
  transition: all 0.5s;
}

.stat-unit {
  font-size: 0.7rem;
  font-family: 'Rajdhani', sans-serif;
  color: var(--muted);
  margin-top: 0.1rem;
}

/* ── Barre de charge ── */
.bar-wrap {
  width: 100%;
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 0.4rem;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold-bright));
  border-radius: 2px;
  transition: width 1s ease;
  width: 0%;
}

.bar-meta {
  display: flex;
  justify-content: space-between;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.62rem;
  color: var(--muted);
}

/* ── Rangée IP ── */
.ip-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1rem;
  padding-top: 0.8rem;
  border-top: 1px solid rgba(201,168,76,0.08);
}

.ip-text {
  flex: 1;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.75rem;
  color: var(--text);
  letter-spacing: 0.05em;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(201,168,76,0.12);
  border-radius: 2px;
  padding: 0.45rem 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-copy {
  background: rgba(201,168,76,0.1);
  border: 1px solid rgba(201,168,76,0.25);
  color: var(--gold);
  border-radius: 2px;
  padding: 0.45rem 0.9rem;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-copy:hover {
  background: rgba(201,168,76,0.2);
  border-color: var(--gold);
  color: var(--gold-bright);
}

/* ── Refresh ── */
.refresh-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.7rem;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.6rem;
  color: var(--muted);
  opacity: 0.7;
}

.refresh-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--muted);
  animation: blink 2s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.2; }
}

/* ══════════════════════════════════════════════
   BOUTONS D'ACTION
   ══════════════════════════════════════════════ */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 2.2rem;
  border-radius: 2px;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.12em;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-transform: uppercase;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.08);
  opacity: 0;
  transition: opacity 0.2s;
}

.btn:hover::after { opacity: 1; }
.btn:active       { transform: scale(0.97); }

.btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex-shrink: 0;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold-dim), var(--gold));
  color: #050507;
  box-shadow: 0 4px 30px rgba(201,168,76,0.3);
}

.btn-primary:hover {
  box-shadow: 0 6px 40px rgba(201,168,76,0.5);
  transform: translateY(-1px);
}

.btn-discord {
  background: rgba(88,101,242,0.15);
  border: 1px solid rgba(88,101,242,0.4);
  color: #99aaff;
}

.btn-discord:hover {
  background: rgba(88,101,242,0.25);
  border-color: rgba(88,101,242,0.7);
}

.btn-staff {
  background: rgba(201,168,76,0.08);
  border: 1px solid rgba(201,168,76,0.2);
  color: var(--gold);
}

.btn-staff:hover {
  background: rgba(201,168,76,0.16);
  border-color: rgba(201,168,76,0.4);
}

/* ══════════════════════════════════════════════
   DÉCORATIONS & UTILITAIRES
   ══════════════════════════════════════════════ */
.corner {
  position: fixed;
  width: 60px;
  height: 60px;
  z-index: 5;
  opacity: 0.4;
}

.corner::before,
.corner::after {
  content: '';
  position: absolute;
  background: var(--gold-dim);
}

.corner::before { width: 100%; height: 1px; top: 0; left: 0; }
.corner::after  { width: 1px; height: 100%; top: 0; left: 0; }
.corner.tl { top: 16px;    left: 16px; }
.corner.tr { top: 16px;    right: 16px;  transform: scaleX(-1); }
.corner.bl { bottom: 16px; left: 16px;   transform: scaleY(-1); }
.corner.br { bottom: 16px; right: 16px;  transform: scale(-1); }

/* ── Skeleton loader ── */
.skeleton {
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0.03) 25%,
    rgba(255,255,255,0.07) 50%,
    rgba(255,255,255,0.03) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 2px;
  color: transparent;
  user-select: none;
}

@keyframes shimmer {
  0%   { background-position:  200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(60px);
  background: rgba(10,10,15,0.95);
  border: 1px solid rgba(201,168,76,0.3);
  color: var(--gold);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.75rem;
  padding: 0.6rem 1.4rem;
  border-radius: 2px;
  letter-spacing: 0.08em;
  z-index: 999;
  transition: transform 0.3s ease;
  pointer-events: none;
}

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

/* ══════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════ */
@media (max-width: 500px) {
  .stats-row   { grid-template-columns: repeat(2, 1fr); }
  .topbar      { padding: 0.75rem 1rem; }
  .status-card { padding: 1rem 1.2rem; }
  .actions     { gap: 0.7rem; }
  .btn         { padding: 0.75rem 1.5rem; font-size: 0.9rem; }
}

/* ══════════════════════════════════════════════
   MODAL CANDIDATURE STAFF
   ══════════════════════════════════════════════ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5,5,7,0.88);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  width: min(620px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  background: rgba(10,10,14,0.97);
  border: 1px solid rgba(201,168,76,0.25);
  border-top: 2px solid var(--gold);
  border-radius: 4px;
  padding: 2rem 2rem 1.5rem;
  position: relative;
  transform: translateY(24px);
  transition: transform 0.3s ease;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-dim) transparent;
}

.modal-backdrop.open .modal {
  transform: translateY(0);
}

.modal::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.6;
}

/* ── En-tête modal ── */
.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(201,168,76,0.12);
}

.modal-title {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.modal-title h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.8rem;
  letter-spacing: 0.08em;
  color: var(--gold-bright);
  line-height: 1;
}

.modal-title p {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: var(--muted);
  text-transform: uppercase;
}

.modal-close {
  background: none;
  border: 1px solid rgba(201,168,76,0.2);
  color: var(--muted);
  width: 32px;
  height: 32px;
  border-radius: 2px;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
  font-family: monospace;
}

.modal-close:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(201,168,76,0.08);
}

/* ── Formulaire ── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-field.full {
  grid-column: 1 / -1;
}

.form-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.15em;
  color: var(--muted);
  text-transform: uppercase;
}

.form-label span {
  color: var(--gold);
  margin-left: 2px;
}

.form-input,
.form-select,
.form-textarea {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(201,168,76,0.15);
  border-radius: 2px;
  padding: 0.6rem 0.85rem;
  color: var(--text);
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
  width: 100%;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: rgba(201,168,76,0.5);
  background: rgba(201,168,76,0.04);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: rgba(122,112,96,0.5);
  font-size: 0.88rem;
}

.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237a7060' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  padding-right: 2.2rem;
}

.form-select option {
  background: #0a0a0f;
  color: var(--text);
}

.form-textarea {
  resize: vertical;
  min-height: 90px;
  line-height: 1.5;
}

/* ── Compteur de caractères ── */
.char-count {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.58rem;
  color: var(--muted);
  text-align: right;
  letter-spacing: 0.05em;
  opacity: 0.7;
}

.char-count.warn { color: var(--offline-color); }

/* ── Pied de modal ── */
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.4rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(201,168,76,0.08);
  gap: 1rem;
  flex-wrap: wrap;
}

.modal-note {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.6rem;
  color: var(--muted);
  letter-spacing: 0.05em;
  opacity: 0.7;
  flex: 1;
  min-width: 160px;
}

.btn-submit {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.8rem;
  background: linear-gradient(135deg, var(--gold-dim), var(--gold));
  color: #050507;
  border: none;
  border-radius: 2px;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

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

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

.btn-submit svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  flex-shrink: 0;
}

/* ── États de retour ── */
.form-status {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  border-radius: 2px;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  font-size: 0.88rem;
  letter-spacing: 0.05em;
  margin-top: 0.8rem;
}

.form-status.show { display: flex; }

.form-status.success {
  background: rgba(62,207,106,0.1);
  border: 1px solid rgba(62,207,106,0.3);
  color: var(--online-color);
}

.form-status.error {
  background: rgba(207,62,62,0.1);
  border: 1px solid rgba(207,62,62,0.3);
  color: var(--offline-color);
}

.form-status svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  flex-shrink: 0;
}

/* ── Spinner ── */
.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(5,5,7,0.3);
  border-top-color: #050507;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
  flex-shrink: 0;
}

.btn-submit.loading .spinner { display: block; }
.btn-submit.loading .btn-icon { display: none; }

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

/* ── Séparateur de section ── */
.form-section-title {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  color: var(--gold-dim);
  text-transform: uppercase;
  grid-column: 1 / -1;
  padding-top: 0.4rem;
  border-top: 1px solid rgba(201,168,76,0.08);
  margin-top: 0.2rem;
}

/* ── Responsive modal ── */
@media (max-width: 500px) {
  .form-grid      { grid-template-columns: 1fr; }
  .modal          { padding: 1.2rem; }
  .modal-footer   { flex-direction: column; align-items: stretch; }
  .btn-submit     { justify-content: center; }
}
