/* ============================================================
   Portail clients — Maxime Laforest
   Brand: navy + bronze + warm sand cream
   Flat design, 0.5px borders, mobile-first
   ============================================================ */

:root {
  --navy: #1a2942;
  --bronze: #b48837;
  --bronze-dark: #9a722a;
  --gold: #c19a55;
  --cream-bg: #e8d9b6;
  --card-bg: #faf3dc;
  --white: #ffffff;
  --text: #1a1a1a;
  --muted: #6a5d3e;
  --line: #d6c499;
  --line-soft: #e8d9b6;
  --red: #DC1C2E;
}

/* ---------- Reset ---------- */

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

html, body {
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--cream-bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Playfair Display', Georgia, serif;
  color: var(--navy);
  margin: 0;
  font-weight: 700;
}

p {
  margin: 0;
}

a {
  color: var(--navy);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button {
  font-family: inherit;
  cursor: pointer;
}

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

/* ---------- Layout ---------- */

.wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

@media (max-width: 720px) {
  .wrapper {
    padding: 10px;
  }
}

.site-footer {
  margin-top: auto;
  padding: 24px 4px 8px;
  text-align: center;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.site-footer p {
  margin: 0;
}

.footer-legal {
  margin-top: 4px;
  opacity: 0.8;
}

/* ---------- Flash messages ---------- */

.flash-messages {
  margin-bottom: 14px;
}

.flash {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 6px;
  background: var(--white);
  border: 0.5px solid var(--line);
  color: var(--text);
}

.flash-error {
  background: #fff5f5;
  border-color: #f5c6c6;
  color: #862020;
}

.flash-success {
  background: #f0faf0;
  border-color: #b8e0b8;
  color: #1d5a1d;
}

/* ---------- Brand monogram ---------- */

.logo-monogram {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--navy);
  color: var(--bronze);
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 13px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

.brand-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  color: var(--navy);
  font-size: 16px;
}

/* ---------- Login / centered card pages ---------- */

.login-wrap {
  display: flex;
  justify-content: center;
  flex: 1;
}

.login-card {
  width: 100%;
  max-width: 480px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 32px;
  margin-top: 80px;
}

.login-card-center {
  text-align: center;
}

@media (max-width: 480px) {
  .login-card {
    margin-top: 32px;
    padding: 24px 20px;
  }
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.login-card-center .login-brand {
  justify-content: center;
}

.check-icon,
.error-icon {
  margin: 0 auto 16px;
  width: 56px;
  height: 56px;
}

.login-title {
  font-size: 26px;
  margin-bottom: 8px;
  color: var(--navy);
}

.login-subtitle {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 24px;
}

.login-body {
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 16px;
}

.login-hint {
  color: var(--muted);
  font-size: 12px;
  margin-top: 14px;
  line-height: 1.5;
}

.login-back {
  margin-top: 20px;
  font-size: 13px;
}

.link-muted {
  color: var(--muted);
  font-size: 13px;
}

.link-muted:hover {
  color: var(--navy);
}

/* ---------- Forms ---------- */

.login-form {
  display: flex;
  flex-direction: column;
}

.input-large {
  width: 100%;
  height: 48px;
  padding: 14px 16px;
  font-size: 16px;
  font-family: inherit;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}

.input-large:focus {
  border-color: var(--bronze);
  box-shadow: 0 0 0 3px rgba(180, 136, 55, 0.12);
}

.input-large::placeholder {
  color: #aaa089;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ---------- Buttons ---------- */

.btn-primary {
  background: var(--bronze);
  color: var(--white);
  border: none;
  font-weight: 600;
  padding: 14px 24px;
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  transition: background 0.15s;
}

.btn-primary:hover {
  background: var(--bronze-dark);
}

.btn-block {
  width: 100%;
  margin-top: 16px;
}

/* Bouton « Se connecter avec Google » */
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-top: 4px;
  padding: 13px 24px;
  background: var(--white);
  color: #1f2937;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.btn-google:hover {
  border-color: var(--bronze);
  box-shadow: 0 2px 10px -4px rgba(26, 41, 66, 0.25);
  text-decoration: none;
}

.btn-google svg { flex: none; }

/* Séparateur « ou » */
.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 16px;
  color: var(--muted);
  font-size: 12px;
}

.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.btn-bronze-sm {
  background: var(--bronze);
  color: var(--white);
  border: none;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 11.5px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background 0.15s;
}

.btn-bronze-sm:hover {
  background: var(--bronze-dark);
}

.btn-outline-sm {
  background: transparent;
  color: var(--navy);
  border: 0.5px solid var(--line);
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 11.5px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: border-color 0.15s, background 0.15s;
}

.btn-outline-sm:hover {
  border-color: var(--bronze);
  background: var(--white);
}

/* ---------- Top bar (dossier page) ---------- */

.topbar {
  background: var(--white);
  border: 0.5px solid var(--line);
  border-radius: 10px;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-sep {
  width: 1px;
  height: 22px;
  background: var(--line);
}

.topbar-welcome {
  font-size: 13px;
  color: var(--muted);
}

.welcome-name {
  color: var(--navy);
  font-weight: 700;
}

.topbar-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.tab-active {
  background: var(--navy);
  color: var(--white);
  border: 0.5px solid var(--navy);
}

.tab-inactive {
  background: #f1efe9;
  color: var(--muted);
  border: 0.5px solid var(--line);
}

.tab-inactive:hover {
  text-decoration: none;
  color: var(--navy);
  border-color: var(--bronze);
}

.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  background: rgba(193, 154, 85, 0.18);
  color: var(--gold);
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1;
}

.tab-active .tab-badge {
  background: rgba(255, 255, 255, 0.18);
  color: var(--white);
}

.topbar-icons {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: transparent;
  border: 0.5px solid var(--line);
  border-radius: 50%;
  color: var(--navy);
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}

.icon-btn:hover {
  border-color: var(--bronze);
  background: var(--white);
  text-decoration: none;
}

.bell-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 7px;
  height: 7px;
  background: var(--red);
  border-radius: 50%;
  border: 1.5px solid var(--white);
}

