/* ===========================================
   TAKAYASU Reform Form - Steps, Buttons, Completion
   Minimal / Quiet Elegance
   =========================================== */

/* -- Progress Bar -- */
.progress-bar {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  background: rgba(250, 250, 247, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: var(--space-lg) var(--container-padding) var(--space-md);
  border-bottom: 1px solid var(--color-border-light);
}

.progress-bar__inner {
  max-width: var(--container-max);
  margin: 0 auto;
}

.progress-bar__track {
  width: 100%;
  height: 1px;
  background: var(--color-border);
  overflow: hidden;
  margin-bottom: var(--space-md);
}

.progress-bar__fill {
  height: 100%;
  background: var(--color-brand-primary);
  transition: width 0.6s cubic-bezier(0.25, 0.1, 0.25, 1);
  width: 50%;
}

/* -- Step Dots -- */
.progress-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-md);
}

.progress-dot {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.progress-dot__circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--color-border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: var(--fw-regular);
  color: var(--color-text-muted);
  background: transparent;
  transition: all var(--transition-base);
  flex-shrink: 0;
}

.progress-dot.is-active .progress-dot__circle {
  border-color: var(--color-brand-primary);
  color: var(--color-brand-primary);
  background: transparent;
}

.progress-dot.is-completed .progress-dot__circle {
  border-color: var(--color-brand-primary);
  background: var(--color-brand-primary);
  color: #fff;
}

.progress-dot__line {
  width: 48px;
  height: 1px;
  background: var(--color-border-strong);
  transition: background var(--transition-base);
}

.progress-dot.is-completed .progress-dot__line,
.progress-dot.is-completed + .progress-dot .progress-dot__line {
  background: var(--color-brand-primary);
}

.progress-dot__label {
  display: block;
  font-family: var(--font-display);
  font-size: 0.6875rem;
  color: var(--color-text-muted);
  margin-top: 6px;
  text-align: center;
  white-space: nowrap;
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
}

.progress-dot.is-active .progress-dot__label {
  color: var(--color-brand-primary);
  font-weight: var(--fw-regular);
}

/* -- Step Container -- */
.steps-container {
  position: relative;
  overflow: hidden;
  min-height: 400px;
}

/* -- Step Section -- */
.step {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  opacity: 0;
  transform: translateX(100%);
  transition: transform var(--transition-step),
              opacity var(--transition-step);
  pointer-events: none;
  padding: var(--space-xl) 0 var(--space-4xl);
}

.step.is-active {
  position: relative;
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.step.is-exit-left {
  opacity: 0;
  transform: translateX(-20%);
}

.step.is-enter-right {
  opacity: 0;
  transform: translateX(20%);
}

.step.is-exit-right {
  opacity: 0;
  transform: translateX(20%);
}

.step.is-enter-left {
  opacity: 0;
  transform: translateX(-20%);
}

/* -- Step Card -- */
.step__card {
  background: var(--color-surface);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-card);
  padding: var(--card-padding);
  border: 1px solid var(--color-border-light);
}

.step__title {
  font-family: var(--font-heading);
  font-size: var(--fs-lg);
  font-weight: var(--fw-regular);
  color: var(--color-brand-primary);
  text-align: center;
  margin-bottom: var(--space-sm);
  letter-spacing: var(--ls-wider);
}

.step__subtitle {
  font-family: var(--font-display);
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-align: center;
  margin-bottom: var(--space-2xl);
  letter-spacing: var(--ls-widest);
  text-transform: uppercase;
  font-weight: var(--fw-regular);
}

.step__subtitle::after {
  content: '';
  display: block;
  width: 1px;
  height: 24px;
  background: var(--color-border-strong);
  margin: var(--space-base) auto 0;
}

/* -- Navigation Buttons -- */
.step-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--space-2xl);
  gap: var(--space-md);
}

.step-nav--stack {
  flex-direction: column;
  align-items: stretch;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 16px 32px;
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: var(--fw-regular);
  border: none;
  border-radius: var(--btn-radius);
  cursor: pointer;
  transition: all var(--transition-base);
  min-height: 52px;
  text-decoration: none;
  letter-spacing: var(--ls-wider);
}

.btn--primary {
  background: var(--color-brand-primary);
  color: #fff;
  box-shadow: none;
  width: 100%;
}

.btn--primary:hover {
  background: var(--color-brand-primary-light);
  box-shadow: none;
  transform: none;
  opacity: 1;
}

.btn--primary:active {
  transform: none;
}

