/* ============================================================
   FRANCE UNIVE — Portail Propriétaire
   ============================================================ */

/* ---- Variables (reprend les mêmes tokens que le site) ---- */
:root {
  --bg:        #f4f7ff;
  --bg-card:   #ffffff;
  --bg-sec:    #eaefff;
  --blue:      #3b82f6;
  --blue-d:    #2563eb;
  --gold:      #d97706;
  --green:     #16a34a;
  --red:       #dc2626;
  --orange:    #d97706;
  --text:      #0f172a;
  --text-2:    #374151;
  --muted:     #6b7280;
  --border:    rgba(59,130,246,0.18);
  --radius:    12px;
  --font:      'Plus Jakarta Sans', sans-serif;
  --font-d:    'Ubuntu', sans-serif;
  --shadow:    0 4px 24px rgba(0,0,0,0.08);
}

[data-theme="dark"] {
  --bg:        #05080f;
  --bg-card:   #0a1220;
  --bg-sec:    #080d1a;
  --blue:      #3b82f6;
  --blue-d:    #60a5fa;
  --gold:      #f59e0b;
  --green:     #4ade80;
  --red:       #f87171;
  --orange:    #fbbf24;
  --text:      #f0f4ff;
  --text-2:    #c8d4f0;
  --muted:     #64748b;
  --border:    rgba(59,130,246,0.15);
  --shadow:    0 4px 40px rgba(0,0,0,0.35);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background 0.3s, color 0.3s;
}
a    { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: var(--font); border: none; background: none; }

/* ---- TOPBAR ---- */
.topbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  height: 64px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.topbar-logo {
  font-family: var(--font-d);
  font-size: 18px; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}

.topbar-logo span { color: var(--blue-d); }

.topbar-right { display: flex; align-items: center; gap: 12px; }

.topbar-user {
  font-size: 13px; font-weight: 600; color: var(--text-2);
  display: flex; align-items: center; gap: 8px;
}

.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), #818cf8);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}

.btn-logout {
  font-size: 13px; color: var(--muted); padding: 7px 14px;
  border: 1px solid var(--border); border-radius: 8px;
  transition: all 0.2s;
}
.btn-logout:hover { color: var(--red); border-color: var(--red); background: rgba(220,38,38,0.06); }

/* Bouton thème */
.btn-theme {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-sec);
  color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.btn-theme:hover { color: var(--blue); border-color: var(--blue); }
.btn-theme svg { width: 16px; height: 16px; }
#o-icon-sun  { display: none; }
[data-theme="dark"] #o-icon-sun  { display: block; }
[data-theme="dark"] #o-icon-moon { display: none; }

/* ---- ÉCRAN AUTH ---- */
#auth-screen {
  min-height: calc(100vh - 64px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: var(--bg);
  background-image: radial-gradient(ellipse 60% 50% at 50% 30%, rgba(59,130,246,0.08), transparent);
}

.auth-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px;
  width: 100%; max-width: 440px;
  box-shadow: var(--shadow);
}

.auth-box h2 {
  font-family: var(--font-d);
  font-size: 22px; font-weight: 700;
  margin-bottom: 6px;
}

.auth-box > p {
  font-size: 13px; color: var(--muted); margin-bottom: 28px;
}

.auth-tabs {
  display: flex; gap: 0;
  background: var(--bg-sec);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 28px;
}

.auth-tab {
  flex: 1; padding: 9px;
  font-size: 13px; font-weight: 600;
  border-radius: 8px;
  color: var(--muted);
  transition: all 0.2s;
  text-align: center;
}

.auth-tab.active {
  background: var(--bg-card);
  color: var(--text);
  box-shadow: 0 1px 6px rgba(0,0,0,0.1);
}

.auth-form { display: none; }
.auth-form.active { display: block; }

.field {
  display: flex; flex-direction: column; gap: 6px;
  margin-bottom: 14px;
}

.field label {
  font-size: 12px; font-weight: 700;
  color: var(--text-2); letter-spacing: 0.03em;
}

.field input, .field select {
  background: var(--bg-sec);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 11px 14px;
  font-family: var(--font); font-size: 14px;
  color: var(--text); outline: none; width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field input:focus, .field select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}

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

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.btn-submit {
  width: 100%; padding: 13px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--blue), #1d4ed8);
  color: #fff; font-size: 15px; font-weight: 700;
  margin-top: 8px;
  transition: opacity 0.2s, transform 0.2s;
}
.btn-submit:hover { opacity: 0.88; transform: translateY(-1px); }

.auth-error {
  margin-top: 10px; font-size: 13px; color: var(--red);
  background: rgba(220,38,38,0.08);
  border: 1px solid rgba(220,38,38,0.2);
  border-radius: 8px; padding: 9px 12px; display: none;
}

.auth-footer {
  margin-top: 20px; text-align: center;
  font-size: 12px; color: var(--muted);
}
.auth-footer a { color: var(--blue-d); }

/* ---- DASHBOARD ---- */
#owner-dashboard { display: none; padding-bottom: 60px; }

.dashboard-header {
  max-width: 1100px; margin: 0 auto;
  padding: 36px 24px 0;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 16px;
}

.dashboard-header h1 {
  font-family: var(--font-d);
  font-size: 24px; font-weight: 700;
}

.dashboard-header p { font-size: 14px; color: var(--muted); margin-top: 4px; }

