/* Evn — Wedding Planner : feuille de style partagée */

:root {
  --gold: #D4AF37;
  --gold-dark: #C59B27;
  --pink: #E8C5C8;
  --pink-light: #F3E5E8;
  --purple: #6C5B7B;
  --purple-dark: #564764;
  --cream: #FAF8F5;
  --text: #4A4A4A;
  --muted: #8C7B70;
  --white: #FFFFFF;
  --danger: #d9534f;
  --radius: 8px;
  --shadow: 0 2px 8px rgba(0,0,0,0.06);
}

* { box-sizing: border-box; }

body {
  font-family: 'Segoe UI', Helvetica, Arial, sans-serif;
  background-color: var(--cream);
  color: var(--text);
  margin: 0;
  padding: 0;
}

a { color: var(--purple); }

/* ===== EN-TÊTE / NAVIGATION ===== */

.app-header {
  background: var(--white);
  border-bottom: 2px solid var(--gold);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.app-header .brand {
  color: var(--gold-dark);
  font-weight: bold;
  font-size: 18px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  text-decoration: none;
}

.app-nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.app-nav a {
  text-decoration: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: var(--radius);
  transition: background 0.15s;
}

.app-nav a:hover { background: var(--pink-light); }
.app-nav a.active { background: var(--gold); color: white; }

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

.event-switcher select {
  font-size: 12px;
}

main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px 20px 60px 20px;
}

/* ===== BOUTONS ===== */

