/* =========================================================
   Base & reset
   ========================================================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue',
    Arial, 'Noto Sans', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #1a1f2e;
  background: #f7f9fb;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img {
  max-width: 100%;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
}

/* Ensure [hidden] always hides, even on flex/inline-flex elements */
[hidden] {
  display: none !important;
}

/* =========================================================
   Header
   ========================================================= */
.header {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: saturate(180%) blur(6px);
  -webkit-backdrop-filter: saturate(180%) blur(6px);
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 20;
}

.header__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.header__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.header__logo {
  height: 36px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}

.header__title {
  font-size: 16px;
  font-weight: 600;
  color: #1a1f2e;
  line-height: 1.2;
}

@media (min-width: 640px) {
  .header__inner {
    padding: 14px 24px;
  }
  .header__brand { gap: 12px; }
  .header__logo { height: 44px; }
  .header__title { font-size: 18px; }
}

/* Language dropdown */
.lang {
  position: relative;
}

.lang__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: #1a1f2e;
  transition: background-color 0.2s;
}

.lang__btn:hover { background: #f7f9fb; }

@media (min-width: 640px) {
  .lang__btn { padding: 8px 16px; }
}

.lang__chevron {
  transition: transform 0.2s;
}

.lang__chevron.is-open {
  transform: rotate(180deg);
}

.lang__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 128px;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  z-index: 21;
}

.lang__menu-item {
  display: block;
  width: 100%;
  padding: 10px 16px;
  background: transparent;
  border: 0;
  text-align: left;
  font-size: 14px;
  font-weight: 500;
  color: #1a1f2e;
}

.lang__menu-item:hover { background: #f7f9fb; }

/* =========================================================
   Main layout
   ========================================================= */
.main {
  flex: 1;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px;
}

@media (min-width: 640px) {
  .container { padding: 40px 24px; }
}
@media (min-width: 1024px) {
  .container { padding: 56px 24px; }
}

.online-badge-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}
@media (min-width: 1024px) {
  .online-badge-wrap { justify-content: flex-start; }
}

.online-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: #1a1f2e;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.online-count {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.online-dot {
  position: relative;
  display: inline-flex;
  width: 10px;
  height: 10px;
}

.online-dot__ping {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #22c55e;
  opacity: 0.75;
  animation: pingAnim 1.4s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.online-dot__core {
  position: relative;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
}

@keyframes pingAnim {
  75%, 100% {
    transform: scale(2);
    opacity: 0;
  }
}

@media (min-width: 640px) {
  .online-badge { font-size: 14px; }
}

/* Grid */
.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 1024px) {
  .layout {
    grid-template-columns: 1fr 1fr;
    gap: 48px;
  }
}

.layout__left {
  display: flex;
  flex-direction: column;
}

.form-wrap {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}

@media (min-width: 1024px) {
  .form-wrap { max-width: none; margin: 0; }
}

.hero-image {
  display: none;
}

@media (min-width: 1024px) {
  .hero-image {
    display: block;
    position: absolute;
    inset: 0;
    margin: auto;
    max-width: 480px;
    width: 100%;
    height: auto;
    object-fit: contain;
    opacity: 0.6;
    pointer-events: none;
    z-index: 0;
  }
}

.card {
  position: relative;
  z-index: 1;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 24px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

@media (min-width: 640px) {
  .card { padding: 28px; }
}
@media (min-width: 1024px) {
  .card { padding: 32px; }
}

/* =========================================================
   Step
   ========================================================= */
.step {
  animation: fadeInUp 0.4s ease-out;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.step__header {
  margin-bottom: 20px;
}
@media (min-width: 640px) {
  .step__header { margin-bottom: 24px; }
}

.step__title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #1a1f2e;
  line-height: 1.25;
}
@media (min-width: 640px) {
  .step__title { font-size: 24px; }
}

.step__desc {
  margin: 8px 0 0;
  font-size: 14px;
  color: #6b7280;
  line-height: 1.55;
}
@media (min-width: 640px) {
  .step__desc { font-size: 15px; }
}

.step__meta {
  margin: 8px 0 0;
  font-size: 12px;
  color: #6b7280;
}
@media (min-width: 640px) {
  .step__meta { font-size: 13px; }
}

.step__desc strong,
.step__meta strong {
  color: #1a1f2e;
  font-weight: 500;
}

/* back button */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  padding: 0;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 500;
  color: #6b7280;
  transition: color 0.2s;
}
.back-btn:hover { color: #1a1f2e; }

/* =========================================================
   Forms
   ========================================================= */
.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field__label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #1a1f2e;
}

.field__hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: #9ca3af;
}
@media (min-width: 640px) {
  .field__hint { font-size: 13px; }
}

.field__error {
  margin: 8px 0 0;
  font-size: 12px;
  color: #ef4444;
}

