:root {
  --brand:      #111111;
  --gold:       #F28C00;
  --blue:       #006B91;
  --green:      #2f8a4c;
  --gold-light: #fdf5e8;
  --bg:         #E4E4E4;
  --text:       #222222;
  --muted:      #666666;
  --line:       #d0d0d0;
  --shadow:     0 20px 60px rgba(0,0,0,.15);
  --radius:     22px;
}

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

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  /* Seul le débordement horizontal est masqué : la 3e carte étant plus haute,
     la page doit rester scrollable verticalement sur les petits écrans. */
  overflow-x: hidden;
}

/* Background orbs */
body::before, body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}
body::before {
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(242,140,0,.14) 0%, transparent 70%);
  top: -150px; left: -150px;
}
body::after {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(0,107,145,.1) 0%, transparent 70%);
  bottom: -100px; right: -100px;
}

/* Header */
.header {
  position: relative;
  z-index: 1;
  text-align: center;
  margin-bottom: 52px;
}

.logo-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 10px;
}

.logo-badge {
  width: 46px; height: 46px;
  background: var(--brand);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 4px 14px rgba(23,35,60,.25);
}

.header h1 {
  font-size: 32px;
  font-weight: 900;
  color: var(--brand);
  letter-spacing: -.5px;
}

.header p {
  font-size: 14px;
  color: var(--muted);
  font-weight: 500;
  margin-top: 6px;
  letter-spacing: .02em;
}

.gold-bar {
  display: inline-block;
  width: 48px; height: 3px;
  background: var(--gold);
  border-radius: 4px;
  margin-top: 12px;
}

/* Grid */
.grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, 340px);
  gap: 24px;
}

/* Post-it card */
.card {
  background: #fff;
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  transition: transform .25s ease, box-shadow .25s ease;
  position: relative;
  overflow: hidden;
  min-height: 210px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  border-radius: var(--radius) var(--radius) 0 0;
}

.card.active:nth-child(1)::before  { background: var(--blue); }
.card.active:nth-child(2)::before  { background: var(--gold); }
.card.active:nth-child(3)::before  { background: var(--green); }
.card.future::before  { background: linear-gradient(90deg, #d0d8e8, #c4ccd8); }

.card.active { cursor: pointer; }

.card.active:hover {
  transform: translateY(-6px) rotate(-0.4deg);
  box-shadow: 0 32px 80px rgba(23,35,60,.2);
}

.card.future {
  opacity: .72;
  cursor: default;
}

/* Tag */
.card-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  padding: 4px 10px;
  border-radius: 999px;
  width: fit-content;
}

.card.active .card-tag { background: var(--gold-light); color: #8a6200; }
.card.future .card-tag { background: #edf0f5; color: #8a92a6; }

.card-tag .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.card-icon { font-size: 36px; line-height: 1; }

.card h2 {
  font-size: 19px;
  font-weight: 800;
  color: var(--brand);
  line-height: 1.2;
}

.card p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
  flex: 1;
}

.card-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
}

.arrow-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 800;
  color: #ffffff;
  background: var(--brand);
  border-radius: 999px;
  padding: 8px 16px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background .18s;
}

.arrow-btn:hover { background: var(--blue); }

.arrow-btn .arrow {
  font-size: 14px;
  transition: transform .18s;
}

.card.active:hover .arrow { transform: translateX(3px); }

/* Footer */
.footer {
  position: relative;
  z-index: 1;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin-top: 48px;
  letter-spacing: .03em;
}

/* Bandeau de session */
.session-bar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 40px;
  padding: 9px 10px 9px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
  font-size: 12.5px;
  color: var(--muted);
}

.session-bar strong { color: var(--brand); font-weight: 800; }

.session-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  flex: 0 0 auto;
}

.session-logout {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background .18s, color .18s, border-color .18s;
}

.session-logout:hover { background: #c93636; color: #fff; border-color: #c93636; }

/* Connexion */
#loginDialog {
  /* Le reset `* { margin: 0 }` plus haut écrase le `margin: auto` que le
     navigateur applique aux fenêtres modales : sans cette ligne, la boîte
     se colle en haut à gauche au lieu d'être centrée. */
  margin: auto;
  border: 0;
  padding: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 400px;
  max-width: 92vw;
  background: #fff;
  color: var(--text);
}

#loginDialog::backdrop { background: rgba(0,0,0,.5); }

.login-head {
  padding: 32px 30px 24px;
  text-align: center;
  border-bottom: 1px solid var(--line);
}

.login-head img { height: 42px; width: auto; object-fit: contain; }
.login-head p { font-size: 12.5px; color: var(--muted); margin-top: 12px; }

.login-body { padding: 26px 30px 30px; }

.login-body .field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.login-body label { font-size: 12px; font-weight: 700; color: var(--brand); }

.login-body input {
  font-family: inherit;
  font-size: 14px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
}

.login-body input:focus { outline: 2px solid var(--blue); outline-offset: 1px; }

.login-btn {
  width: 100%;
  border: 0;
  background: var(--brand);
  color: #fff;
  padding: 12px 16px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  transition: background .18s;
}

.login-btn:hover { background: var(--blue); }

.login-error {
  display: none;
  margin-top: 12px;
  font-size: 12.5px;
  color: #c93636;
  text-align: center;
}

/* Responsive */
@media (max-width: 740px) {
  .grid {
    grid-template-columns: 1fr;
    max-width: 400px;
    width: 100%;
  }
  .header h1 { font-size: 24px; }
}
