/*
 * Page /carte-cadeau : bloc « Composez votre carte cadeau » (maquette V2).
 * Tout est préfixé .tgc- pour ne rien toucher au reste du site.
 */

@font-face {
  font-family: "TGC Neucha";
  src: url("../fonts/Neucha-Regular.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "TGC Poppins";
  src: url("../fonts/Poppins-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "TGC Poppins";
  src: url("../fonts/Poppins-Medium.ttf") format("truetype");
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "TGC Poppins";
  src: url("../fonts/Poppins-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "TGC Poppins";
  src: url("../fonts/Poppins-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "TGC Poppins";
  src: url("../fonts/Poppins-ExtraBold.ttf") format("truetype");
  font-weight: 800;
  font-display: swap;
}

.tgc {
  --tgc-bordeaux: #92284d;
  --tgc-bordeaux-dark: #7a2040;
  --tgc-navy: #24356b;
  --tgc-ink: #15172d;
  --tgc-beige: #f6eee5;
  --tgc-line: #8b95b5;
  --tgc-muted: #6b7088;
  --tgc-border: #8b95c9;
  --tgc-error: #c0392b;

  box-sizing: border-box;
  color: var(--tgc-ink);
  font-family: "TGC Poppins", "Poppins", Arial, sans-serif;
  margin: 0 auto;
  max-width: 1180px;
  padding: 0 19.2px 86.4px;
}

.tgc *,
.tgc *::before,
.tgc *::after {
  box-sizing: inherit;
}

.tgc-intro {
  margin: 67.2px auto 57.6px;
  max-width: 1176px;
  text-align: center;
}

.tgc-intro h1 {
  font-size: 36px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 4.8px;
}

.tgc-intro p {
  font-size: 26.4px;
  font-weight: 600;
  line-height: 1.35;
  margin: 0;
}

.tgc-layout {
  align-items: flex-start;
  display: grid;
  gap: 48px;
  grid-template-columns: minmax(0, 540px) minmax(0, 540px);
  justify-content: center;
}

/* ---------- Colonne gauche : la carte ---------- */

.tgc-preview {
  position: sticky;
  top: 110px;
}

.tgc-preview-frame {
  background: var(--tgc-beige);
  border-radius: 33.6px;
  padding: 38.4px 38.4px 26.4px;
  text-align: center;
}

.tgc-card {
  aspect-ratio: 1748 / 1240;
  background: #fff;
  border-radius: 21.6px;
  box-shadow: 0 7.2px 21.6px rgba(36, 53, 107, 0.12);
  overflow: hidden;
  width: 100%;
}

.tgc-card canvas {
  display: block;
  height: 100%;
  width: 100%;
}

.tgc-preview-caption {
  font-size: 19.2px;
  margin: 21.6px 0 0;
}

.tgc-perks {
  display: grid;
  gap: 9.6px;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 14.4px;
}

.tgc-perk {
  background: #fff;
  border: 1px solid #ececec;
  border-radius: 9.6px;
  box-shadow: 0 1px 4.8px rgba(0, 0, 0, 0.05);
  font-size: 14.4px;
  line-height: 1.15;
  padding: 12px 10.8px 14.4px;
}

.tgc-perk img {
  display: block;
  height: 38.4px;
  margin-bottom: 16.8px;
  width: auto;
}

.tgc-perk strong {
  display: block;
  font-size: 14.4px;
  font-weight: 600;
}

/* ---------- Colonne droite : le formulaire ---------- */

.tgc-panel {
  background: #fff;
  border-radius: 33.6px;
  box-shadow: 0 4.8px 28.8px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.tgc-panel-body {
  padding: 38.4px 39.6px 28.8px;
}

.tgc-step-title {
  font-size: 21.6px;
  font-weight: 700;
  margin: 0 0 21.6px;
  padding-left: 9.6px;
}

.tgc-step-title + .tgc-later {
  margin-top: -6px;
}

.tgc-step {
  margin-bottom: 28.8px;
}

.tgc-label {
  display: block;
  font-size: 14.4px;
  font-weight: 600;
  margin: 0 0 7.2px;
}

.tgc-label span {
  font-weight: 400;
}

.tgc-amounts {
  display: grid;
  gap: 9.6px;
  grid-template-columns: repeat(4, 1fr);
}

.tgc-amount {
  background: #fff;
  border: 1px solid var(--tgc-border);
  border-radius: 9.6px;
  color: var(--tgc-navy);
  cursor: pointer;
  font-family: inherit;
  font-size: 15.6px;
  font-weight: 600;
  height: 50.4px;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.tgc-amount:hover {
  border-color: var(--tgc-navy);
}

.tgc-amount[aria-pressed="true"] {
  background: var(--tgc-navy);
  border-color: var(--tgc-navy);
  color: #fff;
}

.tgc-or {
  align-items: center;
  display: flex;
  font-size: 12px;
  gap: 19.2px;
  margin: 14.4px 0 16.8px;
}

.tgc-or::before,
.tgc-or::after {
  border-top: 1px solid var(--tgc-ink);
  content: "";
  flex: 1;
}

.tgc-input,
.tgc-textarea {
  background: #fff;
  border: 1px solid var(--tgc-border);
  border-radius: 4.8px;
  color: var(--tgc-ink);
  font-family: inherit;
  font-size: 15.6px;
  padding: 8.4px 12px;
  width: 100%;
}

.tgc-input::placeholder,
.tgc-textarea::placeholder {
  color: #a9adc2;
}

.tgc-input:focus,
.tgc-textarea:focus {
  border-color: var(--tgc-navy);
  box-shadow: 0 0 0 3.6px rgba(36, 53, 107, 0.12);
  outline: none;
}

.tgc-input:disabled,
.tgc-textarea:disabled {
  background: #f3f3f6;
  color: #9a9db0;
}

.tgc-input-euro {
  position: relative;
}

.tgc-input-euro .tgc-input {
  padding-right: 38.4px;
}

.tgc-input-euro::after {
  color: var(--tgc-navy);
  content: "€";
  font-size: 15.6px;
  font-weight: 700;
  pointer-events: none;
  position: absolute;
  right: 14.4px;
  top: 50%;
  transform: translateY(-50%);
}

.tgc-hint {
  font-size: 12.6px;
  line-height: 1.45;
  margin: 14.4px 0 0;
}

.tgc-error {
  color: var(--tgc-error);
  font-size: 13.2px;
  margin: 7.2px 0 0;
}

.tgc-error:empty {
  display: none;
}

.tgc-row {
  display: grid;
  gap: 9.6px;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 16.8px;
}

.tgc-textarea {
  height: 69.6px;
  resize: none;
}

.tgc-counter {
  color: var(--tgc-muted);
  font-size: 10.8px;
  margin-top: 2px;
  text-align: right;
}

/* Idées : 2 lignes sur ordinateur (« Idées : » + 2 idées, puis 2 idées) */
.tgc-ideas {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 7px 6px;
  margin-top: 12px;
}

.tgc-ideas > span {
  font-size: 14px;
  margin-right: 2px;
}

.tgc-idea {
  align-items: center;
  background: var(--tgc-beige);
  border: 0;
  border-radius: 4.8px;
  color: var(--tgc-navy);
  cursor: pointer;
  display: inline-flex;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  gap: 5px;
  padding: 7px 9px;
  transition: background 0.15s;
  white-space: nowrap;
}

.tgc-idea:hover {
  background: #eee0cf;
}

.tgc-idea:disabled {
  cursor: default;
  opacity: 0.5;
}

.tgc-idea svg {
  flex: none;
  height: 14px;
  width: 12px;
}

/* Case « Je préfère l'écrire à la main », explication dans la bulle « i » */
.tgc-later {
  align-items: center;
  display: flex;
  font-size: 13.8px;
  gap: 8px;
  margin-bottom: 18px;
}

.tgc-later label {
  align-items: center;
  cursor: pointer;
  display: inline-flex;
  gap: 8px;
  margin: 0;
}

.tgc-later input {
  accent-color: var(--tgc-navy);
  margin: 0;
}

.tgc-info {
  align-items: center;
  border: 1.5px solid var(--tgc-navy);
  border-radius: 50%;
  color: var(--tgc-navy);
  cursor: help;
  display: inline-flex;
  flex: none;
  font-family: Georgia, serif;
  font-size: 11px;
  font-style: italic;
  font-weight: 700;
  height: 17px;
  justify-content: center;
  position: relative;
  width: 17px;
}

.tgc-tip {
  background: var(--tgc-ink);
  border-radius: 6px;
  bottom: calc(100% + 8px);
  color: #fff;
  font-family: "TGC Poppins", "Poppins", Arial, sans-serif;
  font-size: 12px;
  font-style: normal;
  font-weight: 400;
  left: 50%;
  line-height: 1.45;
  opacity: 0;
  padding: 8px 10px;
  pointer-events: none;
  position: absolute;
  transform: translateX(-50%);
  transition: opacity 0.15s;
  width: 240px;
  z-index: 5;
}

.tgc-tip::after {
  border: 6px solid transparent;
  border-top-color: var(--tgc-ink);
  content: "";
  left: 50%;
  position: absolute;
  top: 100%;
  transform: translateX(-50%);
}

.tgc-info:hover .tgc-tip,
.tgc-info:focus .tgc-tip {
  opacity: 1;
}

/* ---------- Pied du formulaire : total et paiement ---------- */

.tgc-panel-footer {
  background: #f9f9f9;
  padding: 48px 39.6px 33.6px;
}

.tgc-total {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 21.6px;
}

.tgc-total span {
  font-size: 16.8px;
  font-weight: 600;
}

.tgc-total strong {
  color: var(--tgc-navy);
  font-size: 43.2px;
  font-weight: 800;
  line-height: 1;
}

.tgc-check {
  align-items: flex-start;
  cursor: pointer;
  display: flex;
  font-size: 13.8px;
  gap: 12px;
  line-height: 1.5;
}

.tgc-check input {
  accent-color: var(--tgc-navy);
  flex: none;
  margin: 3.6px 0 0;
}

.tgc-check a,
.tgc-link {
  background: none;
  border: 0;
  color: #1f4fc1;
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-decoration: underline;
}

.tgc-pay {
  align-items: center;
  background: var(--tgc-bordeaux);
  border: 0;
  border-radius: 9.6px;
  color: #fff;
  cursor: pointer;
  display: flex;
  font-family: inherit;
  font-size: 15.6px;
  font-weight: 700;
  gap: 12px;
  height: 43.2px;
  justify-content: center;
  margin-top: 24px;
  transition: background 0.15s;
  width: 100%;
}

.tgc-pay:hover {
  background: var(--tgc-bordeaux-dark);
}

.tgc-pay:disabled {
  cursor: default;
  opacity: 0.55;
}

.tgc-pay svg {
  height: 18px;
  width: 15.6px;
}

.tgc-secure {
  font-size: 12.6px;
  line-height: 1.5;
  margin: 14.4px 0 0;
  text-align: center;
}

/* ---------- Étape paiement ---------- */

.tgc-payment-head {
  align-items: baseline;
  display: flex;
  justify-content: space-between;
  margin-bottom: 16.8px;
}

.tgc-payment-head .tgc-step-title {
  margin: 0;
}

.tgc-methods {
  display: grid;
  gap: 9.6px;
  margin: 16.8px 0 19.2px;
}

.tgc-method {
  align-items: center;
  background: #fff;
  border: 1px solid #d9dbe6;
  border-radius: 9.6px;
  cursor: pointer;
  display: flex;
  font-size: 15px;
  gap: 12px;
  padding: 13.2px 14.4px;
}

.tgc-method input {
  accent-color: var(--tgc-navy);
  margin: 0;
}

.tgc-method small {
  color: var(--tgc-muted);
  display: block;
  font-size: 12.6px;
}

.tgc-method:has(input:checked) {
  border-color: var(--tgc-navy);
  box-shadow: 0 0 0 1px var(--tgc-navy);
}

.tgc-method[hidden] {
  display: none;
}

.tgc-widget {
  margin-top: 16.8px;
}

.tgc-widget:empty {
  display: none;
}

.tgc-card-field {
  background: #fff;
  border: 1px solid var(--tgc-border);
  border-radius: 4.8px;
  min-height: 48px;
  padding: 12px;
}

.tgc-widget .tgc-input {
  margin-bottom: 12px;
}

#tgc-payment-request {
  margin-top: 12px;
}

/* ---------- Confirmation ---------- */

.tgc-done {
  padding: 48px 39.6px;
  text-align: center;
}

.tgc-done h3 {
  color: var(--tgc-navy);
  font-size: 26.4px;
  font-weight: 700;
  margin: 0 0 12px;
}

.tgc-done p {
  font-size: 16.2px;
  line-height: 1.55;
  margin: 0 0 21.6px;
}

.tgc-done .tgc-pay {
  display: flex;
  margin: 12px auto 0;
  max-width: 340px;
  padding: 0 28.8px;
  text-decoration: none;
}

/* Carte à imprimer : bouton secondaire, contour bordeaux */
.tgc-done .tgc-pay--outline {
  background: #fff;
  border: 2px solid var(--tgc-bordeaux);
  color: var(--tgc-bordeaux);
}

.tgc-done .tgc-pay--outline:hover {
  background: var(--tgc-beige);
}

.tgc-spinner {
  animation: tgc-spin 0.9s linear infinite;
  border: 3.6px solid #e3e5ef;
  border-radius: 50%;
  border-top-color: var(--tgc-navy);
  height: 40.8px;
  margin: 0 auto 19.2px;
  width: 40.8px;
}

@keyframes tgc-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Fenêtre des conditions ---------- */

.tgc-modal {
  align-items: center;
  background: rgba(21, 23, 45, 0.55);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 19.2px;
  position: fixed;
  z-index: 2000;
}

.tgc-modal[hidden] {
  display: none;
}

.tgc-modal-box {
  background: #fff;
  border-radius: 19.2px;
  max-height: 90vh;
  max-width: 560px;
  overflow: auto;
  padding: 33.6px 33.6px 28.8px;
  position: relative;
}

.tgc-modal-box h3 {
  color: var(--tgc-navy);
  font-size: 24px;
  margin: 0 0 16.8px;
}

.tgc-modal-box ul {
  font-size: 16.2px;
  line-height: 1.55;
  margin: 0 0 21.6px;
  padding-left: 24px;
}

.tgc-modal-box li {
  margin-bottom: 9.6px;
}

.tgc-modal-close {
  background: none;
  border: 0;
  color: var(--tgc-ink);
  cursor: pointer;
  font-size: 31.2px;
  line-height: 1;
  position: absolute;
  right: 16.8px;
  top: 12px;
}

/* ---------- Téléphone et tablette ---------- */

@media (max-width: 991px) {
  .tgc-layout {
    grid-template-columns: minmax(0, 560px);
  }

  .tgc-preview {
    position: static;
  }
}

@media (max-width: 575px) {
  .tgc {
    padding: 0 14.4px 57.6px;
  }

  .tgc-intro {
    margin: 43.2px auto 33.6px;
  }

  .tgc-intro h1 {
    font-size: 28.8px;
  }

  .tgc-intro p {
    font-size: 19.2px;
  }

  .tgc-preview-frame {
    border-radius: 24px;
    padding: 21.6px 19.2px 16.8px;
  }

  .tgc-perks {
    gap: 7.2px;
  }

  .tgc-perk {
    font-size: 13.2px;
    padding: 9.6px 8.4px 12px;
  }

  .tgc-panel {
    border-radius: 24px;
  }

  .tgc-panel-body,
  .tgc-panel-footer {
    padding-left: 21.6px;
    padding-right: 21.6px;
  }

  .tgc-amounts {
    grid-template-columns: repeat(2, 1fr);
  }

  .tgc-row {
    grid-template-columns: 1fr;
  }

  .tgc-total strong {
    font-size: 36px;
  }
}