.input-wrap {
  display: flex;
  align-items: center;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-wrap:focus-within {
  border-color: #00a97f;
  box-shadow: 0 0 0 3px rgba(0, 169, 127, 0.15);
}

.input-wrap.is-error {
  border-color: #f87171;
  box-shadow: 0 0 0 3px rgba(254, 202, 202, 0.5);
}

.input-prefix {
  user-select: none;
  padding: 0 8px 0 16px;
  font-size: 16px;
  font-weight: 500;
  color: #1a1f2e;
}
@media (min-width: 640px) {
  .input-prefix { font-size: 15px; }
}

.input {
  width: 100%;
  padding: 14px 16px;
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 16px;
  color: #1a1f2e;
  font-family: inherit;
}
@media (min-width: 640px) {
  .input { font-size: 15px; }
}
.input::placeholder { color: #9ca3af; }
.input:disabled { opacity: 0.6; }

.input-wrap--prefix .input {
  padding-left: 0;
}

.input--wide {
  letter-spacing: 0.12em;
}
.input--wide::placeholder { letter-spacing: normal; }

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 20px;
  border: 0;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 600;
  transition: background-color 0.2s, opacity 0.2s;
}
@media (min-width: 640px) {
  .btn { font-size: 15px; }
}

.btn--primary {
  background: #1a1f2e;
  color: #ffffff;
}
.btn--primary:hover:not(:disabled) { background: #2c3344; }
.btn--primary:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

.btn--mt { margin-top: 20px; }

.btn__loader {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.form__note {
  margin: 0;
  text-align: center;
  font-size: 12px;
  color: #6b7280;
  line-height: 1.5;
}
@media (min-width: 640px) {
  .form__note { font-size: 13px; }
}

/* resend */
.resend-wrap { text-align: center; }
.resend-timer,
.resend-btn {
  margin: 0;
  font-size: 12px;
  color: #6b7280;
  background: none;
  border: 0;
  padding: 0;
}
@media (min-width: 640px) {
  .resend-timer,
  .resend-btn { font-size: 13px; }
}
.resend-btn {
  color: #00a97f;
  font-weight: 500;
}
.resend-btn:hover { text-decoration: underline; }

/* =========================================================
   Processing
   ========================================================= */
.timer-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  margin-bottom: 20px;
}
@media (min-width: 640px) {
  .timer-card { padding: 20px; }
}

.timer-card__left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.timer-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e8f7f1;
  color: #00a97f;
}
@media (min-width: 640px) {
  .timer-card__icon { width: 44px; height: 44px; }
}

.timer-card__label {
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  color: #6b7280;
}
@media (min-width: 640px) {
  .timer-card__label { font-size: 13px; }
}

.timer-card__value {
  margin: 2px 0 0;
  font-size: 18px;
  font-weight: 600;
  color: #1a1f2e;
}
@media (min-width: 640px) {
  .timer-card__value { font-size: 20px; }
}

.timer-card__value--accent { color: #00a97f; }

.timer-card__right { text-align: right; }

.progress-bar {
  width: 100%;
  height: 10px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 20px;
}
@media (min-width: 640px) {
  .progress-bar { height: 12px; }
}

.progress-bar__fill {
  height: 100%;
  background: #00a97f;
  border-radius: 999px;
  transition: width 1s linear;
}

/* stages */
.stages {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stage-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  transition: background-color 0.3s, border-color 0.3s;
}
@media (min-width: 640px) {
  .stage-item { padding: 14px; }
}

.stage-item--active {
  background: #e8f7f1;
  border-color: #00a97f;
}

.stage-item--pending {
  background: rgba(255, 255, 255, 0.6);
}

.stage-item__mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 600;
  background: #f3f4f6;
  color: #9ca3af;
}
@media (min-width: 640px) {
  .stage-item__mark { width: 32px; height: 32px; }
}

.stage-item--done .stage-item__mark {
  background: #00a97f;
  color: #ffffff;
}

.stage-item--active .stage-item__mark {
  background: #ffffff;
  color: #00a97f;
}

.stage-item__label {
  flex: 1;
  font-size: 14px;
  line-height: 1.35;
  color: #9ca3af;
  margin: 0;
}

.stage-item--active .stage-item__label,
.stage-item--done .stage-item__label {
  color: #1a1f2e;
  font-weight: 500;
}

.warn-box {
  margin-top: 20px;
  padding: 16px;
  background: #fff4e0;
  border-radius: 16px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  color: #1a1f2e;
}
@media (min-width: 640px) {
  .warn-box { font-size: 15px; }
}

/* =========================================================
   Info cards (right column)
   ========================================================= */
.layout__right {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
@media (min-width: 1024px) {
  .layout__right { padding-top: 8px; gap: 20px; }
}

.info-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
  color: #9ca3af;
}
.info-card:hover {
  border-color: #d1d5db;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
@media (min-width: 640px) {
  .info-card { padding: 20px; gap: 20px; }
}

.info-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 50%;
}
@media (min-width: 640px) {
  .info-card__icon { width: 48px; height: 48px; }
}

.info-card__body {
  flex: 1;
  min-width: 0;
}

.info-card__title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  color: #1a1f2e;
}
@media (min-width: 640px) {
  .info-card__title { font-size: 16px; }
}

.info-card__desc {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.55;
  color: #6b7280;
}
@media (min-width: 640px) {
  .info-card__desc { font-size: 13px; }
}

.info-card__arrow {
  margin-top: 4px;
  flex-shrink: 0;
  transition: color 0.2s;
}
.info-card:hover .info-card__arrow { color: #1a1f2e; }

/* =========================================================
   Footer
   ========================================================= */
.footer {
  border-top: 1px solid #e5e7eb;
  background: #ffffff;
  padding: 16px;
  text-align: center;
  font-size: 12px;
  color: #6b7280;
}
@media (min-width: 640px) {
  .footer { font-size: 13px; }
}
.footer p { margin: 0; }