:root {
  --fp-navy: #123a56;
  --fp-navy-dark: #0b2a3e;
  --fp-gold: #c9a227;
  --fp-gold-soft: #f3e6b8;
  --fp-cream: #f3efe6;
  --fp-card: #ffffff;
  --fp-ink: #1c2a33;
  --fp-muted: #5b6b75;
  --fp-line: #e4ddd0;
  --fp-ok: #157347;
  --fp-ok-bg: #e8f6ee;
  --fp-err: #b42318;
  --fp-err-bg: #fdecea;
  --fp-warn: #9a6700;
  --fp-shadow: 0 18px 50px rgba(18, 58, 86, 0.12);
  --fp-radius: 18px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body.fp-body {
  font-family: "DM Sans", "Segoe UI", sans-serif;
  color: var(--fp-ink);
  background:
    radial-gradient(1200px 420px at 10% -10%, rgba(201, 162, 39, 0.18), transparent 50%),
    radial-gradient(900px 380px at 100% 0%, rgba(18, 58, 86, 0.18), transparent 45%),
    var(--fp-cream);
}

.fp-wrap {
  width: min(1080px, calc(100% - 28px));
  margin: 0 auto;
  padding: 22px 0 40px;
}

.fp-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, var(--fp-navy-dark), var(--fp-navy));
  color: #fff;
  border-radius: var(--fp-radius);
  padding: 18px 20px;
  box-shadow: var(--fp-shadow);
}

.fp-brand img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  background: #fff;
  border-radius: 14px;
  padding: 6px;
}

.fp-brand h1 {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: clamp(1.15rem, 3vw, 1.7rem);
  margin: 0 0 4px;
  letter-spacing: 0.01em;
}

.fp-brand p {
  margin: 0;
  opacity: 0.88;
  font-size: 0.95rem;
}

.fp-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  list-style: none;
  margin: 18px 0;
  padding: 0;
}

.fp-steps li {
  background: #fff;
  border: 1px solid var(--fp-line);
  border-radius: 999px;
  padding: 10px 8px;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--fp-muted);
  position: relative;
}

.fp-steps li span {
  display: inline-flex;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  margin-right: 6px;
  background: var(--fp-line);
  color: var(--fp-navy);
  font-size: 0.75rem;
}

.fp-steps li.is-active,
.fp-steps li.is-done {
  border-color: transparent;
  color: #fff;
  background: var(--fp-navy);
}

.fp-steps li.is-active span,
.fp-steps li.is-done span {
  background: var(--fp-gold);
  color: var(--fp-navy-dark);
}

.fp-card {
  background: var(--fp-card);
  border-radius: var(--fp-radius);
  box-shadow: var(--fp-shadow);
  padding: 22px;
  border: 1px solid rgba(18, 58, 86, 0.06);
}

.fp-grid {
  display: grid;
  grid-template-columns: 1.7fr 0.9fr;
  gap: 18px;
  align-items: start;
}

.fp-note {
  background: #fff8e6;
  border: 1px solid var(--fp-gold-soft);
  color: #5c4708;
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 18px;
  font-size: 0.92rem;
}

.fp-note strong { display: block; margin-bottom: 4px; }
.fp-note ul { margin: 0; padding-left: 18px; }

.fp-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 6px 0 14px;
}

.fp-section-title h2 {
  margin: 0;
  font-size: 1.15rem;
  color: var(--fp-navy);
}

.fp-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 4px;
}

.fp-row.cols-2 { grid-template-columns: 1fr 1fr; }
.fp-row.cols-1 { grid-template-columns: 1fr; }

.fp-field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--fp-navy);
}

.fp-field .opt {
  font-weight: 500;
  color: var(--fp-muted);
}

.fp-field input,
.fp-field select {
  width: 100%;
  min-height: 46px;
  border: 1px solid #d7d0c3;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 1rem;
  background: #fff;
  color: var(--fp-ink);
  transition: border-color .15s, box-shadow .15s;
}

.fp-field input:focus,
.fp-field select:focus {
  outline: none;
  border-color: var(--fp-navy);
  box-shadow: 0 0 0 3px rgba(18, 58, 86, 0.12);
}

