:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --text: #142033;
  --muted: #667085;
  --border: #dbe3ef;
  --primary: #1f6feb;
  --primary-hover: #1758ba;
  --primary-soft: #e9f1ff;
  --success: #12805c;
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background: linear-gradient(180deg, #eef4ff 0%, var(--bg) 220px);
  color: var(--text);
  line-height: 1.6;
  padding-bottom: 110px;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.campaign-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(219, 227, 239, 0.9);
}

.campaign-header__inner {
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  justify-content: center;
}

.campaign-logo {
  width: auto;
  max-width: 170px;
  height: 44px;
  object-fit: contain;
}

.campaign-shell {
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 20px 16px 40px;
}

.campaign-card {
  background: var(--surface);
  border: 1px solid rgba(219, 227, 239, 0.9);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 18px;
}

.campaign-card--hero {
  padding-bottom: 28px;
}

.campaign-title,
.section-title,
.story-heading {
  margin: 0;
  color: var(--text);
  line-height: 1.2;
}

.campaign-title {
  font-size: clamp(2rem, 3vw, 2.6rem);
  text-align: center;
  letter-spacing: -0.04em;
}

.hero-media,
.story-media {
  margin: 20px 0 0;
}

.hero-media img,
.story-media img {
  width: 100%;
  border-radius: 22px;
  object-fit: cover;
}

.campaign-subtitle,
.section-subtitle {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1rem;
  text-align: center;
}

.progress-head,
.progress-foot,
.sticky-progress__meta,
.comment-head,
.comment-meta,
.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.progress-head__label,
.progress-head__goal,
.progress-foot,
.sticky-progress__meta {
  color: var(--muted);
}

.progress-head__label {
  margin: 0 0 4px;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.progress-head__amount {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.3rem);
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.04em;
}

.progress-head__goal {
  margin: 0;
  font-weight: 700;
}

.progress-bar,
.sticky-progress__bar {
  width: 100%;
  height: 16px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5edf8;
}

.progress-bar__fill,
.sticky-progress__fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3d8bff 0%, var(--primary) 100%);
}

.progress-bar__fill {
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.9s ease;
}

.progress-bar.animated .progress-bar__fill {
  transform: scaleX(1);
}

.progress-foot {
  margin-top: 10px;
  font-size: 0.92rem;
  font-weight: 700;
}

.cta-button,
.donation-button,
.primary-copy {
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.cta-button:hover,
.donation-button:hover,
.primary-copy:hover {
  transform: translateY(-1px);
}

.cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 58px;
  padding: 14px 18px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary) 0%, #0f5bd3 100%);
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 14px 24px rgba(31, 111, 235, 0.22);
}

.story-block + .story-block {
  margin-top: 30px;
  padding-top: 26px;
  border-top: 1px solid var(--border);
}

.story-heading,
.section-title {
  font-size: clamp(1.35rem, 2vw, 1.7rem);
  letter-spacing: -0.03em;
}

.story-copy,
.final-copy {
  margin-top: 14px;
  color: #334155;
}

.story-copy p,
.final-copy p {
  margin: 0 0 14px;
}

.story-copy p:last-child,
.final-copy p:last-child {
  margin-bottom: 0;
}

.donation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.donation-button {
  width: 100%;
  min-height: 62px;
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 800;
  font-size: 1rem;
}

.most-chosen-wrapper {
  position: relative;
}

.most-chosen-wrapper .donation-button {
  background: linear-gradient(90deg, var(--primary) 0%, #0f5bd3 100%);
  color: #fff;
}

.most-chosen-tag {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 12px;
  border-radius: 999px;
  background: #0f172a;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.custom-donation {
  margin-top: 18px;
  padding: 18px;
  border-radius: 20px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
}

.custom-donation-label {
  display: block;
  margin-bottom: 10px;
  font-weight: 700;
}

.custom-donation-field {
  display: flex;
  align-items: center;
  overflow: hidden;
  border: 2px solid var(--primary);
  border-radius: 16px;
  background: #fff;
}

.custom-donation-prefix {
  padding: 0 18px;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
}

.custom-donation-input {
  flex: 1;
  min-width: 0;
  height: 56px;
  padding: 0 16px;
  border: none;
  background: transparent;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.custom-donation-input:focus {
  outline: none;
}

.custom-donation-hint,
.custom-donation-error {
  margin: 8px 0 0;
  font-size: 0.9rem;
}

.custom-donation-hint {
  color: var(--muted);
}

.custom-donation-error {
  min-height: 20px;
  color: #b42318;
  font-weight: 700;
}

.custom-donation-field.has-error {
  border-color: #b42318;
}

.custom-donation-submit {
  margin-top: 12px;
}

.comments-list {
  margin-top: 22px;
  display: grid;
  gap: 14px;
}

.comment-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.comment-avatar img {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
}

.comment-body {
  flex: 1;
  min-width: 0;
}

.comment-bubble {
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
}

.comment-name {
  font-weight: 800;
}

.comment-time,
.comment-actions {
  color: var(--muted);
  font-size: 0.9rem;
}

.comment-text {
  margin: 8px 0 0;
  color: #334155;
}

.comment-meta {
  margin-top: 6px;
  padding: 0 4px;
  font-size: 0.9rem;
}

.comment-reactions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}

.comment-reactions svg {
  width: 16px;
  height: 16px;
  fill: #e6466a;
}

.sticky-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px));
  background: rgba(245, 247, 251, 0.92);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(219, 227, 239, 0.95);
}

