:root {
  --brand: #b4232d;
  --brand-dark: #861a22;
  --brand-soft: #fff1f2;
  --ink: #182230;
  --muted: #667085;
  --line: #e4e7ec;
  --surface: #ffffff;
  --success: #067647;
  --success-soft: #ecfdf3;
  --warning: #b54708;
  --warning-soft: #fffaeb;
}

* { box-sizing: border-box; }

body.event-app {
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 0%, rgba(180, 35, 45, .10), transparent 28rem),
    linear-gradient(180deg, #f8fafc 0%, #f2f4f7 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-container { max-width: 1040px; }
.consult-container { max-width: 760px; }

.app-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
}

.app-brand {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  color: var(--ink);
  font-weight: 750;
  text-decoration: none;
}

.app-brand-mark {
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  border-radius: .7rem;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  box-shadow: 0 8px 18px rgba(180, 35, 45, .22);
}

.surface-card {
  overflow: hidden;
  border: 1px solid rgba(228, 231, 236, .9);
  border-radius: 1.25rem;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 20px 50px rgba(16, 24, 40, .08);
}

.event-hero {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.5rem clamp(1.25rem, 4vw, 2.25rem);
  color: #fff;
  background: linear-gradient(125deg, #69171d 0%, var(--brand) 58%, #d34a52 100%);
}

.event-logo-wrap {
  display: grid;
  flex: 0 0 auto;
  width: 6.25rem;
  height: 6.25rem;
  padding: .65rem;
  place-items: center;
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .16);
}

.event-logo { max-width: 100%; max-height: 100%; object-fit: contain; }
.eyebrow { margin-bottom: .35rem; font-size: .76rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; opacity: .8; }
.event-hero h1 { margin: 0; font-size: clamp(1.35rem, 3vw, 2rem); font-weight: 760; line-height: 1.2; }
.event-hero p { margin: .5rem 0 0; color: rgba(255,255,255,.82); }

.form-content { padding: clamp(1.25rem, 4vw, 2.25rem); }

.form-intro {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}

.form-intro h2 { margin: 0 0 .3rem; font-size: 1.25rem; font-weight: 750; }
.form-intro p { margin: 0; color: var(--muted); }
.required-note { flex: 0 0 auto; color: var(--muted); font-size: .82rem; }

.form-section { padding: 0; border: 0; }
.section-heading { display: flex; align-items: center; gap: .8rem; margin-bottom: 1.1rem; }
.section-number { display: grid; width: 2rem; height: 2rem; place-items: center; border-radius: 50%; color: var(--brand); background: var(--brand-soft); font-weight: 800; }
.section-heading h3 { margin: 0; font-size: 1rem; font-weight: 750; }
.section-heading p { margin: .15rem 0 0; color: var(--muted); font-size: .85rem; }
.section-divider { margin: 1.75rem 0; border-color: var(--line); opacity: 1; }

