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

:root {
  --bg-page: #f6f8fa;
  --card-bg: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --primary-blue: #2563eb;
  --primary-blue-hover: #1d4ed8;
  --primary-blue-light: #eff6ff;
  --success-green: #10b981;
  --success-green-light: #ecfdf5;
  --border-color: #f1f5f9;
  --radius-card: 24px;
}

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  padding: 20px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Outer Wrapper for responsive alignment */
.container {
  width: 100%;
  max-width: 390px;
  display: flex;
  justify-content: center;
}

/* Main White Card */
.card {
  position: relative;
  width: 100%;
  background: var(--card-bg);
  border-radius: var(--radius-card);
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.03),
    0 12px 28px -4px rgba(0, 0, 0, 0.06),
    0 0 0 1px rgba(0, 0, 0, 0.04);
  padding: 40px 26px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  overflow: hidden;
  transition: all 0.3s ease;
}

/* Loading Stage Container */
.loading-stage {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.loading-stage.hide {
  opacity: 0;
  transform: scale(0.96);
  pointer-events: none;
  position: absolute;
  visibility: hidden;
}

/* Circular Spinner matching user reference image */
.spinner-wrap {
  position: relative;
  width: 78px;
  height: 78px;
  margin-bottom: 24px;
}

.spinner-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.spinner-bg {
  fill: none;
  stroke: #e2e8f0;
  stroke-width: 6;
}

.spinner-bar {
  fill: none;
  stroke: var(--primary-blue);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 201;
  /* 2 * PI * 32 */
  stroke-dashoffset: 201;
  transition: stroke-dashoffset 0.08s linear;
}

/* Percentage in spinner center */
.spinner-percent {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--primary-blue);
  letter-spacing: -0.02em;
}

/* Main Title */
.card-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

/* Subtitle */
.card-subtitle {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.55;
  max-width: 290px;
  margin-bottom: 24px;
}

/* Step Checklist Box */
.steps-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 4px;
}

.step-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-light);
  transition: all 0.3s ease;
}

.step-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.step-icon-wrap {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.step-icon-wrap svg {
  width: 12px;
  height: 12px;
  display: none;
}

/* Step States */
.step-item.active {
  color: var(--text-main);
  background: var(--primary-blue-light);
  border-color: #bfdbfe;
}

.step-item.active .step-icon-wrap {
  background: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
  animation: pulse 1.4s infinite;
}

.step-item.active .step-icon-wrap::after {
  content: '';
  width: 7px;
  height: 7px;
  background: #ffffff;
  border-radius: 50%;
}

.step-item.done {
  color: #065f46;
  background: var(--success-green-light);
  border-color: #a7f3d0;
}

.step-item.done .step-icon-wrap {
  background: var(--success-green);
}

.step-item.done .step-icon-wrap svg {
  display: block;
  stroke: #ffffff;
}

.step-status-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  background: transparent;
  color: var(--text-light);
}

.step-item.active .step-status-tag {
  color: var(--primary-blue);
  background: #dbeafe;
}

.step-item.done .step-status-tag {
  color: #047857;
  background: #d1fae5;
}

/* Result Stage (After 1s) */
.result-stage {
  width: 100%;
  display: none;
  flex-direction: column;
  align-items: center;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.result-stage.show {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

/* Success Icon */
.success-icon-wrap {
  position: relative;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 10px 25px -4px rgba(16, 185, 129, 0.4),
    0 0 0 6px rgba(16, 185, 129, 0.12);
  margin-bottom: 20px;
  animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.success-icon-wrap svg {
  width: 38px;
  height: 38px;
  stroke: #ffffff;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.badge-success {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #047857;
  background: #d1fae5;
  padding: 4px 12px;
  border-radius: 100px;
  margin-bottom: 12px;
}

.result-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.result-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.55;
  max-width: 290px;
  margin-bottom: 28px;
}

/* CTA Button: ĐĂNG KÝ NGAY */
.btn-submit {
  width: 100%;
  padding: 16px 24px;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  border: none;
  border-radius: 14px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow:
    0 10px 20px -3px rgba(37, 99, 235, 0.4),
    0 4px 6px -2px rgba(37, 99, 235, 0.2);
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow:
    0 14px 26px -3px rgba(37, 99, 235, 0.5),
    0 6px 10px -2px rgba(37, 99, 235, 0.25);
}

.btn-submit:active {
  transform: translateY(0);
  box-shadow:
    0 6px 14px -2px rgba(37, 99, 235, 0.35);
}

.btn-submit svg {
  width: 18px;
  height: 18px;
  transition: transform 0.2s ease;
}

.btn-submit:hover svg {
  transform: translateX(3px);
}

/* Keyframe Animations */
@keyframes pulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.75;
    transform: scale(1.06);
  }
}

@keyframes popIn {
  0% {
    opacity: 0;
    transform: scale(0.6);
  }

  70% {
    transform: scale(1.08);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Mobile fine-tuning */
@media (max-width: 380px) {
  .card {
    padding: 32px 18px 28px;
  }

  .card-title {
    font-size: 18px;
  }

  .result-title {
    font-size: 20px;
  }
}