.btn--ghost {
  background: transparent;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border-strong);
}

.btn--ghost:hover {
  color: var(--color-brand-primary);
  border-color: var(--color-brand-primary);
  background: transparent;
  opacity: 1;
}

.btn--link {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: var(--fs-xs);
  text-decoration: none;
  cursor: pointer;
  padding: var(--space-sm);
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  transition: color var(--transition-fast);
  border-bottom: 1px solid var(--color-border);
  border-radius: 0;
}

.btn--link:hover {
  color: var(--color-brand-primary);
  border-bottom-color: var(--color-brand-primary);
}

.btn--submit {
  background: var(--color-brand-primary);
  color: #fff;
  box-shadow: none;
  width: 100%;
  padding: 22px 32px;
  font-size: var(--fs-sm);
  font-weight: var(--fw-regular);
  letter-spacing: var(--ls-widest);
  text-transform: uppercase;
  position: relative;
  overflow: hidden;
  flex-direction: column;
  line-height: 1.4;
}

.btn--submit::before {
  display: none;
}

.btn--submit:hover {
  box-shadow: none;
  background: var(--color-brand-primary-light);
  transform: none;
  opacity: 1;
}

.btn--submit__main {
  display: block;
  font-size: var(--fs-sm);
  font-weight: var(--fw-regular);
  letter-spacing: var(--ls-widest);
}

.btn--submit__sub {
  display: block;
  font-family: var(--font-display);
  font-size: 0.6875rem;
  font-weight: var(--fw-regular);
  opacity: 0.7;
  margin-top: 6px;
  letter-spacing: var(--ls-wider);
  text-transform: none;
}

.btn__arrow {
  font-size: 0.9em;
  opacity: 0.7;
  transition: transform var(--transition-fast);
}

.btn--primary:hover .btn__arrow--right {
  transform: translateX(3px);
}

.btn--ghost:hover .btn__arrow--left {
  transform: translateX(-3px);
}

/* -- Loading Overlay -- */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(250, 250, 247, 0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: var(--z-overlay);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}

.loading-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.loading-spinner {
  width: 28px;
  height: 28px;
  border: 1px solid var(--color-border);
  border-top-color: var(--color-brand-primary);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

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

.loading-text {
  margin-top: var(--space-lg);
  font-family: var(--font-display);
  font-size: 0.75rem;
  color: var(--color-text-muted);
  letter-spacing: var(--ls-widest);
  text-transform: uppercase;
}

/* -- Completion Page -- */
.completion {
  text-align: center;
  padding: var(--space-3xl) 0;
  display: none;
}

.completion.is-visible {
  display: block;
  animation: fadeInUp 0.8s ease forwards;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.completion__icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--color-brand-primary);
  color: var(--color-brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-xl);
}

.completion__icon svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.25;
}

.completion__title {
  font-family: var(--font-heading);
  font-size: var(--fs-xl);
  font-weight: var(--fw-regular);
  color: var(--color-brand-primary);
  margin-bottom: var(--space-md);
  letter-spacing: var(--ls-wider);
}

.completion__timeline {
  font-family: var(--font-display);
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2xl);
  letter-spacing: var(--ls-widest);
  text-transform: uppercase;
}

.completion__timeline strong {
  color: var(--color-brand-primary);
  font-weight: var(--fw-regular);
}

.completion__section {
  background: var(--color-surface);
  border-radius: var(--card-radius);
  box-shadow: none;
  border: 1px solid var(--color-border-light);
  padding: var(--space-xl);
  margin-bottom: var(--space-lg);
  text-align: left;
}

.completion__section-title {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: var(--fw-regular);
  color: var(--color-brand-primary);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--color-border);
  letter-spacing: var(--ls-widest);
  text-transform: uppercase;
}

.completion__flow {
  list-style: none;
  padding: 0;
}

.completion__flow li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-lg);
  padding: var(--space-base) 0;
  font-size: var(--fs-sm);
  color: var(--color-text);
  line-height: var(--lh-base);
}

.completion__flow li + li {
  border-top: 1px solid var(--color-border-light);
}

.completion__flow li small {
  color: var(--color-text-muted);
  font-size: var(--fs-xs);
  display: block;
  margin-top: 2px;
  letter-spacing: 0.04em;
}

.completion__flow-num {
  width: 24px;
  height: 24px;
  min-width: 24px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--color-brand-primary);
  color: var(--color-brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: var(--fw-regular);
}

.completion__text {
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
  line-height: var(--lh-loose);
}