.sticky-bar__inner {
  width: min(100%, 720px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.sticky-progress__amount {
  font-weight: 800;
  color: var(--text);
}

.cta-button--compact {
  width: auto;
  min-width: 260px;
  min-height: 52px;
  padding: 12px 22px;
  white-space: nowrap;
}

.modal {
  position: fixed;
  inset: 0;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  overflow-y: auto;
  padding: 24px 16px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0);
  transition: background 0.22s ease;
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(92vw, 560px);
  max-height: calc(100dvh - 48px);
  margin: auto;
  padding: 28px 22px 24px;
  overflow-y: auto;
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 30px 60px rgba(15, 23, 42, 0.22);
  transform: translateY(14px) scale(0.98);
  opacity: 0;
  transition: transform 0.22s ease, opacity 0.22s ease;
  text-align: center;
}

.modal.show .modal-backdrop {
  background: rgba(15, 23, 42, 0.58);
}

.modal.show .modal-panel {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background: #eff4fb;
  color: var(--text);
  font-size: 1.5rem;
}

.modal-status {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.modal-status.is-pending {
  color: var(--text);
}

.modal-status.is-approved {
  color: var(--success);
}

.modal-status.is-error {
  color: #b42318;
}

.modal-status.is-expired {
  color: var(--muted);
}

.blink {
  animation: blink 1.5s infinite;
}

@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.45;
  }
}

.modal-subtitle,
.modal-meta {
  color: var(--muted);
}

.modal-subtitle {
  margin: 8px 0 0;
}

.modal-amount {
  margin-top: 8px;
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.modal-meta {
  min-height: 20px;
  margin-top: 6px;
  word-break: break-word;
}

.pix-checkout-card {
  margin-top: 18px;
  padding: 18px;
  border-radius: 24px;
  background: linear-gradient(180deg, #f8fbff 0%, #f2f7ff 100%);
  border: 1px solid #dbe6f5;
}

.pix-checkout-head,
.pix-copy-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
}

.pix-step-chip {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, #0f5bd3 100%);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 900;
  box-shadow: 0 10px 18px rgba(31, 111, 235, 0.22);
}

.pix-checkout-copy {
  display: grid;
  gap: 2px;
}

.pix-checkout-copy strong {
  color: var(--text);
  font-size: 1rem;
  line-height: 1.2;
}

.pix-checkout-copy span {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.qrcode-shell {
  margin-top: 16px;
  padding: 18px;
  border-radius: 22px;
  background:
    radial-gradient(circle at top, rgba(31, 111, 235, 0.08), transparent 55%),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid #dbe6f5;
}

.qrcode {
  width: 272px;
  min-height: 272px;
  margin: 0 auto;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 24px;
  background:
    linear-gradient(45deg, #f3f7fd 25%, transparent 25%, transparent 75%, #f3f7fd 75%),
    linear-gradient(45deg, #f3f7fd 25%, transparent 25%, transparent 75%, #f3f7fd 75%);
  background-position: 0 0, 12px 12px;
  background-size: 24px 24px;
  border: 1px solid #d7e2f0;
  box-shadow: inset 0 0 0 10px #fff, 0 18px 30px rgba(15, 23, 42, 0.08);
}

.qrcode img,
.qrcode svg {
  display: block;
  width: 100%;
  height: auto;
}

.pix-divider {
  position: relative;
  margin: 16px 0;
  text-align: center;
}

.pix-divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: #d7e2f0;
}

.pix-divider span {
  position: relative;
  display: inline-block;
  padding: 0 12px;
  background: #f2f7ff;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.pix-copy-card {
  padding: 16px;
  border-radius: 20px;
  background: #ffffff;
  border: 1px solid #dbe6f5;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.05);
}

.pix-text-wrap {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

#modal-pix-text {
  flex: 1;
  min-width: 0;
  height: 52px;
  padding: 0 14px;
  border: 1px solid #d7e2f0;
  border-radius: 14px;
  background: #f8fbff;
  color: #1e293b;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.9rem;
  font-weight: 700;
}

.primary-copy {
  min-width: 132px;
  padding: 0 18px;
  border-radius: 14px;
  background: linear-gradient(90deg, var(--primary) 0%, #0f5bd3 100%);
  color: #fff;
  font-weight: 800;
}

.status-row {
  justify-content: center;
  margin-top: 14px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: #eff4fb;
  color: var(--text);
  font-weight: 700;
}

.modal-success {
  display: none;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  background: #e7f8f1;
  color: var(--success);
  font-weight: 800;
}

.pix-instructions {
  margin-top: 16px;
  padding: 16px;
  border-radius: 18px;
  background: var(--surface-soft);
  text-align: left;
  color: #334155;
}

.pix-instructions ol {
  margin: 0;
  padding-left: 18px;
}

.pix-instructions li + li {
  margin-top: 6px;
}

@media (max-width: 640px) {
  body {
    padding-bottom: 150px;
  }

  .campaign-card {
    padding: 20px 18px;
    border-radius: 22px;
  }

  .campaign-title {
    font-size: 1.8rem;
  }

  .donation-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .donation-button {
    min-height: 58px;
    padding: 12px 10px;
    font-size: 0.95rem;
  }

  .sticky-bar__inner {
    grid-template-columns: 1fr;
  }

  .cta-button--compact {
    width: 100%;
    min-width: 0;
  }

  .pix-text-wrap {
    flex-direction: column;
  }

  .primary-copy {
    min-height: 52px;
  }

  .modal {
    padding: 14px;
    align-items: flex-start;
  }

  .modal-panel {
    width: 100%;
    max-height: calc(100dvh - 28px);
    margin: 0 auto;
    padding: 24px 18px 20px;
  }

  .pix-checkout-card {
    padding: 16px;
  }

  .qrcode-shell,
  .pix-copy-card {
    padding: 14px;
  }

  .qrcode {
    width: min(100%, 260px);
    min-height: 260px;
  }
}