.fp-field input.error,
.fp-field select.error {
  border-color: var(--fp-err);
  background: #fff8f7;
}

.invalidFld {
  width: 100%;
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--fp-err);
}

.fp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.fp-btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.98rem;
  transition: transform .12s, box-shadow .12s, background .12s;
}

.fp-btn:active { transform: translateY(1px); }

.fp-btn-primary {
  background: linear-gradient(180deg, #1b5274, var(--fp-navy));
  color: #fff;
  box-shadow: 0 8px 18px rgba(18, 58, 86, 0.25);
}

.fp-btn-gold {
  background: linear-gradient(180deg, #dfbf4a, var(--fp-gold));
  color: var(--fp-navy-dark);
}

.fp-btn-ghost {
  background: #fff;
  color: var(--fp-navy);
  border: 1px solid var(--fp-line);
}

.fp-btn-danger {
  background: #fff;
  color: var(--fp-err);
  border: 1px solid #f2c2bd;
}

.fp-aside {
  position: sticky;
  top: 16px;
}

.fp-summary {
  background: var(--fp-navy);
  color: #fff;
  border-radius: var(--fp-radius);
  padding: 18px;
}

.fp-summary h3 {
  margin: 0 0 10px;
  font-size: 0.95rem;
  font-weight: 600;
  opacity: 0.85;
}

.fp-amount {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 2rem;
  line-height: 1.1;
  margin: 0 0 12px;
}

.fp-summary ul {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.88rem;
}

.fp-summary li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid rgba(255,255,255,0.12);
}

.fp-review-table {
  width: 100%;
  border-collapse: collapse;
}

.fp-review-table th,
.fp-review-table td {
  text-align: left;
  padding: 11px 8px;
  border-bottom: 1px solid var(--fp-line);
  vertical-align: top;
  font-size: 0.95rem;
}

.fp-review-table th {
  width: 38%;
  color: var(--fp-muted);
  font-weight: 600;
}

.fp-status {
  text-align: center;
  padding: 10px 8px 18px;
}

.fp-icon {
  width: 78px;
  height: 78px;
  margin: 0 auto 12px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
}

.fp-icon.ok { background: var(--fp-ok-bg); color: var(--fp-ok); }
.fp-icon.err { background: var(--fp-err-bg); color: var(--fp-err); }
.fp-icon.wait { background: #eaf3f8; color: var(--fp-navy); }

.fp-status h2 { margin: 0 0 6px; color: var(--fp-navy); }
.fp-status p { margin: 0; color: var(--fp-muted); }

.fp-wait .fp-spinner {
  width: 42px;
  height: 42px;
  border: 4px solid #d7e6ef;
  border-top-color: var(--fp-navy);
  border-radius: 50%;
  margin: 0 auto 14px;
  animation: fp-spin .8s linear infinite;
}

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

.fp-footer {
  text-align: center;
  color: var(--fp-muted);
  font-size: 0.82rem;
  margin-top: 22px;
}

.fp-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.fp-badge.ok { background: var(--fp-ok-bg); color: var(--fp-ok); }
.fp-badge.err { background: var(--fp-err-bg); color: var(--fp-err); }

@media (max-width: 860px) {
  .fp-grid {
    display: flex;
    flex-direction: column;
  }
  .fp-aside { order: -1; position: static; }
  .fp-row, .fp-row.cols-2 { grid-template-columns: 1fr; }
  .fp-brand { align-items: flex-start; }
  .fp-steps li { font-size: 0.72rem; padding: 8px 4px; }
  .fp-steps li span { display: none; }
  .fp-card { padding: 16px; }
  .fp-wrap { width: min(1080px, calc(100% - 16px)); }
  .fp-btn { width: 100%; }
  .fp-actions form { width: 100%; }
}

@media print {
  body.fp-body { background: #fff; }
  .fp-actions, .fp-steps, .fp-mobile-bar, .fp-btn { display: none !important; }
  .fp-wrap { width: 100%; }
  .fp-card, .fp-brand { box-shadow: none; }
}