/* ---------- Cloche de notifications (dropdown sans JS) ---------- */

.notif {
  position: relative;
}

.notif > summary {
  list-style: none;
  cursor: pointer;
}

.notif > summary::-webkit-details-marker {
  display: none;
}

/* Pastille rouge avec compteur */
.bell-count {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  background: var(--red);
  color: var(--white);
  border-radius: 999px;
  border: 1.5px solid var(--white);
  font-size: 9px;
  font-weight: 700;
  line-height: 13px;
  text-align: center;
}

.notif-panel {
  position: absolute;
  top: 38px;
  right: 0;
  width: 290px;
  max-height: 360px;
  overflow-y: auto;
  background: var(--white);
  border: 0.5px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(26, 41, 66, 0.16);
  z-index: 50;
  padding: 6px;
}

.notif-panel-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  color: var(--navy);
  font-size: 13px;
  padding: 8px 10px 10px;
  border-bottom: 0.5px solid var(--line);
}

.notif-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 10px;
  border-radius: 8px;
  text-decoration: none;
}

.notif-item + .notif-item {
  border-top: 0.5px solid var(--line-soft, #e8d9b6);
}

.notif-item.is-unseen {
  background: #faf3dc;
}

.notif-item-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.35;
}

.notif-item-time {
  font-size: 10px;
  color: var(--muted);
}

.notif-empty {
  padding: 22px 10px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

/* ---------- Hero ---------- */

.hero {
  background: var(--navy);
  border-radius: 12px;
  padding: 22px 26px;
  position: relative;
  overflow: hidden;
  margin-bottom: 14px;
}

.hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--red);
}

.hero-eyebrow {
  color: var(--bronze);
  letter-spacing: 2.5px;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  margin: 0 0 8px 0;
}

.hero-title {
  color: var(--white);
  font-size: 24px;
  letter-spacing: -0.3px;
  margin: 0 0 6px 0;
}

.hero-subtitle {
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
  margin: 0;
}

.hero-step {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-weight: 700;
  color: var(--gold);
}

/* ---------- Timeline ---------- */

.timeline {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0;
  padding: 18px 4px 4px;
  position: relative;
}

.timeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.timeline-step:not(.timeline-step-last)::before {
  content: "";
  position: absolute;
  top: 11px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: rgba(255, 255, 255, 0.13);
  z-index: 0;
}

.timeline-step-done:not(.timeline-step-last)::before {
  background: var(--bronze);
}

.timeline-dot {
  position: relative;
  z-index: 1;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
}

.timeline-step-pending .timeline-dot {
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: var(--white);
}

.timeline-step-done .timeline-dot {
  background: var(--bronze);
  border: 2px solid var(--bronze);
  color: var(--white);
}

.timeline-step-now .timeline-dot {
  background: var(--white);
  border: 2px solid var(--bronze);
  color: var(--navy);
  box-shadow: 0 0 0 4px rgba(180, 136, 55, 0.32);
}

