@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

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

:root {
  --primary:      #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: rgba(99,102,241,0.14);
  --primary-glow:  rgba(99,102,241,0.35);
  --accent:        #22d3ee;
  --accent-glow:   rgba(34,211,238,0.25);

  --success:       #10b981;
  --success-light: rgba(16,185,129,0.12);
  --warning:       #f59e0b;
  --warning-light: rgba(245,158,11,0.12);
  --danger:        #ef4444;
  --danger-light:  rgba(239,68,68,0.12);

  --text:   #e2e8f0;
  --text-2: #94a3b8;
  --text-3: #475569;

  --bg:     #07090f;
  --card:   rgba(255,255,255,0.035);
  --border: rgba(255,255,255,0.08);

  --shadow-sm: 0 1px 4px rgba(0,0,0,0.6);
  --shadow:    0 4px 24px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.05);
  --shadow-lg: 0 20px 50px rgba(0,0,0,0.7), 0 4px 12px rgba(0,0,0,0.4);
  --radius:    14px;
  --radius-sm:  9px;
}

/* ── ANIMATIONS ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 16px var(--primary-glow); }
  50%       { box-shadow: 0 0 32px rgba(99,102,241,0.55), 0 0 64px rgba(99,102,241,0.2); }
}
@keyframes scanline {
  from { transform: translateY(-100%); }
  to   { transform: translateY(100vh); }
}
@keyframes borderGlow {
  0%, 100% { border-color: rgba(255,255,255,0.08); }
  50%       { border-color: rgba(99,102,241,0.35); }
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  background-image:
    linear-gradient(rgba(255,255,255,.016) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.016) 1px, transparent 1px);
  background-size: 64px 64px;
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Ambient top glow */
body::before {
  content: '';
  position: fixed;
  top: -250px; left: 50%;
  transform: translateX(-50%);
  width: 1000px; height: 700px;
  background: radial-gradient(ellipse, rgba(99,102,241,0.07) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ── NAVBAR ── */
.navbar {
  background: rgba(7,9,15,0.75);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
  height: 62px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 200;
  animation: fadeIn 0.4s ease-out;
}
.navbar .brand {
  text-decoration: none;
  display: flex;
  align-items: center;
}
.navbar .brand img {
  height: 44px;
  width: auto;
  display: block;
}
.navbar nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.navbar nav a {
  color: var(--text-2);
  text-decoration: none;
  font-size: 0.875em;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  transition: color .15s, background .15s;
}
.navbar nav a:hover { color: var(--text); background: rgba(255,255,255,.06); }
.navbar nav span.nav-email {
  color: var(--text-3);
  font-size: 0.82em;
  padding: 0 8px;
}
.navbar nav .btn-nav {
  background: var(--primary);
  color: #fff;
  padding: 7px 16px;
  border-radius: 8px;
  font-size: 0.875em;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s, box-shadow .2s;
}
.navbar nav .btn-nav:hover {
  background: var(--primary-dark);
  color: #fff;
  box-shadow: 0 0 18px var(--primary-glow);
}

/* ── LAYOUT ── */
.container    { max-width: 900px;  margin: 0 auto; padding: 36px 24px; position: relative; z-index: 1; animation: fadeUp 0.5s ease-out; }
.container-sm { max-width: 480px;  margin: 0 auto; padding: 56px 24px; position: relative; z-index: 1; animation: fadeUp 0.5s ease-out; }
.container-xs { max-width: 380px;  margin: 0 auto; padding: 56px 24px; position: relative; z-index: 1; animation: fadeUp 0.5s ease-out; }

/* ── CARDS ── */
.card {
  background: var(--card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 32px;
  margin-bottom: 20px;
  transition: border-color .25s, box-shadow .25s;
  position: relative;
  z-index: 1;
}
.card:hover {
  border-color: rgba(255,255,255,0.13);
  box-shadow: 0 8px 32px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.07);
}
.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.card-header > div { flex: 1; min-width: 0; }

/* ── TYPOGRAPHY ── */
h1 {
  font-size: 1.65em;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.2;
}
h2 {
  font-size: 1.1em;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}
h3 { font-size: .95em; font-weight: 600; color: var(--text); }
.subtitle { color: var(--text-2); font-size: 0.9em; margin-bottom: 24px; }
.text-muted { color: var(--text-3); font-size: 0.875em; }

/* ── FORMS ── */
.form-group { margin-top: 18px; }

label {
  display: block;
  font-size: 0.8em;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
  margin-top: 18px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
select,
textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95em;
  font-family: inherit;
  color: var(--text);
  background: rgba(255,255,255,0.04);
  transition: border-color .15s, box-shadow .2s, background .15s;
  appearance: none;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(99,102,241,0.06);
  box-shadow: 0 0 0 3px rgba(99,102,241,.14), 0 0 16px rgba(99,102,241,.08);
}
input::placeholder { color: var(--text-3); }
textarea { min-height: 90px; resize: vertical; }

select {
  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='%2394a3b8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
select option { background: #0d1117; color: var(--text); }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9em;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, transform .1s, box-shadow .2s;
  letter-spacing: -0.01em;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.18) 0%, transparent 60%);
  opacity: 0;
  transition: opacity .2s;
}
.btn:hover::after { opacity: 1; }
.btn:hover {
  background: var(--primary-dark);
  box-shadow: 0 0 22px var(--primary-glow), 0 4px 14px rgba(99,102,241,.22);
  transform: translateY(-1px);
}
.btn:active { transform: scale(.97) translateY(0); }

.btn-full  { width: 100%; margin-top: 24px; padding: 13px; font-size: 1em; }
.btn-sm    { padding: 7px 14px; font-size: 0.82em; border-radius: 6px; }
.btn-xs    { padding: 4px 10px; font-size: 0.78em; border-radius: 5px; }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid rgba(99,102,241,0.4);
  box-shadow: none;
}
.btn-outline:hover {
  background: rgba(99,102,241,0.1);
  border-color: var(--primary);
  box-shadow: 0 0 16px rgba(99,102,241,.2);
}

