body {
	padding: 20px;
	background-color: #fff;
}

footer {
	border-top: 2px solid #eee;
	padding-top: 15px;
}

.block {
	margin-bottom: 20px;
}

.block img {
	max-width: 100%;
	height: auto;
}

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

:root {
  --orange:       #FF7A00;
  --orange-light: #FFB347;
  --orange-pale:  #FFF0E0;
  --orange-bg:    #FFF8F0;
  --white:        #FFFFFF;
  --text:         #5A3200;
  --text-light:   #A06030;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  background: var(--orange-bg);
  background-image:
          radial-gradient(circle at 10% 20%, rgba(255,179,71,0.18) 0%, transparent 50%),
          radial-gradient(circle at 90% 80%, rgba(255,122,0,0.12) 0%, transparent 50%);
  font-family: 'Nunito', sans-serif;
}

body::before {
  content: '⭐ 🌟 ✨ ⭐ 🌟 ✨ ⭐ 🌟 ✨';
  position: fixed;
  top: 12px; left: 0; right: 0;
  font-size: 18px;
  letter-spacing: 55px;
  opacity: 0.12;
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  animation: floatStars 10s linear infinite;
}

/* ---- Роутер ---- */
.page { display: none; }
.page.active {
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  inset: 0;
  padding: 24px;
  overflow-y: auto;
  animation: fadeIn 0.35s ease;
}

/* ---- Card ---- */
.card {
  background: var(--white);
  border-radius: 32px;
  padding: 36px 32px 32px;
  width: 100%;
  max-width: 420px;
  box-shadow:
          0 8px 0 #FFB347,
          0 18px 0 rgba(255,122,0,0.12),
          0 32px 64px rgba(255,122,0,0.15);
  position: relative;
  text-align: center;
  border: 3px solid #FFD9A8;
  /* Карточка сжимается если экран маленький, но не растягивается */
  flex-shrink: 0;
  margin: auto;
}

.card::before {
  content: '';
  position: absolute;
  top: -3px; left: 36px; right: 36px; height: 6px;
  background: repeating-linear-gradient(
          90deg,
          var(--orange) 0px, var(--orange) 10px,
          transparent 10px, transparent 18px
  );
  border-radius: 10px;
}

/* ---- Fox ---- */
.fox-wrap {
  margin: 0 auto 12px;
  filter: drop-shadow(0 8px 14px rgba(255,122,0,0.25));
}
.fox-wrap img { width: 100%; height: 100%; object-fit: contain; }
.fox-wrap--lg { width: 160px; height: 160px; }
.fox-wrap--sm { width: 120px; height: 120px; }

/* ---- Typography ---- */
.card__label {
  font-size: 10px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 6px;
  font-family: 'Courier New', monospace;
}

.card__title {
  font-size: 24px;
  font-weight: 900;
  color: var(--orange);
  margin-bottom: 4px;
}

.card__sub {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 26px;
  line-height: 1.5;
}

/* ---- Button ---- */
.btn {
  width: 100%;
  padding: 17px 24px;
  background: linear-gradient(135deg, #FF7A00, #FFB347);
  border: none;
  border-radius: 18px;
  color: #fff;
  font-size: 17px;
  font-weight: 900;
  font-family: 'Nunito', sans-serif;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
  box-shadow: 0 6px 0 #C85A00, 0 12px 24px rgba(255,122,0,0.28);
  letter-spacing: 0.3px;
  margin-bottom: 4px;
}

.btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 0 #C85A00, 0 16px 32px rgba(255,122,0,0.35);
}

.btn:active:not(:disabled) {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #C85A00, 0 4px 8px rgba(255,122,0,0.2);
}

.btn:disabled {
  background: linear-gradient(135deg, #FFD0A0, #FFE5C0);
  box-shadow: 0 4px 0 #E8BF80;
  cursor: not-allowed;
}

.btn__spinner {
  display: none;
  width: 16px; height: 16px;
  border: 3px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

.btn.loading .btn__spinner { display: inline-block; }

/* ---- Inputs ---- */
.field-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-light);
  text-align: left;
  margin-bottom: 8px;
  display: block;
}

.input {
  width: 100%;
  padding: 15px 16px;
  background: var(--orange-pale);
  border: 2.5px solid #FFD0A0;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  font-family: 'Nunito', sans-serif;
  outline: none;
  transition: border-color 0.15s;
}

.input:focus { border-color: var(--orange); }
.input::placeholder { color: #DDB890; font-weight: 700; }

/* ---- Phone row ---- */
.phone-row {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}

.phone-prefix {
  flex: 0 0 64px;
  padding: 15px 10px;
  background: var(--orange-pale);
  border: 2.5px solid #FFD0A0;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 900;
  color: var(--orange);
  text-align: center;
  font-family: 'Nunito', sans-serif;
}

/* ---- OTP ---- */
.otp-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 18px;
}

.otp-box {
  width: 54px;
  height: 62px;
  background: var(--orange-pale);
  border: 2.5px solid #FFD0A0;
  border-radius: 14px;
  font-size: 26px;
  font-weight: 900;
  color: var(--orange);
  text-align: center;
  font-family: 'Nunito', sans-serif;
  outline: none;
  transition: border-color 0.15s, transform 0.1s;
  caret-color: var(--orange);
}

