/* ==========================================================
   Sign up & Payment flow (Step 1 → 1.2 → 2 → 3)
   Uses tokens / .btn / .logo from styles.css
   ========================================================== */

[hidden] { display: none !important; }

.flow-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg-soft);
}

/* ---------- Minimal header ---------- */
.flow-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 106px;
}

.steps-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
}
.steps-indicator__step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
  line-height: 20px;
  letter-spacing: .42px;
  color: #94989e;
  white-space: nowrap;
}
.steps-indicator__dot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #e5e5e5;
  color: var(--muted);
  font-weight: 800;
  font-size: 13px;
  line-height: 1;
}
.steps-indicator__step.is-active,
.steps-indicator__step.is-done { color: var(--text); }
.steps-indicator__step.is-active .steps-indicator__dot,
.steps-indicator__step.is-done .steps-indicator__dot {
  background: linear-gradient(90deg, #1a78fe, #05c467);
  color: #fff;
}
.steps-indicator__line {
  width: 28px;
  height: 2px;
  background: #e5e5e5;
}
.steps-indicator__line.is-done { background: var(--blue); }

/* ---------- Body & card ---------- */
.flow-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 56px var(--gutter);
}
.flow-body > .steps-indicator { display: none; }

.flow-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 22px;
  width: 560px;
  max-width: 100%;
  padding: 44px;
  border-radius: 32px;
  background: var(--bg);
  box-shadow: 0 12px 20px rgba(0, 0, 0, .06);
}
.flow-card--tight { gap: 18px; }
.flow-card--center .flow-card__title,
.flow-card--center .flow-card__text { text-align: center; }

.flow-card__art {
  display: flex;
  justify-content: center;
}
.flow-card__art img { height: 160px; width: auto; }

.flow-card__title {
  font-weight: 700;
  font-size: 32px;
  line-height: 42px;
  color: var(--text);
}
.flow-card__text {
  font-size: 16px;
  line-height: 24px;
  letter-spacing: .48px;
  color: #53565b;
}

