:root {
  --bg: #f7fbff;
  --ink: #162432;
  --muted: #5d7082;
  --card: #ffffffeb;
  --line: #dae5ef;
  --accent: #0e8f72;
  --accent-2: #f97316;
  --danger-bg: #ffeae6;
  --danger-ink: #9a2d20;
  --shadow: 0 18px 44px rgba(22, 36, 50, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Manrope, sans-serif;
  background:
    radial-gradient(circle at 10% 10%, #e8f9f0 0%, transparent 38%),
    radial-gradient(circle at 92% 18%, #fff4df 0%, transparent 35%), var(--bg);
}

.shell {
  max-width: 1080px;
  margin: 0 auto;
  padding: 1rem 0.9rem 2rem;
  position: relative;
}

.hero h1 {
  margin: 0.2rem 0;
  font-family: Sora, sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
}

.badge {
  margin: 0;
  display: inline-block;
  font-size: 0.83rem;
  font-weight: 700;
  color: #0f6f57;
  background: #ddf7ef;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
}

.stepper {
  margin-top: 0.9rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fbff;
  overflow: hidden;
}

.step {
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 3px solid transparent;
  background: transparent;
  color: #36526a;
  border-radius: 0;
  padding: 0.72rem 0.7rem;
  font-weight: 700;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease;
}

.step:last-child {
  border-right: 0;
}

.step:hover {
  background: #eef5fb;
}

.step.active {
  background: #ffffff;
  color: #0b8165;
  border-bottom-color: var(--accent);
}

.card {
  margin-top: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1rem;
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(4px);
}

.upload-usp {
  border: 1px solid #cde3d7;
  background: linear-gradient(180deg, #f8fffb 0%, #ffffff 100%);
}

.upload-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.68rem;
}

.page {
  display: none;
}
.page.active {
  display: block;
}

.card-head h2 {
  margin: 0;
  font-family: Sora, sans-serif;
}

.card-head p {
  margin-top: 0.25rem;
  color: var(--muted);
}

.section-block {
  border: 1px solid #e2ebf3;
  border-radius: 14px;
  background: #fbfdff;
  padding: 0.8rem;
}

.section-block h3 {
  margin: 0 0 0.55rem;
  font-size: 1.02rem;
  font-family: Sora, sans-serif;
}

.profile-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.profile-card {
  border: 1px solid #e2ebf3;
  border-radius: 12px;
  background: #fff;
  padding: 0.7rem;
  display: grid;
  gap: 0.55rem;
}

.profile-card h4 {
  margin: 0;
  font-family: Sora, sans-serif;
  font-size: 0.98rem;
}

.profile-info {
  border: 1px dashed #d6e3ef;
  border-radius: 10px;
  padding: 0.5rem 0.58rem;
  font-size: 0.86rem;
  color: #49617a;
  min-height: 60px;
  background: #fbfdff;
}

.profile-list {
  border: 1px solid #dce7f1;
  border-radius: 10px;
  background: #fff;
  min-height: 80px;
  max-height: 220px;
  overflow: auto;
  padding: 0.35rem;
  display: grid;
  gap: 0.35rem;
}

.profile-item {
  width: 100%;
  border: 1px solid #e2ebf3;
  border-radius: 8px;
  padding: 0.48rem 0.55rem;
  background: #fff;
  color: #2a445b;
  display: grid;
  gap: 0.4rem;
  cursor: pointer;
}

.profile-item-head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: center;
}

.profile-item-name {
  font-weight: 700;
}

.profile-item small {
  display: block;
  color: #5a7287;
  font-weight: 500;
}

.profile-item:hover {
  background: #f3f9ff;
}

.profile-item.active {
  border-color: #35a586;
  background: #ebfbf4;
}

.profile-item-actions {
  display: flex;
  gap: 0.45rem;
}

.profile-item-actions button {
  width: auto;
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  font-size: 0.82rem;
}

.icon-btn {
  min-width: 34px;
  padding: 0.35rem 0.45rem;
}

.form-grid {
  display: grid;
  gap: 0.68rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid.compact {
  max-width: 760px;
}

.field {
  display: grid;
  gap: 0.32rem;
}

.field > span {
  font-size: 0.84rem;
  font-weight: 700;
  color: #3f5970;
}

.full-width {
  grid-column: span 2;
}

input,
select,
textarea,
button {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 0.62rem 0.7rem;
  font: inherit;
  background: #fff;
}

select:invalid {
  color: #7d92a5;
}

select option {
  color: #1d3348;
}

textarea {
  resize: vertical;
  min-height: 96px;
}

.hidden-file {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}

.file-picker {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  padding: 0.4rem;
}

.file-picker button {
  width: auto;
  white-space: nowrap;
  padding: 0.5rem 0.8rem;
}

.center-actions {
  display: flex;
  justify-content: center;
  gap: 0.65rem;
}

.center-actions button {
  width: auto;
  min-width: 220px;
}

.file-name {
  color: #415a71;
  font-size: 0.92rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.place-wrap {
  position: relative;
}

.place-suggestions {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 26px rgba(22, 36, 50, 0.14);
  max-height: 220px;
  overflow: auto;
  display: none;
}

.place-suggestions.show {
  display: block;
}

.place-option {
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid #eef3f8;
  border-radius: 0;
  padding: 0.56rem 0.68rem;
  background: #fff;
  color: #23384b;
  font-weight: 500;
}

.place-option:last-child {
  border-bottom: 0;
}

.place-option:hover {
  background: #edf6ff;
}

button {
  border: 0;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #0cb184);
  cursor: pointer;
}

button.is-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.86;
}

button.is-loading::after {
  content: "";
  display: inline-block;
  width: 0.9em;
  height: 0.9em;
  margin-left: 0.45rem;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
  vertical-align: text-bottom;
}

button.secondary {
  background: #eaf2f8;
  color: #28465f;
}

button.danger {
  background: var(--danger-bg);
  color: var(--danger-ink);
}

.row {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  flex-wrap: wrap;
}

.card-head.row {
  justify-content: space-between;
}

.card-head.row > .row {
  justify-content: flex-end;
}

.split {
  margin-top: 0.9rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.hint {
  color: var(--muted);
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
}

.date-time-row {
  grid-column: span 2;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.5rem;
}

.date-time-row .mini-field {
  display: grid;
  gap: 0.3rem;
}

.date-time-row .mini-field span {
  font-size: 0.79rem;
  font-weight: 700;
  color: #4e6981;
}

.date-time-row .dob-caption {
  margin: 0;
  grid-column: 1 / -1;
  color: #5f7386;
  font-size: 0.8rem;
}

.actions {
  margin-top: 1rem;
  display: flex;
  justify-content: flex-end;
}

.actions.between {
  justify-content: space-between;
}

.report {
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 0.9rem;
  background: #fff;
}

.report.empty {
  color: var(--muted);
}

.kpi {
  display: inline-block;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  border: 1px solid #d2e8de;
  background: #edf8f2;
  font-weight: 700;
}

.history {
  display: grid;
  gap: 0.55rem;
}

.history-card {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 0.75rem;
}

.bottom-gap {
  margin-top: 1rem;
}

.toast-container {
  position: fixed;
  top: 14px;
  right: 14px;
  bottom: auto;
  left: auto;
  z-index: 60;
  display: grid;
  gap: 0.55rem;
  width: min(360px, calc(100vw - 28px));
}

.toast {
  border-radius: 12px;
  padding: 0.65rem 0.78rem;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 12px 24px rgba(16, 26, 35, 0.24);
  animation: toast-in 0.2s ease-out;
}

.toast.success {
  background: #0f8b63;
}
.toast.error {
  background: #b9352b;
}
.toast.info {
  background: #2d5c87;
}

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

@keyframes toast-in {
  from {
    transform: translateY(10px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.bg-shape {
  position: fixed;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(34px);
}

.bg-shape.a {
  width: 260px;
  height: 260px;
  right: 5%;
  top: -90px;
  background: rgba(14, 143, 114, 0.17);
}

.bg-shape.b {
  width: 300px;
  height: 300px;
  left: -80px;
  bottom: -130px;
  background: rgba(249, 115, 22, 0.14);
}

@media (max-width: 920px) {
  .shell {
    padding: 0.85rem 0.75rem 1.5rem;
  }

  .hero h1 {
    font-size: clamp(1.6rem, 6vw, 2.1rem);
  }

  .card {
    border-radius: 16px;
    padding: 0.85rem;
  }

  .stepper {
    display: flex;
    overflow-x: auto;
    scrollbar-width: thin;
    padding-bottom: 0.2rem;
    border-radius: 12px;
  }

  .step {
    flex: 0 0 150px;
    border-right: 1px solid var(--line);
  }

  .split,
  .form-grid {
    grid-template-columns: 1fr;
  }
  .profile-columns {
    grid-template-columns: 1fr;
  }
  .upload-grid {
    grid-template-columns: 1fr;
  }

  .full-width {
    grid-column: span 1;
  }

  .date-time-row {
    grid-column: span 1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .actions.between {
    gap: 0.6rem;
    flex-direction: column;
  }

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

  .card-head.row > .row {
    width: 100%;
    justify-content: stretch;
  }

  .card-head.row > .row button {
    flex: 1 1 0;
  }
}

@media (max-width: 560px) {
  .shell {
    padding: 0.7rem 0.55rem 1rem;
  }

  .badge {
    font-size: 0.76rem;
  }

  .hero h1 {
    line-height: 1.1;
    margin-top: 0.3rem;
  }

  .hero p {
    margin-bottom: 0.65rem;
  }

  .date-time-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .step {
    flex-basis: 128px;
    padding: 0.5rem 0.6rem;
  }

  .history-card {
    padding: 0.62rem;
  }

  .file-picker {
    flex-direction: column;
    align-items: stretch;
  }

  .file-picker button {
    width: 100%;
  }

  .center-actions {
    flex-direction: column;
  }

  .center-actions button {
    width: 100%;
    min-width: 0;
  }
}