.otp-box:focus { border-color: var(--orange); transform: scale(1.06); }
.otp-box.filled { border-color: var(--orange); background: #FFF5E8; }

/* ---- Messages ---- */
.msg {
  display: none;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  animation: popIn 0.3s ease;
}

.msg.error   { display: block; background: #FFF0EE; border: 2px solid #FF9090; color: #E05050; }
.msg.success { display: block; background: #FFF5E8; border: 2px solid #FFB347; color: var(--orange); }

/* ---- Auth steps ---- */
.step { display: none; }
.step.active { display: block; animation: popIn 0.35s ease; }

/* ---- Progress dots ---- */
.progress-line {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 22px;
}

.progress-line__dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #FFD0A0;
  transition: background 0.3s, transform 0.3s;
}

.progress-line__dot.active { background: var(--orange); transform: scale(1.2); }
.progress-line__dot.done   { background: var(--orange-light); }

/* ---- Countdown inline ---- */
.countdown-line {
  margin-top: 14px;
  font-size: 12px;
  font-weight: 800;
  color: var(--text-light);
}

.countdown-line span { color: var(--orange); font-weight: 900; }

/* ---- Countdown block (ajax page) ---- */
.countdown-block {
  display: none;
  margin-top: 18px;
  padding: 18px 16px 16px;
  background: var(--orange-pale);
  border: 2.5px dashed #FFB347;
  border-radius: 18px;
}

.countdown-block.visible { display: block; animation: popIn 0.3s ease; }

.countdown-block__num {
  font-size: 44px;
  font-weight: 900;
  color: var(--orange);
  line-height: 1;
  display: block;
  animation: numPulse 1s ease-in-out infinite;
}

.countdown-block__label {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-light);
  margin: 8px 0 12px;
  line-height: 1.5;
}

.countdown-block__bar-wrap {
  height: 10px;
  background: rgba(255,122,0,0.15);
  border-radius: 10px;
  overflow: hidden;
}

.countdown-block__bar {
  height: 100%;
  background: linear-gradient(90deg, #FF7A00, #FFB347);
  border-radius: 10px;
  transition: width 1s linear;
}

/* ---- SMS code display ---- */
.sms-code-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 6px 0 20px;
  padding: 20px 20px 18px;
  background: var(--orange-pale);
  border: 2.5px dashed #FFB347;
  border-radius: 18px;
}

.sms-code-box__code {
  font-size: 52px;
  font-weight: 900;
  color: var(--orange);
  letter-spacing: 10px;
  font-family: 'Courier New', monospace;
  line-height: 1;
}

.sms-code-box__divider {
  width: 48px;
  height: 2px;
  background: rgba(255,122,0,0.2);
  border-radius: 2px;
}

.sms-code-box__to-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-light);
}

.sms-code-box__to-phone {
  font-size: 22px;
  font-weight: 900;
  color: var(--text);
  letter-spacing: 1px;
  font-family: 'Courier New', monospace;
}

/* ---- Waiting timer (120s arc) ---- */
.wait-timer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.wait-timer__ring {
  position: relative;
  width: 80px; height: 80px;
}

.wait-timer__svg { transform: rotate(-90deg); }

.wait-timer__track {
  fill: none;
  stroke: rgba(255,122,0,0.15);
  stroke-width: 6;
}

.wait-timer__arc {
  fill: none;
  stroke: var(--orange);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 220;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear;
}

.wait-timer__num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 900;
  color: var(--orange);
}

.wait-timer__text {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-light);
  text-align: center;
  line-height: 1.5;
}

/* ---- SMS link button ---- */
.btn--sms {
  display: block;
  text-decoration: none;
  text-align: center;
  margin-bottom: 18px;
  background: linear-gradient(135deg, #FF9A3C, #FFB347);
  box-shadow: 0 6px 0 #C86A00, 0 12px 24px rgba(255,122,0,0.2);
  font-size: 15px;
}

.btn--sms:hover {
  background: linear-gradient(135deg, #FFB347, #FFCA6E);
}

/* ---- Resend / link buttons ---- */
.resend-btn {
  display: none;
  background: none;
  border: none;
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 900;
  color: var(--orange);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  margin-top: 14px;
}

.resend-btn.visible { display: inline-block; }

.link-btn {
  display: inline-block;
  margin-top: 14px;
  font-size: 13px;
  font-weight: 800;
  color: var(--text-light);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  background: none;
  border: none;
  font-family: 'Nunito', sans-serif;
}

.link-btn:hover { color: var(--orange); }

/* ---- Success ---- */
.success-icon {
  font-size: 64px;
  margin-bottom: 12px;
  display: block;
  animation: popIn 0.4s ease;
}

/* ---- Paws ---- */
.paws {
  margin-top: 22px;
  font-size: 18px;
  letter-spacing: 6px;
  opacity: 0.22;
}

/* ---- Animations ---- */
@keyframes floatStars {
  from { transform: translateX(0); }
  to   { transform: translateX(-220px); }
}

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

@keyframes popIn {
  from { opacity: 0; transform: scale(0.9) translateY(8px); }
  to   { opacity: 1; transform: scale(1)   translateY(0); }
}

@keyframes numPulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.1); }
}

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