/* ---------- Fields ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.field__label {
  font-weight: 700;
  font-size: 14px;
  line-height: 20px;
  letter-spacing: .42px;
  color: var(--text);
}
.field__control {
  position: relative;
  display: flex;
  align-items: center;
}
.field__input {
  width: 100%;
  height: 56px;
  padding: 0 22px;
  border: 1px solid #e5e5e5;
  border-radius: 9999px;
  background: var(--bg);
  font: inherit;
  font-size: 16px;
  letter-spacing: .48px;
  color: var(--text);
  transition: border-color .15s ease;
}
.field__input::placeholder { color: #94989e; }
.field__input--secret { -webkit-text-security: disc; }  /* CVV shown as dots, as in the design */
.field__input:focus { outline: none; border-color: var(--blue); }
.field__input--with-icon { padding-right: 64px; }
.field__icon-btn {
  position: absolute;
  right: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.field__icon-btn img { width: 29px; height: auto; }
.field__hint {
  font-size: 14px;
  line-height: 20px;
  letter-spacing: .42px;
  color: var(--muted);
}
.field__error {
  display: none;
  font-weight: 700;
  font-size: 14px;
  line-height: 20px;
  color: var(--error);
}
.field.is-invalid .field__input { border: 2px solid var(--error); padding-left: 21px; }
.field.is-invalid .field__error { display: block; }
.field.is-invalid .field__hint--rule { color: var(--error); font-weight: 700; }

.field-row {
  display: flex;
  gap: 14px;
}
.field-row > .field { flex: 1; min-width: 0; }

/* ---------- Checkboxes ---------- */
.consents {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  line-height: 20px;
  letter-spacing: .42px;
  color: #53565b;
  cursor: pointer;
}
.check input {
  appearance: none;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin: 0;
  border: 1.5px solid #c9ccd7;
  border-radius: 6px;
  background: var(--bg);
  cursor: pointer;
}
.check input:checked {
  border: 0;
  background: url("assets/checkbox-on.svg") center / 20px no-repeat;
}
.check a { color: var(--blue); font-weight: 700; }
.check.is-invalid input { border-color: var(--error); }
.consents__error {
  display: none;
  font-weight: 700;
  font-size: 14px;
  line-height: 20px;
  color: var(--error);
}
.consents.is-invalid .consents__error { display: block; }

/* ---------- Primary button (flow size) ---------- */
.btn--flow {
  width: 100%;
  height: 64px;
  border: 0;
  font: inherit;
  font-weight: 700;
  font-size: 22px;
  line-height: 28px;
  background: linear-gradient(16.34deg, #1a78fe 6.33%, #05c467 96.07%);
  cursor: pointer;
}
.btn--flow:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.btn--flow.is-loading:disabled { opacity: .85; cursor: progress; }
.btn--flow .spinner {
  width: 20px;
  height: 20px;
  margin-right: 10px;
  border: 3px solid rgba(255, 255, 255, .4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Verify code ---------- */
.code {
  display: flex;
  justify-content: center;
  gap: 10px;
}
.code__cell {
  width: 64px;
  height: 72px;
  border: 1px solid #e5e5e5;
  border-radius: 16px;
  background: var(--bg);
  font: inherit;
  font-weight: 800;
  font-size: 28px;
  text-align: center;
  color: var(--text);
  caret-color: var(--blue);
}
.code__cell:focus { outline: none; border: 2px solid var(--blue); }
.code.is-invalid .code__cell { border: 2px solid var(--error); background: #fff5f4; }
.code__error {
  display: none;
  font-weight: 700;
  font-size: 14px;
  line-height: 20px;
  color: var(--error);
  text-align: center;
}
.code.is-locked .code__cell { background: #f4f5f7; color: #94989e; }
.code.is-invalid + .code__error,
.code.is-locked + .code__error { display: block; }

.notice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #eef9f1;
  font-weight: 700;
  font-size: 14px;
  line-height: 20px;
  color: #2e9e46;
  text-align: center;
}
.notice img { width: 20px; height: 20px; flex-shrink: 0; }

.flow-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  line-height: 20px;
  letter-spacing: .42px;
  color: var(--muted);
}
.flow-links button,
.flow-links a {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 700;
  color: var(--blue);
  cursor: pointer;
}
.flow-links button:disabled { color: #94989e; cursor: default; }

/* ---------- Payment ---------- */
.summary {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
  border-radius: 20px;
  background: #fafafa;
}
.summary__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.summary__row--top { align-items: flex-start; }
.summary__label {
  font-size: 14px;
  line-height: 20px;
  letter-spacing: .42px;
  color: #53565b;
  white-space: nowrap;
}
.summary__label--strong {
  font-weight: 700;
  font-size: 16px;
  line-height: 24px;
  color: var(--text);
  letter-spacing: 0;
}
.summary__value {
  font-weight: 700;
  font-size: 16px;
  line-height: 24px;
  color: var(--text);
  text-align: right;
}
.summary__value--today { font-size: 24px; line-height: 31px; color: #5edb67; }
.summary__value--x { font-weight: 800; }
.summary__note {
  font-size: 14px;
  line-height: 20px;
  letter-spacing: .42px;
  color: var(--muted);
}

.methods {
  display: flex;
  gap: 10px;
}
.method {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid #e5e5e5;
  border-radius: 14px;
  background: var(--bg);
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  line-height: 20px;
  letter-spacing: .42px;
  color: var(--text);
  white-space: nowrap;
  cursor: pointer;
}
.method.is-selected {
  padding: 11px 13px;
  border: 2px solid var(--blue);
  background: #eef5ff;
  color: var(--blue);
}

.wallet-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 64px;
  border: 0;
  border-radius: 9999px;
  font: inherit;
  font-weight: 700;
  font-size: 18px;
  cursor: pointer;
}
.wallet-btn--dark { background: #000; color: #fff; }
.wallet-btn--paypal { background: #ffc439; color: #003087; }
.wallet-btn.is-visible { display: flex; }
/* Wallet marks as in the design: " Pay", "G Pay", PayPal wordmark */
.wallet-btn--apple { gap: 7px; font-family: -apple-system, BlinkMacSystemFont, "Inter", "Helvetica Neue", Arial, sans-serif; font-weight: 600; font-size: 20px; }
.wallet-btn--apple .wallet-btn__mark { gap: 2px; font-size: 23px; }
.wallet-btn--google { gap: 8px; font-family: "Roboto", Arial, sans-serif; font-weight: 500; font-size: 18px; }
.wallet-btn--google .wallet-btn__mark { gap: 4px; font-size: 21.6px; }
.wallet-btn__mark { display: inline-flex; align-items: center; }
.wallet-btn__paypal { font-family: "Roboto", Arial, sans-serif; font-weight: 900; font-style: italic; font-size: 26px; }
.wallet-btn__paypal span:first-child { color: #003087; }
.wallet-btn__paypal span:last-child { color: #009cde; }

.flow-note {
  font-size: 14px;
  line-height: 20px;
  letter-spacing: .42px;
  color: var(--muted);
  text-align: center;
}

.alert {
  display: none;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid #f6cfcb;
  border-radius: 18px;
  background: #fff5f4;
}
.alert.is-visible { display: flex; }
.alert img { height: 72px; width: auto; flex-shrink: 0; }
.alert__title { font-weight: 700; font-size: 16px; line-height: 22px; color: var(--error); }
.alert__text { font-size: 14px; line-height: 20px; color: #53565b; }

/* ---------- Success ---------- */
.flow-card__subtitle {
  font-weight: 700;
  font-size: 20px;
  line-height: 28px;
  color: var(--text);
}
.how-steps {
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.how-step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.how-step__num {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: linear-gradient(90deg, #1a78fe, #05c467);
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  line-height: 1;
}
.how-step__title {
  font-weight: 700;
  font-size: 16px;
  line-height: 24px;
  color: var(--text);
}
.how-step__text {
  font-size: 14px;
  line-height: 20px;
  color: #53565b;
}
.flow-card__art--left { justify-content: flex-start; }
.flow-card__art--left img { height: 170px; }

/* ---------- Error pages (offline, 404) ---------- */
.flow-card__art--tall img { height: 260px; }
.btn--flow.is-shaking { animation: shake .4s ease; }
@keyframes shake {
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

/* ==========================================================
   Mobile (design: 390px)
   ========================================================== */
@media (max-width: 768px) {
  .flow-header .logo { font-size: .62px; }
  .flow-header .steps-indicator { display: none; }
  .flow-body { padding: 16px var(--gutter) 40px; }
  .flow-body > .steps-indicator { display: flex; }

  .flow-card { padding: 28px 20px; gap: 18px; border-radius: 24px; }
  .flow-card--success { gap: 22px; }
  .flow-card__title { font-size: 26px; line-height: 42px; }
  .flow-card__art img { height: 124px; }
  .flow-card__art img[data-art-default],
  .flow-card__art img[data-art-error] { height: 129px; }
  .flow-card__art--left img { height: 170px; }
  .how-step { gap: 12px; }
  .how-step__title { margin-bottom: 2px; }
  .flow-card__art--tall img { height: 190px; }

  .btn--flow { height: 56px; font-size: 18px; }
  .wallet-btn { height: 56px; }

  .code { gap: 8px; }
  .code__cell { width: 45px; height: 56px; font-size: 22px; border-radius: 14px; }

  .methods { flex-wrap: wrap; }
  .method { flex: 1 1 calc(50% - 5px); }
  .summary { padding: 18px; }
  .summary__row--top { flex-direction: column; gap: 0; }
  .summary__row--top .summary__value { text-align: left; }
  .alert img { height: 76px; }
  .alert__text { margin-top: 4px; line-height: 19px; }
}