.btn {
  background-color: var(--gold);
  color: white;
  border: none;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: bold;
  border-radius: var(--radius);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn:hover { background-color: var(--gold-dark); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-add { background-color: var(--purple); }
.btn-add:hover { background-color: var(--purple-dark); }

.btn-outline {
  background: var(--white);
  color: var(--purple);
  border: 1px solid var(--purple);
}
.btn-outline:hover { background: var(--pink-light); }

.btn-danger { background-color: var(--danger); }
.btn-danger:hover { background-color: #c9302c; }

.btn-sm { padding: 4px 8px; font-size: 11px; }

.btn-field {
  background-color: var(--white);
  color: var(--purple);
  border: 1px solid var(--purple);
  padding: 2px 6px;
  font-size: 9px;
  border-radius: 3px;
  margin-right: 2px;
  margin-top: 4px;
  cursor: pointer;
}
.btn-field:hover { background-color: var(--pink-light); }

.delete-btn {
  color: #aaa;
  font-size: 12px;
  cursor: pointer;
  font-weight: bold;
  background: none;
  border: none;
}
.delete-btn:hover { color: var(--danger); }

/* ===== CARTES / SECTIONS ===== */

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 20px 0 10px 0;
  border-left: 4px solid var(--gold);
  padding-left: 10px;
  flex-wrap: wrap;
  gap: 8px;
}

.section-title {
  color: var(--muted);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: bold;
  margin: 0;
}

.card {
  background-color: var(--white);
  border: 1px solid var(--pink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
}

.badge {
  background-color: var(--purple);
  color: white;
  font-size: 11px;
  font-weight: bold;
  padding: 4px 10px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.status-pill {
  font-size: 10px;
  font-weight: bold;
  padding: 3px 8px;
  border-radius: 10px;
  color: white;
  white-space: nowrap;
}
.status-a_prevoir { background: #B0B0B0; }
.status-reserve { background: #4A90D9; }
.status-livre { background: #9B59B6; }
.status-installe { background: #27AE60; }
.status-rendu { background: #8C7B70; }

.status-planifie { background: #4A90D9; }
.status-confirme { background: #27AE60; }
.status-termine { background: #8C7B70; }
.status-annule { background: var(--danger); }

/* ===== FORMULAIRES ===== */

input, select, textarea {
  font-family: inherit;
  padding: 6px 9px;
  border: 1px solid var(--gold);
  border-radius: 5px;
  font-size: 13px;
  outline: none;
  background: white;
  color: var(--text);
}

textarea { resize: vertical; }

label {
  font-size: 12px;
  font-weight: bold;
  color: var(--muted);
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

[contenteditable="true"] {
  outline: none;
}
[contenteditable="true"]:hover {
  background: var(--pink-light);
  border-radius: 3px;
}

/* ===== TABLE ===== */

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
}

th, td {
  text-align: left;
  padding: 8px 10px;
  font-size: 13px;
  border-bottom: 1px solid var(--pink-light);
}

th {
  background: var(--pink-light);
  color: var(--purple);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
}

/* ===== AUTH GATE ===== */

.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cream);
  padding: 20px;
}

.auth-box {
  max-width: 380px;
  width: 100%;
  background: white;
  border: 1px solid var(--pink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  text-align: center;
}

.auth-box h1 {
  color: var(--gold-dark);
  font-size: 20px;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 4px;
}

.auth-box p.sub {
  color: var(--muted);
  font-size: 13px;
  margin-top: 0;
  margin-bottom: 20px;
}

.auth-box .form-row { text-align: left; }

.auth-tabs {
  display: flex;
  margin-bottom: 16px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--gold);
}
.auth-tabs button {
  flex: 1;
  padding: 8px;
  border: none;
  background: white;
  color: var(--purple);
  font-weight: bold;
  font-size: 12px;
  cursor: pointer;
}
.auth-tabs button.active { background: var(--gold); color: white; }

.error-text { color: var(--danger); font-size: 12px; margin: 4px 0 0 0; }

/* ===== TIMELINE (Vue générale) ===== */

.timeline-container { position: relative; margin-top: 20px; padding: 5px 0; }

.timeline-line {
  position: absolute;
  top: 35px;
  left: 1%;
  width: 98%;
  height: 4px;
  background: linear-gradient(90deg, var(--gold), var(--pink), var(--gold));
  z-index: 1;
}

.timeline-grid {
  display: flex;
  flex-wrap: wrap;
  position: relative;
  z-index: 2;
  gap: 10px;
}

.step {
  flex: 1;
  min-width: 150px;
  text-align: center;
  cursor: move;
  position: relative;
}
.step.dragging { opacity: 0.4; }

.time-badge {
  background-color: var(--gold);
  color: white;
  font-weight: bold;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 12px;
  display: inline-block;
  margin-bottom: 4px;
}

.point {
  width: 10px; height: 10px;
  background-color: var(--pink-light);
  border: 3px solid var(--gold);
  border-radius: 50%;
  margin: 0 auto 8px auto;
}

.step .card {
  min-height: 110px;
  text-align: left;
  font-size: 12px;
  position: relative;
}

.step .card h3 {
  font-size: 13px;
  color: var(--gold-dark);
  margin: 0 0 6px 0;
  text-align: center;
  border-bottom: 1px dashed var(--pink);
  padding-bottom: 4px;
}

.step .card ul { margin: 0; padding-left: 14px; }
.step .card li { margin-bottom: 3px; line-height: 1.3; }

.step .delete-btn { position: absolute; top: 2px; right: 4px; }

/* ===== CÉRÉMONIE ===== */

.ceremony-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.ceremony-card {
  background-color: var(--white);
  border: 1px solid var(--gold);
  border-top: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: 10px;
  font-size: 12px;
  cursor: move;
  position: relative;
}

.ceremony-card h4 {
  margin: 0 0 8px 0;
  color: var(--gold-dark);
  font-size: 13px;
  border-bottom: 1px dashed var(--pink);
  padding-bottom: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.duration-input {
  width: 40px;
  font-size: 11px;
  border: 1px solid var(--gold);
  border-radius: 3px;
  text-align: center;
  font-weight: bold;
  color: var(--purple);
  background: var(--pink-light);
}

.detail-row {
  margin-bottom: 4px;
  line-height: 1.3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.detail-label { font-weight: bold; color: var(--muted); font-size: 11px; white-space: nowrap; }

/* ===== UTILITAIRES ===== */

.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.text-muted { color: var(--muted); }
.text-sm { font-size: 12px; }
.mt-0 { margin-top: 0; }
.hidden { display: none !important; }

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 40px 20px;
  font-size: 14px;
}

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--purple);
  color: white;
  padding: 10px 16px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-size: 13px;
  z-index: 200;
  max-width: 320px;
}
.toast.error { background: var(--danger); }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-box {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  max-width: 420px;
  width: 90%;
  box-shadow: var(--shadow);
}

.day-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.day-tabs button {
  background: white;
  border: 1px solid var(--gold);
  color: var(--purple);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
}
.day-tabs button.active { background: var(--gold); color: white; }

@media print {
  .no-print { display: none !important; }
  body { background: white; }
}
