:root {
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --blue-1: #214ec6;
  --blue-2: #1a43b1;
  --blue-3: #163995;
  --blue-4: #10286a;
  --line-cyan: rgba(85, 218, 245, 0.45);
  --line-soft: rgba(173, 218, 255, 0.35);
  --ink: #eaf1ff;
  --ink-soft: #c5d5fb;
  --ink-muted: #9fb6e5;
  --panel: rgba(15, 41, 104, 0.72);
  --panel-2: rgba(13, 33, 85, 0.84);
  --card-white: #f8fbff;
  --card-line: #d2e0fa;
  --title: #f6f9ff;
  --cta-orange-1: #f8b116;
  --cta-orange-2: #ef9a08;
  --shadow: 0 24px 54px rgba(4, 17, 49, 0.42);
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: var(--font-ui);
  color: var(--ink);
  background: linear-gradient(145deg, var(--blue-1) 0%, var(--blue-2) 38%, var(--blue-3) 74%, var(--blue-4) 100%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.page-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 10%, rgba(255, 255, 255, 0.11), transparent 40%),
    radial-gradient(circle at 86% 14%, rgba(255, 255, 255, 0.08), transparent 34%),
    radial-gradient(circle at 60% 95%, rgba(255, 255, 255, 0.08), transparent 44%);
}

.shell {
  position: relative;
  z-index: 1;
  max-width: 1460px;
  margin: 0 auto;
  padding: 20px 8px 44px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 0 18px 12px;
  padding: 10px 14px;
  border: 1px solid rgba(173, 218, 255, 0.34);
  background: rgba(9, 30, 82, 0.38);
  border-radius: 14px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.topbar-left {
  min-width: 0;
}

.brand-home {
  display: inline-flex;
  align-items: center;
  gap: 0;
  text-decoration: none;
  min-width: 0;
}

.brand-logo {
  display: block;
  width: auto;
  height: 36px;
  object-fit: contain;
  border-radius: 8px;
  filter: drop-shadow(0 2px 5px rgba(4, 17, 49, 0.28));
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topbar-link {
  display: inline-flex;
  align-items: center;
  border-radius: 10px;
  padding: 8px 11px;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease, color 0.14s ease;
}

.topbar-link-secondary {
  color: #dce8ff;
  border: 1px solid rgba(203, 224, 255, 0.34);
  background: rgba(255, 255, 255, 0.09);
}

.topbar-link-secondary:hover {
  transform: translateY(-1px);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.16);
}

.topbar-link-primary {
  color: #fff;
  border: 1px solid rgba(255, 189, 64, 0.42);
  background: linear-gradient(140deg, var(--cta-orange-1) 0%, var(--cta-orange-2) 100%);
  box-shadow: 0 10px 24px rgba(111, 65, 0, 0.36);
}

.topbar-link-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(111, 65, 0, 0.44);
}

.card {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
  border: 1px solid var(--line-cyan);
  border-radius: 0;
  box-shadow: var(--shadow);
  padding: 30px 26px 88px;
  min-height: 690px;
}

.card::before {
  content: "";
  position: absolute;
  left: 22px;
  right: 22px;
  top: 44px;
  border-top: 1px solid rgba(80, 220, 245, 0.4);
}

.card::after {
  content: "";
  position: absolute;
  left: -2%;
  right: -2%;
  bottom: -1px;
  height: 78px;
  background: #eef1f7;
  clip-path: polygon(0 58%, 25% 34%, 50% 58%, 75% 20%, 100% 44%, 100% 100%, 0 100%);
}

.card-head {
  position: relative;
  z-index: 2;
  max-width: 920px;
  margin: 94px auto 18px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: #b5cbf8;
  font-size: 12px;
  font-weight: 600;
}

h1 {
  margin: 0 0 10px;
  font: 800 clamp(2.2rem, 5vw, 3.45rem)/1.06 var(--font-display);
  letter-spacing: -0.02em;
  color: var(--title);
}