.btn-propose {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 10px;
  background: linear-gradient(135deg, var(--blue), #1d4ed8);
  color: #fff; font-size: 14px; font-weight: 700;
  transition: opacity 0.2s, transform 0.2s;
  flex-shrink: 0;
}
.btn-propose:hover { opacity: 0.88; transform: translateY(-2px); }
.btn-propose svg { width: 16px; height: 16px; }

/* Stats dashboard */
.dash-stats {
  max-width: 1100px; margin: 28px auto 0;
  padding: 0 24px;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px;
}

@media (min-width: 640px) { .dash-stats { grid-template-columns: repeat(4, 1fr); } }

.dash-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  text-align: center;
}

.dash-stat-num {
  font-family: var(--font-d);
  font-size: 30px; font-weight: 700; line-height: 1;
  margin-bottom: 6px;
}
.dash-stat-num.blue   { color: var(--blue-d); }
.dash-stat-num.orange { color: var(--orange); }
.dash-stat-num.green  { color: var(--green); }
.dash-stat-num.red    { color: var(--red); }

.dash-stat-label { font-size: 12px; color: var(--muted); }

/* Grille annonces */
.owner-section {
  max-width: 1100px; margin: 32px auto 0; padding: 0 24px;
}

.owner-section h2 {
  font-family: var(--font-d);
  font-size: 17px; font-weight: 700;
  margin-bottom: 20px;
}

.owner-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 600px)  { .owner-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .owner-grid { grid-template-columns: repeat(3, 1fr); } }

.owner-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  transition: box-shadow 0.2s;
}
.owner-card:hover { box-shadow: var(--shadow); }

.owner-card-head {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.owner-card-emoji { font-size: 28px; }

.status-badge {
  font-size: 11px; font-weight: 700;
  padding: 4px 10px; border-radius: 99px;
  letter-spacing: 0.06em;
}

.status-pending  { background: rgba(217,119,6,0.12); color: var(--orange); border: 1px solid rgba(217,119,6,0.22); }
.status-approved { background: rgba(22,163,74,0.10); color: var(--green);  border: 1px solid rgba(22,163,74,0.20); }
.status-rejected { background: rgba(220,38,38,0.10); color: var(--red);    border: 1px solid rgba(220,38,38,0.20); }

.owner-card h3 {
  font-family: var(--font-d);
  font-size: 15px; font-weight: 700;
  margin-bottom: 6px; line-height: 1.3;
}

.owner-card-city {
  font-size: 12px; color: var(--muted); margin-bottom: 8px;
}

.rejection-reason {
  font-size: 12px; color: var(--red);
  background: rgba(220,38,38,0.06);
  border: 1px solid rgba(220,38,38,0.15);
  border-radius: 7px; padding: 8px 10px; margin-bottom: 8px;
  line-height: 1.5;
}

.owner-card-date {
  font-size: 11px; color: var(--muted);
  padding-top: 10px; border-top: 1px solid var(--border);
  margin-top: 10px;
}

/* Empty state */
.owner-empty {
  grid-column: 1 / -1;
  text-align: center; padding: 60px 20px;
  background: var(--bg-card);
  border: 1.5px dashed var(--border);
  border-radius: 16px;
}
.owner-empty p { font-size: 14px; color: var(--muted); margin-bottom: 20px; }
.btn-add-listing {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 10px;
  background: linear-gradient(135deg, var(--blue), #1d4ed8);
  color: #fff; font-size: 14px; font-weight: 700;
}

/* ---- MODAL ANNONCE ---- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(8px);
  z-index: 500;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  width: 100%; max-width: 540px;
  max-height: 90vh; overflow-y: auto;
  transform: scale(0.95) translateY(12px);
  transition: transform 0.25s;
}
.modal-overlay.open .modal { transform: none; }

.modal-head {
  padding: 24px 24px 0;
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.modal-head h2 {
  font-family: var(--font-d);
  font-size: 18px; font-weight: 700;
}
.modal-close {
  width: 32px; height: 32px; border-radius: 8px;
  color: var(--muted); display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.modal-close:hover { background: var(--bg-sec); color: var(--text); }
.modal-close svg { width: 18px; height: 18px; }

.modal-body  { padding: 0 24px 24px; }
.modal-foot  {
  display: flex; justify-content: flex-end; gap: 10px;
  margin-top: 20px; padding-top: 16px;
  border-top: 1px solid var(--border);
}
.btn-cancel {
  padding: 10px 18px; border-radius: 9px;
  border: 1px solid var(--border);
  font-size: 13px; font-weight: 600; color: var(--muted);
  transition: all 0.2s;
}
.btn-cancel:hover { border-color: var(--muted); color: var(--text); }

.modal-body .field textarea {
  background: var(--bg-sec);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 11px 14px;
  font-family: var(--font); font-size: 14px;
  color: var(--text); outline: none; width: 100%;
  resize: vertical; min-height: 90px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.modal-body .field textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}
.modal-body .field textarea::placeholder { color: var(--muted); }

/* Bandeau info soumission */
.submit-info {
  background: rgba(59,130,246,0.07);
  border: 1px solid rgba(59,130,246,0.18);
  border-radius: 9px; padding: 12px 14px;
  font-size: 12px; color: var(--text-2);
  line-height: 1.6; margin-bottom: 20px;
}
.submit-info strong { color: var(--blue-d); }

/* ---- TOAST ---- */
#toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 20px;
  font-size: 13px; font-weight: 600; color: var(--text);
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  z-index: 2000; transition: transform 0.3s ease;
  white-space: nowrap; max-width: 90vw; text-align: center;
}
#toast.show    { transform: translateX(-50%) translateY(0); }
#toast.success { color: var(--green); border-color: rgba(22,163,74,0.25); }
#toast.error   { color: var(--red);   border-color: rgba(220,38,38,0.25); }