.btn-ghost {
  background: rgba(255,255,255,0.04);
  color: var(--text-2);
  border: 1.5px solid var(--border);
  box-shadow: none;
}
.btn-ghost:hover {
  background: rgba(255,255,255,0.07);
  color: var(--text);
  border-color: rgba(255,255,255,0.14);
  box-shadow: none;
}

.btn-danger  { background: var(--danger); }
.btn-danger:hover { background: #dc2626; box-shadow: 0 0 18px rgba(239,68,68,.35), 0 4px 12px rgba(239,68,68,.2); }

.btn-success { background: var(--success); }
.btn-success:hover { background: #059669; box-shadow: 0 0 18px rgba(16,185,129,.35), 0 4px 12px rgba(16,185,129,.2); }

/* ── ALERTS ── */
.alert {
  display: none;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875em;
  font-weight: 500;
  margin-top: 14px;
  line-height: 1.5;
  border-left: 3px solid;
}
.alert-error   { background: var(--danger-light);  color: #fca5a5; border-color: var(--danger); }
.alert-success { background: var(--success-light); color: #6ee7b7; border-color: var(--success); }
.alert-info    { background: var(--primary-light); color: #a5b4fc; border-color: var(--primary); }
.alert-warning { background: var(--warning-light); color: #fcd34d; border-color: var(--warning); }

/* ── BADGES ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.badge-green   { background: var(--success-light); color: #34d399; border: 1px solid rgba(16,185,129,0.3); }
.badge-orange  { background: var(--warning-light); color: #fbbf24; border: 1px solid rgba(245,158,11,0.3); }
.badge-red     { background: var(--danger-light);  color: #f87171; border: 1px solid rgba(239,68,68,0.3); }
.badge-blue    { background: var(--primary-light); color: #a5b4fc; border: 1px solid rgba(99,102,241,0.3); }
.badge-gray    { background: rgba(255,255,255,0.06); color: var(--text-2); border: 1px solid var(--border); }

/* ── TABLES ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead tr { border-bottom: 1px solid var(--border); }
th {
  text-align: left;
  padding: 10px 14px;
  font-size: 0.75em;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 700;
  white-space: nowrap;
}
td { padding: 13px 14px; border-bottom: 1px solid rgba(255,255,255,0.04); font-size: 0.9em; vertical-align: middle; color: var(--text); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: rgba(255,255,255,0.025); }

/* ── EMPTY STATE ── */
.empty {
  text-align: center;
  padding: 56px 24px;
  color: var(--text-3);
}
.empty-icon { font-size: 2.5em; margin-bottom: 14px; opacity: .35; }
.empty p { font-size: 0.9em; line-height: 1.6; }

/* ── FILE UPLOAD ── */
.file-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.file-row {
  display: grid;
  grid-template-columns: 1fr 170px 36px;
  gap: 8px;
  align-items: center;
}
.file-row input[type="file"],
.file-row select { margin-top: 0; font-size: 0.875em; padding: 9px 12px; }
.btn-remove {
  width: 36px; height: 38px;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  color: var(--text-3);
  cursor: pointer;
  font-size: 1em;
  display: flex; align-items: center; justify-content: center;
  transition: color .15s, border-color .15s, background .15s;
  flex-shrink: 0;
}
.btn-remove:hover { color: var(--danger); border-color: rgba(239,68,68,0.4); background: var(--danger-light); }

/* ── COPY BOX ── */
.copy-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.03);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-top: 10px;
}
.copy-box span {
  flex: 1;
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 0.83em;
  color: var(--accent);
  word-break: break-all;
}
.copy-box button {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 7px 14px;
  cursor: pointer;
  font-size: 0.8em;
  font-weight: 600;
  font-family: inherit;
  white-space: nowrap;
  transition: background .15s, box-shadow .15s;
}
.copy-box button:hover { background: var(--primary-dark); box-shadow: 0 0 14px var(--primary-glow); }

/* ── DIVIDER ── */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0;
  color: var(--text-3);
  font-size: 0.8em;
  font-weight: 500;
}
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ── SCORE CARD ── */
.score-card {
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  margin-top: 16px;
  border: 1.5px solid transparent;
}
.score-card.green  { background: var(--success-light); border-color: rgba(16,185,129,0.3); }
.score-card.orange { background: var(--warning-light); border-color: rgba(245,158,11,0.3); }
.score-card.red    { background: var(--danger-light);  border-color: rgba(239,68,68,0.3); }
.score-label { font-size: 1.2em; font-weight: 800; margin-bottom: 4px; }
.score-card.green  .score-label { color: #34d399; }
.score-card.orange .score-label { color: #fbbf24; }
.score-card.red    .score-label { color: #f87171; }

/* ── STAT GRID ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  margin-top: 4px;
}
.stat-item {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.stat-item:hover {
  background: rgba(255,255,255,0.055);
  border-color: rgba(255,255,255,0.13);
  box-shadow: 0 0 18px rgba(99,102,241,0.08);
}
.stat-label { font-size: 0.72em; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; margin-bottom: 4px; }
.stat-value { font-size: 1.05em; font-weight: 700; color: var(--text); }

/* ── ROLE SELECTOR ── */
.role-selector { display: flex; gap: 12px; margin-top: 6px; align-items: stretch; }
.role-option   { flex: 1; cursor: pointer; display: flex; flex-direction: column; }
.role-option input[type="radio"] { display: none; }
.role-box {
  flex: 1;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
  transition: border-color .15s, background .15s, box-shadow .2s;
  user-select: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.role-option input[type="radio"]:checked + .role-box {
  border-color: var(--primary);
  background: rgba(99,102,241,0.1);
  box-shadow: 0 0 18px rgba(99,102,241,0.18);
}
.role-box:hover {
  border-color: rgba(99,102,241,0.4);
  background: rgba(99,102,241,0.05);
}
.role-box-icon  { font-size: 1.6em; margin-bottom: 6px; }
.role-box-title { font-weight: 700; font-size: .9em; margin-bottom: 2px; color: var(--text); }
.role-box-desc  { font-size: 0.78em; color: var(--text-3); }

/* ── PAGE HEADER ── */
.page-header {
  background: rgba(7,9,15,0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 28px 0;
  margin-bottom: 28px;
  position: relative;
  z-index: 10;
  animation: fadeIn 0.4s ease-out;
}
.page-header .inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* ── PROGRESS BAR ── */
.progress-bar-wrap {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
}
.progress-bar {
  height: 100%;
  border-radius: 999px;
  transition: width 0.8s cubic-bezier(.4,0,.2,1);
}
.progress-bar.green  { background: linear-gradient(90deg, #10b981, #34d399); box-shadow: 0 0 10px rgba(16,185,129,0.5); }
.progress-bar.orange { background: linear-gradient(90deg, #f59e0b, #fbbf24); box-shadow: 0 0 10px rgba(245,158,11,0.5); }
.progress-bar.red    { background: linear-gradient(90deg, #ef4444, #f87171); box-shadow: 0 0 10px rgba(239,68,68,0.5); }

/* ── UTILITAIRES RESPONSIVE ── */
.hide-mobile { display: inline; }
.show-mobile { display: none; }

/* ══════════════════════════════════════════
   MOBILE  ≤ 640px
══════════════════════════════════════════ */
@media (max-width: 640px) {

  /* Utilitaires */
  .hide-mobile { display: none; }
  .show-mobile { display: inline; }

  /* Navbar */
  .navbar { padding: 0 16px; height: 56px; }
  .navbar .brand img { height: 36px; }
  .navbar nav { gap: 2px; }
  .navbar nav span.nav-email { display: none; }
  .navbar nav a { font-size: 0.78em; padding: 5px 8px; }
  .navbar nav .btn-nav { padding: 6px 10px; font-size: 0.78em; }

  /* Layout */
  .container    { padding: 20px 14px; }
  .container-sm { padding: 28px 14px; }
  .container-xs { padding: 28px 14px; }

  /* Cards */
  .card { padding: 18px 16px; }
  .card-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .card-header .btn, .card-header a.btn { align-self: stretch; text-align: center; }

  /* Page header */
  .page-header { padding: 16px 0; margin-bottom: 16px; }
  .page-header .inner { flex-direction: column; align-items: flex-start; gap: 10px; }
  .page-header .inner .btn { align-self: stretch; text-align: center; }
  .page-header h1 { font-size: 1.25em; }

  /* Boutons */
  .btn-full { margin-top: 16px; }

  /* Copy box */
  .copy-box { flex-direction: column; align-items: stretch; gap: 8px; }
  .copy-box span { word-break: break-all; }
  .copy-box button { width: 100%; }

  /* Tables */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  th, td { padding: 10px 10px; font-size: 0.82em; }

  /* Stats */
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }

  /* Annonce row (tableau de bord bailleur) */
  .annonce-row-header { flex-wrap: wrap; gap: 10px; }
  .annonce-meta { flex-wrap: wrap; gap: 6px; justify-content: flex-start; width: 100%; }
  .annonce-meta .btn { flex: 1; min-width: calc(50% - 3px); text-align: center; justify-content: center; }
  .price-tag { font-size: .9em; }

  /* Doc slot (profil candidat) */
  .doc-slot { flex-wrap: wrap; gap: 8px; padding: 12px 0; }
  .doc-slot-actions { flex-wrap: wrap; gap: 6px; width: 100%; }
  .doc-slot-actions label,
  .doc-slot-actions button,
  .doc-slot-actions a { flex: 1; text-align: center; justify-content: center; font-size: .8em; }

  /* Candidature row (tableau de bord candidat) */
  .cand-row { flex-wrap: wrap; gap: 8px; }
  .cand-right { flex-wrap: wrap; gap: 6px; width: 100%; }
  .cand-right .btn { flex: 1; text-align: center; justify-content: center; }

  /* Score banner */
  .score-banner { gap: 16px; padding: 18px 16px; }
  .score-num { font-size: 2.5em; }

  /* Info grid */
  .info-grid { grid-template-columns: 1fr 1fr; gap: 8px; }

  /* Grilles formulaires */
  .grid-2, .grid-3 { grid-template-columns: 1fr; gap: 0; }

  /* Photos grid */
  .photos-grid { gap: 8px; }
  .photo-item, .preview-item { width: 90px; height: 68px; }

  /* Modals */
  .modal-card { margin: 16px; padding: 24px 18px; }
}