.subtitle {
  margin: 0;
  color: var(--ink-soft);
  font-size: clamp(1.04rem, 1.82vw, 1.3rem);
  line-height: 1.5;
  font-weight: 500;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.hero-visual {
  position: relative;
  z-index: 2;
  max-width: 780px;
  margin: 0 auto 16px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(153, 198, 255, 0.45);
  box-shadow: 0 20px 40px rgba(7, 24, 67, 0.38);
  transition: opacity 0.24s ease, transform 0.24s ease, filter 0.24s ease;
  will-change: opacity, transform;
}

.hero-visual img {
  display: block;
  width: 100%;
  height: auto;
  transform: scale(1);
  transition: transform 0.28s ease;
}

.hero-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(19, 61, 160, 0.1) 0%, rgba(10, 35, 95, 0.25) 100%);
  pointer-events: none;
}

.hero-visual figcaption {
  position: absolute;
  left: 12px;
  bottom: 10px;
  margin: 0;
  padding: 5px 8px;
  border-radius: 8px;
  background: rgba(10, 31, 82, 0.56);
  border: 1px solid rgba(178, 206, 255, 0.32);
  color: #e8f2ff;
  font-size: 11px;
  font-weight: 600;
  z-index: 1;
}

.trust-strip {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 8px auto 18px;
  max-width: 980px;
  transition: opacity 0.24s ease, transform 0.24s ease;
  will-change: opacity, transform;
}

.trust-card {
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: rgba(12, 31, 86, 0.5);
  padding: 8px 13px;
}

.trust-card img {
  display: none;
}

.trust-quote {
  margin: 0;
  color: #def2ff;
  font-size: 12.5px;
  font-weight: 600;
}

.trust-meta {
  display: none;
}

.status-box {
  position: relative;
  z-index: 3;
  display: none;
  margin: 0 auto 12px;
  max-width: 980px;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13.5px;
  line-height: 1.5;
  font-weight: 500;
  border: 1px solid transparent;
}

.status-box.info {
  display: block;
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(167, 208, 255, 0.5);
  color: #e7f2ff;
}

.status-box.success {
  display: block;
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(132, 236, 188, 0.5);
  color: #d8ffe9;
}

.status-box.error {
  display: block;
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(252, 165, 165, 0.55);
  color: #ffe3e3;
}

