:root {
  --bg: #f4f7f1;
  --surface: #ffffff;
  --ink: #102218;
  --muted: #4d6654;
  --line: #d5e2d6;
  --brand: #157347;
  --brand-soft: #dff3e7;
  --danger: #b54729;
  --danger-soft: #ffe7df;
  --radius: 18px;
  --shadow: 0 16px 40px rgba(16, 34, 24, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 15% 10%, #eef8ef 0%, #f4f7f1 35%, #edf4ec 100%);
  min-height: 100vh;
}

.background-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(21, 115, 71, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 115, 71, 0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(circle at center, black 45%, transparent 85%);
}

.container {
  width: min(980px, calc(100vw - 32px));
  margin: 36px auto 70px;
  position: relative;
  z-index: 1;
  animation: enter 420ms ease-out;
}

.hero {
  margin-bottom: 24px;
}

.brand-ribbon {
  margin-top: 14px;
  display: inline-block;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 700;
  color: #12334f;
  background: linear-gradient(90deg, #d9efff, #eaf6ff);
  border: 1px solid #b7d9f4;
}

.eyebrow {
  margin: 0;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--brand);
  font-weight: 600;
  font-size: 12px;
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.logo-cgea-header {
  height: 42px;
  width: auto;
  display: block;
  object-fit: contain;
}

h1,
h2 {
  font-family: "Space Grotesk", sans-serif;
  margin: 8px 0;
}

h1 {
  font-size: clamp(30px, 6vw, 46px);
  line-height: 1;
}

h2 {
  font-size: 22px;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  max-width: 700px;
}

.support-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.logo-satim-3020 {
  height: 40px;
  width: auto;
  display: inline-block;
  vertical-align: middle;
  object-fit: contain;
}

.panel {
  background: color-mix(in srgb, var(--surface) 90%, #eef5eb 10%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 16px;
  animation: rise 520ms ease-out;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  font-weight: 500;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  font: inherit;
  color: inherit;
  background: #fff;
}

.select-field {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  font: inherit;
  color: inherit;
  background: #fff;
}

input:focus {
  outline: 2px solid color-mix(in srgb, var(--brand) 35%, transparent);
  border-color: var(--brand);
}

.btn {
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
  border-radius: 999px;
  padding: 10px 14px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 120ms ease, filter 120ms ease;
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(0.96);
}

.btn.ghost {
  background: transparent;
  color: var(--brand);
}

.btn.warn {
  border-color: var(--danger);
  background: var(--danger);
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.inline-form input {
  flex: 1;
  min-width: 240px;
}

.result {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: var(--brand-soft);
  white-space: pre-wrap;
}

.result.error {
  background: var(--danger-soft);
  border-color: color-mix(in srgb, var(--danger) 35%, #ffd9cf 65%);
}

.hidden {
  display: none;
}

.cards {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}

.card strong {
  font-family: "Space Grotesk", sans-serif;
}

.button-row {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.back-link {
  color: var(--brand);
  font-weight: 600;
}

.amount-highlight {
  margin: 8px 0 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(26px, 5vw, 44px);
  font-weight: 700;
  color: #0e5b37;
  background: linear-gradient(90deg, #d8f6e4, #eefaf3);
  border: 1px solid #b8e2c8;
  border-radius: 14px;
  display: inline-block;
  padding: 6px 14px;
}

.amount-editor {
  display: grid;
  gap: 8px;
  max-width: 340px;
}

.member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.amount-input {
  font-size: 20px;
  font-weight: 700;
  border: 2px solid #8ec9a5;
}

.terms-box {
  border: 1px dashed #97c6a9;
  border-radius: 12px;
  padding: 12px;
  background: #f8fff9;
  margin-bottom: 12px;
}

.terms-box p {
  margin: 0 0 8px;
}

.terms-box p:last-child {
  margin-bottom: 0;
}

.terms-box a {
  color: var(--brand);
  font-weight: 600;
}

.terms-box .conditions-generales-accept {
  margin-top: 12px;
}

.captcha-wrap {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  align-items: center;
  grid-template-columns: minmax(120px, 220px) minmax(170px, 240px) auto;
}

.captcha-question {
  font-weight: 700;
  color: #0e5b37;
}

.checkbox-line {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox-line input {
  width: 18px;
  height: 18px;
}

.pay-btn {
  grid-column: 1 / -1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(180deg, #138049, #0f6c3d);
  border-color: #0f6c3d;
  padding: 12px 16px;
}

.pay-btn-logo {
  height: 44px;
  width: auto;
  max-width: 160px;
  border-radius: 8px;
  background: #ffffff;
  padding: 6px 10px;
  object-fit: contain;
  object-position: center;
  display: block;
  flex-shrink: 0;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

.status-ok {
  color: #0f6c3d;
  font-weight: 700;
}

.status-ko {
  color: #b54729;
  font-weight: 700;
}

.rejection-lang {
  margin-bottom: 1rem;
}
.rejection-lang:last-child {
  margin-bottom: 0;
}
.rejection-lang strong {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
}
.rejection-lang pre {
  margin: 0;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: inherit;
  font-size: 0.9rem;
}
.rejection-lang-ar pre {
  font-size: 1rem;
  line-height: 1.5;
}

.receipt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.receipt-actions input {
  flex: 1;
  min-width: 220px;
}

@media print {
  .background-grid,
  .receipt-actions,
  .no-print {
    display: none !important;
  }

  body {
    background: #fff;
  }

  .panel {
    box-shadow: none;
    border-color: #ccc;
  }
}

@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 640px) {
  .container {
    margin: 24px auto 48px;
  }

  .panel {
    padding: 14px;
  }

  .button-row .btn {
    width: 100%;
  }

  .captcha-wrap {
    grid-template-columns: 1fr;
  }
}
