/* Otveto.ru — токены дизайна (шрифт TT Hoves, #05f, скругления как на сайте) */
@font-face {
  font-family: "TT Hoves Pro";
  src: url("https://otveto.ru/fonts/TTHovesProRegular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "TT Hoves Pro";
  src: url("https://otveto.ru/fonts/TTHovesProMedium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "TT Hoves Pro";
  src: url("https://otveto.ru/fonts/TTHovesProDemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --otv-text: #292824;
  --otv-text-muted: #6b7280;
  --otv-blue: #0055ff;
  --otv-blue-short: #05f;
  --otv-link: #004aad;
  --otv-bg: #ffffff;
  --otv-bg-soft: #f9fafb;
  --otv-border: rgba(0, 0, 0, 0.08);
  --otv-radius-lg: 3.125rem;
  --otv-radius-md: 1.5rem;
  --otv-radius-sm: 1rem;
  --otv-gradient: linear-gradient(97.95deg, #05f, #00a3f5);
  --otv-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
  --safe-bottom: env(safe-area-inset-bottom, 12px);
}

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

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: "TT Hoves Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.45;
  color: var(--otv-text);
  background: var(--otv-bg-soft);
  -webkit-font-smoothing: antialiased;
}

.app {
  max-width: 28rem;
  margin: 0 auto;
  padding: 1rem 1rem calc(1.5rem + var(--safe-bottom));
}

.card {
  background: var(--otv-bg);
  border-radius: var(--otv-radius-md);
  padding: 1.5rem 1.25rem;
  box-shadow: var(--otv-shadow);
  border: 1px solid var(--otv-border);
}

h1 {
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin: 0 0 0.75rem;
}

h2 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 1rem 0 0.5rem;
}

p.lead {
  font-size: 0.9375rem;
  color: var(--otv-text-muted);
  margin: 0 0 1rem;
}

.rules {
  font-size: 0.875rem;
  color: var(--otv-text);
  line-height: 1.55;
  margin-bottom: 1rem;
}

.rules ul {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
}

.legal-note {
  font-size: 0.6875rem;
  line-height: 1.4;
  color: var(--otv-text-muted);
  margin: 0.75rem 0 0.25rem;
}

.legal-note a {
  color: var(--otv-link);
  text-decoration: underline;
  text-underline-offset: 0.1em;
}

.cta-block {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.btn-subscribe {
  background: #fff;
  color: var(--otv-blue);
  border: 2px solid var(--otv-blue);
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(0, 85, 255, 0.14);
  text-decoration: none;
}

.btn-subscribe:hover {
  background: rgba(0, 85, 255, 0.06);
}

.btn-cta-main {
  font-size: 1.0625rem;
  font-weight: 600;
  padding: 1.05rem 1.25rem;
}

label.field {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
}

input[type="text"],
input[type="tel"] {
  width: 100%;
  padding: 0.875rem 1rem;
  border-radius: var(--otv-radius-sm);
  border: 1px solid var(--otv-border);
  font-family: inherit;
  font-size: 1rem;
  margin-bottom: 1rem;
  background: #fff;
}

input:focus {
  outline: 2px solid rgba(0, 85, 255, 0.25);
  outline-offset: 0;
  border-color: var(--otv-blue);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.95rem 1.25rem;
  border: none;
  border-radius: var(--otv-radius-sm);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.2s;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--otv-gradient);
  color: #fff;
  box-shadow: 0 4px 14px rgba(0, 85, 255, 0.35);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  background: #fff;
  color: var(--otv-blue);
  border: 1.5px solid rgba(0, 85, 255, 0.35);
  margin-top: 0.5rem;
}

.tg-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--otv-link);
  font-weight: 500;
  font-size: 0.9375rem;
  text-decoration: none;
  margin: 0.5rem 0 1rem;
}

.tg-link:hover {
  text-decoration: underline;
}

.hidden {
  display: none !important;
}

.err {
  background: #fef2f2;
  color: #b91c1c;
  padding: 0.75rem 1rem;
  border-radius: var(--otv-radius-sm);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

/* Анимация «кейс» */
.case-stage {
  overflow: hidden;
  border-radius: var(--otv-radius-md);
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  padding: 1rem 0;
  margin: 1rem 0;
  position: relative;
}

.case-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(0, 85, 255, 0.15), transparent 70%);
  pointer-events: none;
}

.case-viewport {
  position: relative;
  height: 180px;
  overflow: hidden;
}

.case-strip {
  display: flex;
  gap: 14px;
  will-change: transform;
  padding: 0 50%;
}

.case-item {
  flex: 0 0 140px;
  width: 140px;
  min-height: 156px;
  height: 156px;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  padding: 8px 8px 6px;
  box-sizing: border-box;
}

.case-item-visual {
  flex: 1 1 0;
  min-height: 88px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.case-item .case-item-img {
  box-sizing: border-box;
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  min-height: 0;
  object-fit: contain;
  object-position: center center;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 0.5rem;
}

.case-item .case-item-img--missing {
  object-fit: none;
  background: rgba(255, 255, 255, 0.1)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.35)' stroke-width='1.5'%3E%3Crect x='3' y='3' width='18' height='18' rx='2'/%3E%3Ccircle cx='8.5' cy='8.5' r='1.5'/%3E%3Cpath d='M21 15l-5-5L5 21'/%3E%3C/svg%3E")
    center/40px 40px no-repeat;
}

.case-item span {
  flex: 0 0 auto;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.88);
  text-align: center;
  line-height: 1.2;
  margin-top: 6px;
  max-height: 2.6em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.case-pointer {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 14px solid #fbbf24;
  z-index: 2;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

.result-gift {
  text-align: center;
  padding: 1.5rem 1rem;
}

.result-gift img {
  max-width: 140px;
  max-height: 120px;
  width: auto;
  height: auto;
  object-fit: contain;
  margin-bottom: 1rem;
  vertical-align: middle;
}

.result-gift img.case-item-img--missing {
  padding: 12px;
  background: #f1f5f9;
  border-radius: 12px;
  object-fit: contain;
}

.result-gift .title {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.result-promo {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--otv-border, #e2e8f0);
  text-align: left;
}

.result-promo.hidden {
  display: none !important;
}

.promo-code {
  font-family: ui-monospace, "Cascadia Code", "Consolas", monospace;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--otv-blue, #05f);
  padding: 0.75rem 1rem;
  background: #f1f5f9;
  border-radius: 12px;
  text-align: center;
  margin-bottom: 1rem;
  user-select: all;
}

.promo-instruction {
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--otv-muted, #64748b);
  margin-bottom: 0.75rem;
}

.app-header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.app-header-brand {
  display: inline-flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  align-self: flex-start;
  gap: 0.625rem;
  min-height: 44px;
}

.app-logo {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: block;
  object-fit: contain;
}

.app-brand {
  flex-shrink: 0;
  font-size: 1.25rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1;
  color: var(--otv-blue) !important;
  -webkit-text-fill-color: var(--otv-blue);
}

.app-title {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
}
