* { box-sizing: border-box; }

:root {
  --beige: #faf6f1;
  --sage-darkest: #55624a;
  --sage-dark: #7c8a6b;
  --sage-mid: #a3b18f;
  --sage-light: #e3e8da;
  --sage-pale: #f1f4ec;
  --text: #3a3a3a;
}

body {
  font-family: 'Georgia', 'Times New Roman', serif;
  background: var(--beige);
  color: var(--text);
  margin: 0;
  padding: 0;
}

header {
  text-align: center;
  padding: 50px 20px 30px;
}

header h1 {
  font-size: 2.2em;
  margin-bottom: 10px;
  color: var(--sage-darkest);
}

.subtitle {
  color: #9a9a8f;
  font-style: italic;
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
}

.gifts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

.gift-card {
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.gift-image {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.gift-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.gift-body h2 {
  font-size: 1.2em;
  margin: 0 0 8px;
  color: #4a4a4a;
}

.gift-price {
  font-weight: bold;
  color: var(--sage-darkest);
  margin: 0 0 10px;
}

.gift-description {
  font-size: 0.92em;
  color: #666;
  margin-bottom: 10px;
}

.gift-link {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--sage-dark);
  text-decoration: none;
  font-size: 0.9em;
}

.gift-link:hover {
  text-decoration: underline;
}

.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8em;
  margin-bottom: 12px;
  width: fit-content;
}

.status-badge.status-available {
  background: var(--sage-pale);
  color: var(--sage-darkest);
}

.status-badge.status-reserved {
  background: var(--sage-dark);
  color: white;
}

/* Barre de progression pour les cadeaux partiellement offerts */
.gift-progress {
  margin-bottom: 12px;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--sage-pale);
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 6px;
}

.progress-fill {
  height: 100%;
  background: var(--sage-mid);
  border-radius: 20px;
}

.progress-text {
  font-size: 0.82em;
  color: var(--sage-darkest);
  margin: 0;
}

.gift-actions {
  margin-top: auto;
  display: flex;
  gap: 8px;
}

.btn {
  cursor: pointer;
  border: none;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 0.9em;
  flex: 1;
}

.btn-buy {
  background: var(--sage-dark);
  color: white;
}

.btn-participate {
  background: var(--sage-light);
  color: var(--sage-darkest);
}

.already-done {
  font-style: italic;
  color: #999;
  margin-top: auto;
}

/* Modale */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.modal-overlay.hidden {
  display: none;
}

.hidden {
  display: none !important;
}

.modal {
  background: white;
  border-radius: 10px;
  padding: 30px;
  max-width: 420px;
  width: 100%;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  font-size: 1.5em;
  cursor: pointer;
  color: #999;
}

.modal label {
  display: block;
  margin: 14px 0 6px;
  font-size: 0.9em;
  color: #555;
}

.modal input, .modal select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 1em;
}

.btn-confirm {
  margin-top: 20px;
  width: 100%;
  background: var(--sage-dark);
  color: white;
  padding: 12px;
}

.form-error {
  color: #a34a4a;
  margin-top: 10px;
}

.iban-block, #thanks-buy-link-block {
  background: var(--sage-pale);
  padding: 14px;
  border-radius: 8px;
  margin: 16px 0;
  font-size: 0.92em;
}

/* Admin */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 0.9em;
}

.admin-table th, .admin-table td {
  border: 1px solid #eee;
  padding: 8px 10px;
  text-align: left;
}

.admin-table th {
  background: var(--sage-light);
  color: var(--sage-darkest);
}

.login-box {
  max-width: 340px;
  margin: 100px auto;
  background: white;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.login-box input {
  width: 100%;
  padding: 10px;
  margin: 10px 0;
  border: 1px solid #ddd;
  border-radius: 6px;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px 20px 0;
}

.top-bar a {
  color: var(--sage-dark);
  text-decoration: none;
  font-size: 0.9em;
}