.context-box {
  position: relative;
  z-index: 3;
  max-width: 980px;
  margin: 0 auto 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.context-item {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(12, 31, 86, 0.48);
  padding: 10px 12px;
}

.context-label {
  display: block;
  color: #9ebae9;
  margin-bottom: 4px;
  font-size: 12px;
  letter-spacing: 0.01em;
}

.context-item strong {
  color: #f2f7ff;
  font-size: 14.5px;
  font-weight: 600;
}

.flow-steps {
  position: relative;
  z-index: 3;
  max-width: 980px;
  margin: 0 auto 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.flow-step {
  border: 1px solid rgba(173, 218, 255, 0.3);
  border-radius: 10px;
  background: rgba(11, 31, 84, 0.45);
  color: #a8bfeb;
  text-align: center;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 8px 10px;
}

.flow-step.is-active {
  border-color: rgba(86, 166, 255, 0.72);
  background: rgba(28, 74, 183, 0.46);
  color: #f0f6ff;
}

.flow-step.is-done {
  border-color: rgba(119, 229, 190, 0.5);
  background: rgba(18, 129, 90, 0.26);
  color: #ddfff2;
}

.selection-summary {
  position: relative;
  z-index: 3;
  max-width: 980px;
  margin: 0 auto 12px;
  border: 1px solid rgba(173, 218, 255, 0.34);
  border-radius: 10px;
  background: rgba(12, 31, 86, 0.5);
  padding: 9px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.selection-label {
  color: #9fb8e8;
  font-size: 12px;
  font-weight: 500;
}

.selection-summary strong {
  color: #f6faff;
  font-size: 13.5px;
  font-weight: 600;
}

.change-selection-btn {
  margin-left: auto;
  border: 1px solid rgba(210, 226, 255, 0.42);
  background: rgba(255, 255, 255, 0.12);
  color: #e6f0ff;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.change-selection-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.flow-loader {
  position: relative;
  z-index: 4;
  max-width: 980px;
  margin: 0 auto 12px;
  border: 1px solid rgba(173, 218, 255, 0.34);
  border-radius: 10px;
  background: rgba(10, 31, 82, 0.58);
  padding: 10px 12px;
  animation: flowLoaderFadeIn 0.18s ease;
}

.flow-loader p {
  margin: 8px 0 0;
  color: #c8dbff;
  font-size: 12.5px;
  font-weight: 600;
}

.flow-loader-bar {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.2);
  position: relative;
}

.flow-loader-bar::after {
  content: "";
  position: absolute;
  top: 0;
  left: -40%;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, #5fd6ff 0%, #78a9ff 100%);
  border-radius: 999px;
  animation: flowLoaderMove 1s ease-in-out infinite;
}

@keyframes flowLoaderMove {
  0% {
    left: -42%;
  }
  100% {
    left: 102%;
  }
}

@keyframes flowLoaderFadeIn {
  0% {
    opacity: 0;
    transform: translateY(-4px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.flow-stage {
  position: relative;
  z-index: 3;
  transition: opacity 0.2s ease, transform 0.2s ease;
  will-change: opacity, transform;
}

.flow-stage.flow-stage-leave {
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
}

.flow-stage.flow-stage-enter {
  animation: flowStageEnter 200ms ease;
}

@keyframes flowStageEnter {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.option-grid {
  max-width: 980px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.option-grid.single-option {
  grid-template-columns: 1fr;
  max-width: 680px;
}

.option {
  text-align: left;
  border: 1px solid rgba(174, 209, 255, 0.36);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  padding: 14px;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}

.option:hover {
  transform: translateY(-1px);
  border-color: rgba(61, 112, 212, 0.5);
  box-shadow: 0 12px 28px rgba(5, 20, 53, 0.22);
}

.option.active {
  border-color: rgba(34, 91, 204, 0.7);
  box-shadow: 0 0 0 2px rgba(34, 91, 204, 0.18);
  background: #f4f8ff;
}

.option-title {
  display: block;
  color: #16386f;
  font: 700 16px/1.34 var(--font-ui);
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}

.option-desc {
  display: block;
  color: #5073a7;
  font-size: 13.5px;
  line-height: 1.5;
  font-weight: 500;
}

.option-danger {
  border-color: rgba(245, 172, 172, 0.7);
  background: #fff6f5;
}

.option-danger .option-title {
  color: #8a2424;
}

.option-danger .option-desc {
  color: #a34f4f;
}

.option.flow-hidden {
  display: none;
}

.detail-panels {
  max-width: 980px;
  margin: 14px auto 0;
}

.detail-panel[hidden] {
  display: none !important;
}

.detail-panel {
  border: 1px solid var(--card-line);
  border-radius: 12px;
  background: var(--card-white);
  color: #1d355f;
  padding: 14px;
}

.detail-panel h3 {
  margin: 0 0 6px;
  color: #143263;
  font: 700 18px/1.28 var(--font-display);
  letter-spacing: -0.01em;
}

.panel-sub {
  margin: 0 0 10px;
  color: #4f678e;
  font-size: 13.5px;
  line-height: 1.5;
}

.panel-sub.warning {
  background: #fff2f2;
  border: 1px solid #f4c7c7;
  border-radius: 10px;
  padding: 10px;
  color: #812020;
}

.choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.choice-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border: 1px solid #d4e1f7;
  border-radius: 10px;
  background: #ffffff;
  padding: 10px;
  color: #203a67;
  font-size: 13.5px;
  line-height: 1.45;
  font-weight: 500;
  cursor: pointer;
}

.choice-item input {
  margin-top: 2px;
  accent-color: #2354c9;
}

.inline-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.inline-fields label,
.note-wrap label {
  display: block;
  margin-bottom: 6px;
  color: #d6e4ff;
  font-size: 12.5px;
  letter-spacing: 0.01em;
  font-weight: 600;
}

select,
input[type="date"],
textarea {
  width: 100%;
  border: 1px solid #bad0f4;
  border-radius: 10px;
  padding: 11px 12px;
  font: 500 14px/1.45 var(--font-ui);
  color: #18325e;
  background: #ffffff;
}

select:focus,
input[type="date"]:focus,
textarea:focus {
  outline: none;
  border-color: #86ace8;
  box-shadow: 0 0 0 3px rgba(134, 172, 232, 0.22);
}

.note-wrap {
  max-width: 980px;
  margin: 14px auto 0;
}

textarea::placeholder {
  color: #5f7ea9;
}

.card-actions {
  max-width: 980px;
  margin: 18px auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.btn-primary {
  border: 0;
  border-radius: 10px;
  padding: 12px 16px;
  font: 700 14px/1 var(--font-ui);
  letter-spacing: 0.01em;
  color: #fff;
  background: linear-gradient(140deg, var(--cta-orange-1) 0%, var(--cta-orange-2) 100%);
  box-shadow: 0 11px 24px rgba(111, 65, 0, 0.38);
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease, opacity 0.14s ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(111, 65, 0, 0.46);
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.hint {
  margin: 0;
  color: #b9cdf7;
  font-size: 12.8px;
  line-height: 1.5;
  font-weight: 500;
}

.stage-actions {
  max-width: 980px;
  margin: 12px auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.stage-actions-final {
  justify-content: flex-start;
}

body[data-flow-stage="details"] .detail-panels,
body[data-flow-stage="details"] .stage-actions,
body[data-flow-stage="finalize"] .note-wrap,
body[data-flow-stage="finalize"] .card-actions,
body[data-flow-stage="finalize"] .stage-actions {
  max-width: 760px;
}

.btn-ghost {
  border: 1px solid rgba(197, 219, 255, 0.36);
  background: rgba(255, 255, 255, 0.12);
  color: #deebff;
  border-radius: 10px;
  padding: 10px 14px;
  font: 600 13.2px/1 var(--font-ui);
  letter-spacing: 0.01em;
  cursor: pointer;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.2);
}

.page-footer {
  margin-top: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  color: #b7caf4;
  font-size: 12.5px;
}

.page-footer a {
  color: #d5e4ff;
  text-decoration: none;
  border-bottom: 1px solid rgba(213, 228, 255, 0.34);
}

.page-footer a:hover {
  color: #ffffff;
  border-bottom-color: rgba(255, 255, 255, 0.7);
}

@media (max-width: 1120px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar-right {
    gap: 12px;
    justify-content: flex-start;
  }

  h1 {
    font-size: 42px;
  }

  .subtitle {
    font-size: 17px;
  }
}

@media (max-width: 760px) {
  .shell {
    padding: 14px 8px 30px;
  }

  .topbar {
    margin: 0 8px 10px;
    padding: 10px;
  }

  .topbar-right {
    width: 100%;
  }

  .topbar-link {
    flex: 1 1 auto;
    justify-content: center;
  }

  .topbar-link-secondary {
    display: none;
  }

  .card {
    padding: 18px 12px 76px;
    min-height: 0;
  }

  .card::before {
    left: 12px;
    right: 12px;
    top: 28px;
  }

  .card-head {
    margin-top: 64px;
  }

  h1 {
    font-size: 31px;
  }

  .subtitle {
    font-size: 15px;
  }

  .hero-visual {
    border-radius: 12px;
    margin-bottom: 14px;
  }

  .hero-visual figcaption {
    left: 8px;
    right: 8px;
    bottom: 8px;
    text-align: center;
  }

  .context-box,
  .flow-steps,
  .option-grid,
  .choice-grid,
  .inline-fields {
    grid-template-columns: 1fr;
  }

  .selection-summary {
    align-items: flex-start;
    gap: 8px;
  }

  .change-selection-btn {
    margin-left: 0;
  }

  .card-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .stage-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-ghost,
  #detailsNextBtn {
    width: 100%;
    justify-content: center;
  }
}