.timeline-step-now .dot-inner {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bronze);
}

.dot-number {
  line-height: 1;
}

.timeline-label {
  margin-top: 8px;
  max-width: 76px;
  font-size: 10px;
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.3;
}

.timeline-step-done .timeline-label,
.timeline-step-now .timeline-label {
  color: var(--white);
  font-weight: 600;
}

@media (max-width: 600px) {
  .timeline {
    grid-template-columns: repeat(3, 1fr);
    row-gap: 18px;
  }

  .timeline-step:nth-child(3)::before {
    display: none;
  }
}

/* ---------- Dossier grid (main 2-column) ---------- */

.dossier-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 12px;
  align-items: start;
}

.col-left {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.col-right {
  display: flex;
  flex-direction: column;
}

@media (max-width: 720px) {
  .dossier-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Cards ---------- */

.card {
  background: var(--card-bg);
  border: 0.5px solid var(--line);
  border-radius: 12px;
  padding: 14px 18px;
}

.card-chat {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 360px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 0.5px solid var(--line);
}

.card-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--navy);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.card-title-icon {
  color: var(--bronze);
  flex-shrink: 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.pill-bronze {
  background: rgba(180, 136, 55, 0.15);
  color: var(--bronze-dark);
  border: 0.5px solid rgba(180, 136, 55, 0.3);
}

.empty-state {
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
  padding: 18px 6px;
  font-style: italic;
}

/* ---------- Documents list ---------- */

.doc-list {
  display: flex;
  flex-direction: column;
}

.doc-row {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-top: 0.5px solid var(--line);
}

.doc-row:first-child {
  border-top: none;
}

.doc-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--cream-bg);
  color: var(--bronze);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.doc-body {
  min-width: 0;
}

.doc-name {
  font-size: 12.5px;
  color: var(--navy);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.doc-meta {
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 1px;
}

.doc-action {
  flex-shrink: 0;
}

/* ---------- Partners list ---------- */

.partner-list {
  display: flex;
  flex-direction: column;
}

.partner-row {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-top: 0.5px solid var(--line);
}

.partner-row:first-child {
  border-top: none;
}

.partner-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--gold);
  font-size: 10.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.5px;
}

.partner-body {
  min-width: 0;
}

.partner-name {
  font-size: 12.5px;
  color: var(--navy);
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.partner-role {
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 1px;
}

.partner-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.partner-actions .icon-btn {
  width: 28px;
  height: 28px;
}

/* ---------- Chat ---------- */

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 200px;
  flex: 1;
  padding: 4px 0;
}

.chat-msg {
  display: flex;
  flex-direction: column;
  max-width: 80%;
}

.chat-msg-client {
  align-self: flex-end;
  align-items: flex-end;
}

.chat-msg-maxime {
  align-self: flex-start;
  align-items: flex-start;
}

.chat-msg-meta {
  font-size: 9.5px;
  opacity: 0.7;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 3px;
  padding: 0 4px;
}

.chat-bubble {
  padding: 9px 12px;
  border-radius: 12px;
  line-height: 1.5;
  font-size: 12px;
  word-wrap: break-word;
}

.chat-msg-client .chat-bubble {
  background: var(--navy);
  color: var(--white);
  border-bottom-right-radius: 4px;
}

.chat-msg-maxime .chat-bubble {
  background: var(--cream-bg);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.chat-form {
  display: flex;
  gap: 6px;
  padding-top: 10px;
  border-top: 0.5px solid var(--line);
  margin-top: auto;
}

.chat-input {
  flex: 1;
  border: 0.5px solid var(--line);
  border-radius: 8px;
  padding: 7px 11px;
  font-size: 12px;
  background: var(--white);
  font-family: inherit;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.chat-input:focus {
  border-color: var(--bronze);
  box-shadow: 0 0 0 2px rgba(180, 136, 55, 0.12);
}

.btn-send {
  background: var(--bronze);
  color: var(--white);
  border: none;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 700;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background 0.15s;
}

.btn-send:hover {
  background: var(--bronze-dark);
}

/* ---------- Small screens tweaks ---------- */

@media (max-width: 480px) {
  .topbar {
    padding: 10px 14px;
    gap: 10px;
  }

  .topbar-welcome {
    font-size: 12px;
  }

  .topbar-tabs {
    margin-left: 0;
    order: 99;
    width: 100%;
  }

  .topbar-icons {
    margin-left: auto;
  }

  .hero {
    padding: 18px 18px;
  }

  .hero-title {
    font-size: 20px;
  }

  .card {
    padding: 12px 14px;
  }
}