.form-label { margin-bottom: .45rem; color: #344054; font-size: .88rem; font-weight: 650; }
.form-control, .form-select { min-height: 3rem; border-color: #d0d5dd; border-radius: .7rem; color: var(--ink); background-color: #fff; }
.form-control::placeholder { color: #98a2b3; }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 .23rem rgba(180,35,45,.12); }
.form-text { color: var(--muted); }

.upload-panel { padding: 1rem; border: 1px dashed #f09aa0; border-radius: .85rem; background: var(--brand-soft); }
.upload-panel .form-control { background: #fff; }

.action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.security-note { display: flex; align-items: flex-start; gap: .5rem; max-width: 32rem; color: var(--muted); font-size: .82rem; }
.btn { border-radius: .7rem; font-weight: 650; }
.btn-primary { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand-dark); --bs-btn-hover-border-color: var(--brand-dark); --bs-btn-active-bg: var(--brand-dark); --bs-btn-active-border-color: var(--brand-dark); }
.btn-brand { padding: .78rem 1.35rem; color: #fff; background: var(--brand); border: 1px solid var(--brand); }
.btn-brand:hover { color: #fff; background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-soft { color: var(--brand-dark); background: var(--brand-soft); border: 1px solid #fecdd3; }
.btn-soft:hover { color: #fff; background: var(--brand); border-color: var(--brand); }

.event-grid-card { height: 100%; padding: 1.35rem; border: 1px solid var(--line); border-radius: 1rem; background: #fff; box-shadow: 0 8px 24px rgba(16,24,40,.05); transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.event-grid-card:hover { transform: translateY(-3px); border-color: #f3a5aa; box-shadow: 0 16px 34px rgba(16,24,40,.10); }
.event-grid-logo { display: grid; height: 5rem; margin-bottom: 1rem; place-items: center; }
.event-grid-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }

.consult-header { padding: 2rem clamp(1.25rem, 5vw, 2.5rem) 1.5rem; text-align: center; }
.consult-icon { display: grid; width: 3.25rem; height: 3.25rem; margin: 0 auto 1rem; place-items: center; border-radius: 1rem; color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-dark)); box-shadow: 0 10px 24px rgba(180,35,45,.22); }
.consult-header h1 { margin: 0 0 .45rem; font-size: clamp(1.4rem, 4vw, 1.8rem); font-weight: 780; }
.consult-header p { margin: 0; color: var(--muted); }
.consult-header .badge { max-width: 100%; line-height: 1.35; white-space: normal; }
.consult-body { padding: 0 clamp(1.25rem, 5vw, 2.5rem) 2rem; }
.cpf-control { position: relative; }
.cpf-control .form-control { min-height: 3.4rem; padding-left: 3rem; font-size: 1.05rem; }
.cpf-prefix { position: absolute; z-index: 2; top: 50%; left: 1rem; color: var(--muted); transform: translateY(-50%); pointer-events: none; }

.result-card { margin-top: 1.5rem; padding: 1.25rem; border: 1px solid var(--line); border-radius: 1rem; background: #f9fafb; }
.result-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.2rem; }
.result-name { font-size: 1.08rem; font-weight: 750; }
.status-pill { display: inline-flex; align-items: center; gap: .4rem; padding: .42rem .72rem; border-radius: 999px; font-size: .78rem; font-weight: 750; white-space: nowrap; }
.status-paid { color: var(--success); background: var(--success-soft); }
.status-pending { color: var(--warning); background: var(--warning-soft); }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; }
.detail-item { padding: .85rem; border-radius: .75rem; background: #fff; border: 1px solid #eaecf0; }
.detail-label { margin-bottom: .2rem; color: var(--muted); font-size: .74rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.detail-value { font-size: .92rem; font-weight: 650; overflow-wrap: anywhere; }
.next-step { margin-top: 1rem; padding: 1rem; border-radius: .8rem; }
.next-step-paid { color: #05603a; background: var(--success-soft); border: 1px solid #abefc6; }
.next-step-pending { color: #7a2e0e; background: var(--warning-soft); border: 1px solid #fedf89; }
.help-footer { margin-top: 1.25rem; color: var(--muted); font-size: .82rem; text-align: center; }
.developer-credit { margin-top: .65rem; color: #98a2b3; text-align: center; }
.developer-credit small { font-size: .72rem; }
.developer-credit a { color: #667085; font-weight: 650; text-decoration: none; transition: color .2s ease; }
.developer-credit a:hover { color: var(--brand); text-decoration: underline; }

.success-container { max-width: 820px; }
.success-header { padding: 2.25rem clamp(1.25rem, 5vw, 2.75rem) 1.5rem; text-align: center; }
.success-symbol { display: grid; width: 4rem; height: 4rem; margin: 0 auto 1rem; place-items: center; border-radius: 50%; color: #fff; background: var(--success); box-shadow: 0 12px 28px rgba(6,118,71,.25); }
.success-symbol.existing { color: var(--warning); background: var(--warning-soft); border: 1px solid #fedf89; box-shadow: none; }
.success-header h1 { margin: 0 0 .55rem; font-size: clamp(1.5rem, 4vw, 2rem); font-weight: 780; }
.success-header p { max-width: 34rem; margin: 0 auto; color: var(--muted); }
.success-body { padding: 0 clamp(1.25rem, 5vw, 2.75rem) 2.25rem; }
.payment-status { display: flex; align-items: flex-start; gap: .75rem; margin-bottom: 1.25rem; padding: 1rem; border-radius: .85rem; }
.payment-status strong { display: block; margin-bottom: .12rem; }
.payment-status-paid { color: #05603a; background: var(--success-soft); border: 1px solid #abefc6; }
.payment-status-pending { color: #7a2e0e; background: var(--warning-soft); border: 1px solid #fedf89; }
.success-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.success-actions .btn { display: flex; min-height: 3.25rem; align-items: center; justify-content: center; }
.summary-title { margin: 1.75rem 0 .85rem; font-size: .92rem; font-weight: 750; }
.confirmation-note { margin-top: 1rem; color: var(--muted); font-size: .82rem; text-align: center; }

@media (max-width: 767.98px) {
  .app-topbar { align-items: flex-start; }
  .event-hero { align-items: flex-start; }
  .event-logo-wrap { width: 4.5rem; height: 4.5rem; border-radius: .8rem; }
  .form-intro, .action-bar { flex-direction: column; }
  .action-bar .btn { width: 100%; }
  .detail-grid { grid-template-columns: 1fr; }
  .success-actions { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .app-brand span:last-child { display: none; }
  .event-hero { gap: .85rem; padding: 1.25rem; }
  .event-logo-wrap { width: 3.8rem; height: 3.8rem; }
  .form-content { padding: 1.15rem; }
  .result-top { flex-direction: column; }
}
