:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  color: #17233b;
  background: #eef3f8;
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(145deg, #e9f3fb 0%, #f7f9fc 55%, #eaf0f7 100%);
}

.card {
  width: min(100%, 620px);
  padding: clamp(28px, 5vw, 48px);
  background: white;
  border: 1px solid #dce5ef;
  border-radius: 18px;
  box-shadow: 0 18px 55px rgb(26 58 91 / 12%);
}

.brand {
  color: #0769a5;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

h1 { margin: 8px 0; font-size: clamp(1.8rem, 5vw, 2.5rem); }
header { margin-bottom: 28px; }
header p:last-child, .privacy { color: #607089; }

form, label { display: grid; gap: 8px; }
form { gap: 20px; }
label { font-weight: 650; }
.columns { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

input {
  width: 100%;
  border: 1px solid #b9c6d6;
  border-radius: 9px;
  padding: 13px 14px;
  color: #17233b;
  background: white;
  font: inherit;
}

input:focus { outline: 3px solid rgb(0 126 188 / 18%); border-color: #007ebc; }

button {
  border: 0;
  border-radius: 10px;
  padding: 14px 18px;
  color: white;
  background: #0769a5;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

button:hover { background: #045783; }
button:disabled { cursor: not-allowed; background: #91a0b2; }

.alert {
  margin-bottom: 22px;
  padding: 14px;
  border: 1px solid #efb7b7;
  border-radius: 9px;
  color: #7f1d1d;
  background: #fff1f1;
}

.privacy { margin: 22px 0 0; font-size: .85rem; }
.summary { margin: 0 0 26px; }
.summary div { display: flex; justify-content: space-between; gap: 24px; padding: 13px 0; border-bottom: 1px solid #e4eaf1; }
.summary dt { color: #607089; }
.summary dd { margin: 0; font-weight: 700; text-align: right; }
.summary .remaining { color: #0769a5; font-size: 1.1rem; }
.back { display: block; margin-top: 20px; color: #0769a5; text-align: center; }
.unpaid { margin-top: 34px; }
.unpaid h2 { margin-bottom: 14px; font-size: 1.25rem; }
.invoice-list { display: grid; gap: 10px; }
.invoice-list article { display: flex; justify-content: space-between; gap: 20px; padding: 14px; border: 1px solid #dce5ef; border-radius: 10px; }
.invoice-list article.current { border-color: #65a9cf; background: #f1f9fd; }
.invoice-list article > div { display: grid; gap: 4px; }
.invoice-list span { color: #607089; font-size: .82rem; }
.invoice-amount { text-align: right; }
.invoice-card { position: relative; width: min(100%, 560px); }
.invoice-card header { margin-top: 10px; }
.top-back { position: absolute; top: 18px; right: 24px; color: #607089; font-size: .78rem; text-decoration: none; }
.top-back:hover { color: #185fa5; }
.status-badge { display: inline-flex; padding: 4px 9px; border-radius: 999px; font-size: .76rem; font-weight: 750; }
.status-not_paid { color: #9b2929; background: #fde8e8; }
.status-partial, .status-in_payment { color: #85500c; background: #fff0cf; }
.status-paid { color: #176b3a; background: #e4f6eb; }
.stripe-note { margin: 9px 0 0; color: #607089; text-align: center; font-size: .76rem; }
.invoice-list form { margin: 0; }
.invoice-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px;
  border: 1px solid #dce5ef;
  border-radius: 10px;
  color: #17233b;
  background: white;
  text-align: left;
}
.invoice-row:hover { border-color: #65a9cf; background: #f6fbfe; }
.invoice-row.current, .invoice-row.current:disabled { border-color: #378add; color: #17233b; background: #f1f9fd; opacity: 1; cursor: default; }
.invoice-identity, .invoice-amount { display: grid; gap: 3px; }
.invoice-row small { color: #607089; font-size: .76rem; font-weight: 500; }
.switch-help { margin: 10px 0 0; color: #607089; text-align: center; font-size: .78rem; }
.secondary-back { width: fit-content; margin: 24px auto 0; }

@media (max-width: 520px) {
  .columns { grid-template-columns: 1fr; }
  body { padding: 12px; }
}

/* Formulaire d'identification */
.payment-card {
  width: min(100%, 430px);
  padding: clamp(26px, 6vw, 34px);
  border-radius: 14px;
  box-shadow: 0 12px 36px rgb(26 58 91 / 10%);
}

.payment-header { margin-bottom: 22px; }
.payment-header h1 { margin: 20px 0; font-size: clamp(1rem, 7vw, 1.65rem); }
.payment-header > p { margin: 0; font-size: .86rem; }
.brand-row { display: flex; align-items: center; justify-content: center; gap: 9px; }
.brand-row .brand { font-size: .76rem; }

.brand-icon {
  width: 156px;
  height: 36px;
  object-fit: contain;
}
.progress { display: flex; gap: 5px; margin-top: 12px; }
.progress span { height: 4px; flex: 1; border-radius: 3px; background: #dfe6ee; }
.progress .active { background: #378add; }

.payment-card form { gap: 7px; }
.payment-card form > label { margin-top: 12px; font-size: .86rem; }
.payment-card input { padding: 11px 12px; border-radius: 7px; }

.reference-help { margin: 0 0 4px; color: #185fa5; font-size: .78rem; }
.reference-help summary { display: flex; align-items: center; gap: 5px; width: fit-content; cursor: pointer; list-style: none; }
.reference-help summary::-webkit-details-marker { display: none; }
.reference-help svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.reference-help p { margin: 7px 0 2px; padding: 9px 10px; border-radius: 6px; color: #4c6078; background: #f2f6fa; line-height: 1.4; }

.primary-button { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 14px; border-radius: 7px; background: #185fa5; }
.primary-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.payment-card .privacy { display: flex; align-items: flex-start; justify-content: center; gap: 5px; margin-top: 14px; text-align: center; font-size: .7rem; line-height: 1.4; }
.privacy svg { width: 13px; height: 13px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }

@media (max-width: 420px) {
  .payment-card { padding: 24px 20px; }
  .brand-icon { width: 142px; height: 33px; }
}

.status-card { width: min(100%, 460px); text-align: center; }
.status-icon { width: 54px; height: 54px; display: grid; place-items: center; margin: 0 auto 18px; border-radius: 50%; font-size: 1.8rem; font-weight: 800; }
.status-icon.success { color: #176b3a; background: #e4f6eb; }
.status-icon.cancelled { color: #8a3030; background: #fdeaea; }
.status-icon.pending { color: #85500c; background: #fff0cf; }
.receipt-card > p { color: #607089; line-height: 1.5; }
.receipt-summary { margin: 24px 0 20px; padding: 13px 16px; border-radius: 9px; background: #f7f9fc; text-align: left; }
.receipt-summary div { display: flex; justify-content: space-between; gap: 18px; padding: 5px 0; }
.receipt-summary dt { color: #607089; }
.receipt-summary dd { margin: 0; font-weight: 700; text-align: right; }
.receipt-summary .paid-amount { color: #178144; }
.receipt-button { display: block; padding: 13px 16px; border-radius: 8px; color: white; background: #287fd3; font-weight: 750; text-decoration: none; }
.receipt-button:hover { background: #176bb7; }
