*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background: #F5F7FA;
  color: #1F2937;
  min-height: 100dvh;
  overflow-x: hidden;
  line-height: 1.45;
}

button,
input {
  font-family: inherit;
  touch-action: manipulation;
}

a {
  color: #6B7280;
  text-decoration: none;
}

.page {
  min-height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  padding: calc(16px + env(safe-area-inset-top)) 16px calc(20px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  min-height: 44px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: #2563EB;
  color: #fff;
  flex-shrink: 0;
}

.logo-text {
  font-size: 16px;
  font-weight: 700;
  color: #111827;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.lang-switch {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  background: #fff;
  color: #4B5563;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.lang-btn.active {
  background: #EFF6FF;
  border-color: #2563EB;
  color: #1E40AF;
  font-weight: 700;
}

.lang-flag {
  width: 16px;
  height: 12px;
  border-radius: 2px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  flex-shrink: 0;
  display: inline-block;
}

.flag-ru {
  background: linear-gradient(
    to bottom,
    #ffffff 0 33.33%,
    #0039a6 33.33% 66.66%,
    #d52b1e 66.66% 100%
  );
}

.flag-kz {
  background: #00afca;
  position: relative;
}

.flag-kz::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fec50c;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.screens {
  flex: 1;
}

.screen {
  display: none;
  animation: fadeUp 0.35s ease;
}

.screen.is-visible {
  display: block;
}

.card {
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.06);
  padding: 22px 20px 24px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #EFF6FF;
  color: #1D4ED8;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2563EB;
  box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.45);
  animation: pulseDot 1.8s ease-out infinite;
}

.main-title {
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: -0.03em;
  color: #111827;
  margin-bottom: 8px;
}

.subtitle {
  font-size: 15px;
  color: #6B7280;
  margin-bottom: 24px;
}

.field {
  margin-bottom: 22px;
}

.field-title {
  font-size: 15px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
}

.value-display {
  min-height: 42px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #111827;
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  transition: transform 0.15s ease, color 0.15s ease;
}

.value-display.is-updating {
  transform: scale(1.03);
  color: #2563EB;
}

.range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(to right, #2563EB 0%, #2563EB 5.9%, #E5E7EB 5.9%, #E5E7EB 100%);
  outline: none;
  margin: 8px 0 6px;
}

.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #2563EB;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.28);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.range::-webkit-slider-thumb:active {
  transform: scale(1.08);
}

.range::-moz-range-thumb {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #2563EB;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.28);
  cursor: pointer;
}

.range::-moz-range-track {
  height: 8px;
  border-radius: 999px;
  background: #E5E7EB;
}

.range::-moz-range-progress {
  height: 8px;
  border-radius: 999px;
  background: #2563EB;
}

.range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #9CA3AF;
  min-height: 18px;
}

.info-block {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 20px;
}

.info-icon {
  color: #059669;
  flex-shrink: 0;
  margin-top: 1px;
}

.info-title {
  font-size: 15px;
  font-weight: 600;
  color: #065F46;
  margin-bottom: 4px;
}

.info-text {
  font-size: 13px;
  color: #047857;
  line-height: 1.4;
}

.btn {
  width: 100%;
  min-height: 56px;
  border: none;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.15s ease, background 0.2s ease, opacity 0.2s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: #2563EB;
  color: #fff;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.22);
}

.btn-primary:hover {
  background: #1D4ED8;
}

.btn-ghost {
  margin-top: 10px;
  background: transparent;
  color: #6B7280;
  font-weight: 500;
  box-shadow: none;
  min-height: 52px;
}

.btn-ghost:hover {
  background: #EEF2F7;
}

.tg-icon {
  flex-shrink: 0;
}

.result-intro {
  margin-bottom: 12px;
}

.result-intro .main-title {
  margin-bottom: 16px;
}

.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.summary-item {
  background: #F8FAFC;
  border-radius: 14px;
  padding: 12px;
}

.summary-label {
  display: block;
  font-size: 12px;
  color: #6B7280;
  margin-bottom: 4px;
}

.summary-value {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: #111827;
  min-height: 22px;
}

.salary-card {
  text-align: center;
  margin-bottom: 12px;
}

.salary-caption {
  font-size: 15px;
  color: #4B5563;
  margin-bottom: 8px;
}

.salary-value {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: #1D4ED8;
  min-height: 44px;
  line-height: 1.15;
}

.salary-period {
  font-size: 15px;
  color: #6B7280;
  margin: 4px 0 12px;
}

.salary-note {
  font-size: 14px;
  color: #4B5563;
  min-height: 40px;
}

.daily-row {
  background: #ECFDF5;
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 14px;
}

.daily-title {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: #065F46;
  margin-bottom: 4px;
}

.daily-check {
  color: #059669;
  flex-shrink: 0;
}

.daily-text {
  font-size: 13px;
  color: #047857;
  padding-left: 22px;
}

.disclaimer {
  font-size: 12px;
  line-height: 1.5;
  color: #9CA3AF;
  margin-bottom: 18px;
}

.footer {
  margin-top: 20px;
  text-align: center;
  color: #9CA3AF;
  font-size: 12px;
  line-height: 1.5;
}

.footer-links {
  margin-top: 8px;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.footer-dot {
  color: #D1D5DB;
}

.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: #F8FAFC;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.loading-screen.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.loading-inner {
  width: 100%;
  max-width: 360px;
  text-align: center;
}

.loader {
  width: 64px;
  height: 64px;
  margin: 0 auto 22px;
  position: relative;
}

.loader::before,
.loader::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 4px solid #DBEAFE;
}

.loader::after {
  border-color: transparent;
  border-top-color: #2563EB;
  animation: spin 0.85s linear infinite;
}

.loading-title {
  font-size: 20px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 22px;
  letter-spacing: -0.02em;
}

.loading-steps {
  list-style: none;
  text-align: left;
  min-height: 132px;
}

.loading-step {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.loading-step.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.step-mark {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #BFDBFE;
  flex-shrink: 0;
  position: relative;
}

.loading-step.is-pending .step-mark::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: #3B82F6;
  animation: pendingPulse 1s ease-in-out infinite;
}

.loading-step.is-done .step-mark {
  border-color: #10B981;
  background: #10B981;
  animation: checkIn 0.28s ease;
}

.loading-step.is-done .step-mark::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 3px;
  width: 6px;
  height: 11px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.step-text {
  font-size: 15px;
  color: #4B5563;
}

.loading-step.is-done .step-text {
  color: #065F46;
  font-weight: 600;
}

body.is-loading {
  overflow: hidden;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulseDot {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(37, 99, 235, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
  }
}

@keyframes pendingPulse {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(0.85);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes checkIn {
  from {
    transform: scale(0.7);
    opacity: 0.4;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@media (max-width: 359px) {
  .main-title {
    font-size: 22px;
  }

  .salary-value {
    font-size: 30px;
  }

  .value-display {
    font-size: 24px;
  }
}
