:root {
  --bg: #1a1a1a;
  --card: rgba(40,20,20,0.95);
  --muted: #d0d0d0;
  --text: #ffffff;
  --accent: #ff1a1a;
  --accent-2: #ff4d4d;
  --danger: #ff1a1a;
  --border: rgba(255,255,255,0.12);
  --input: #222;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, Arial, Helvetica, sans-serif;
  background: linear-gradient(135deg, #2a2a2a, #1a1a1a 60%, #101010);
  color: var(--text);
  min-height: 100vh;
  padding: 32px 16px;
}

.wrap {
  max-width: 1100px;
  margin: 0 auto;
}

.hero {
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
  padding-top: 8px;
  padding-bottom: 20px;
}

.life-line {
  position: relative;
  width: 100%;
  opacity: 0.4;
  pointer-events: none;
  z-index: 0;
  margin-top: 0;
  margin-bottom: 14px;
}

.life-line svg {
  width: 100%;
  height: 90px;
  display: block;
}

.life-line path {
  fill: none;
  stroke: #ff1a1a;
  stroke-width: 3;
  stroke-dasharray: 600;
  stroke-dashoffset: 600;
  animation: drawLine 6s linear infinite;
  filter: drop-shadow(0 0 12px rgba(255,0,0,0.9));
}

@keyframes drawLine {
  0% { stroke-dashoffset: 600; }
  50% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -600; }
}

h1 {
  margin: 0 0 10px;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  position: relative;
  z-index: 1;
}

.lead {
  margin: 0;
  color: var(--muted);
  max-width: 760px;
  line-height: 1.6;
  position: relative;
  z-index: 1;
}

.grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
}

.card {
  background: linear-gradient(180deg, rgba(40,40,40,0.95), rgba(28,28,28,0.95));
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 24px;
  backdrop-filter: blur(6px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.4), 0 0 12px rgba(255,0,0,0.1);
}

.section-title {
  margin: 0 0 18px;
  font-size: 1.2rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field.full { grid-column: 1 / -1; }

label {
  font-size: 0.95rem;
  color: #bbbbbb;
  font-weight: 600;
}

input, select {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.12);
  background: #222;
  color: var(--text);
  border-radius: 14px;
  padding: 14px 14px;
  font-size: 1rem;
  outline: none;
  transition: all 0.2s ease;
}

input:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(255,0,0,0.25);
  transform: translateY(-1px);
}

.chips {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  background: #222;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  position: relative;
}

.chip .text {
  flex: 1;
}

.chip input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

.info {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #7a1f1f;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  box-shadow: 0 0 6px rgba(122,31,31,0.5);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.info:hover,
.info.open {
  transform: scale(1.15);
  box-shadow: 0 0 10px rgba(122,31,31,0.8);
}

.info::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 130%;
  right: 0;
  background: #5a1a1a;
  color: #fff;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  width: 220px;
  max-width: calc(100vw - 40px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  box-shadow: 0 0 10px rgba(0,0,0,0.6);
  z-index: 999;
  text-align: left;
}

.info:hover::after,
.info.open::after {
  opacity: 1;
  pointer-events: auto;
}

.actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}

button {
  border: 0;
  border-radius: 14px;
  padding: 14px 18px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

button:hover { transform: translateY(-1px); }

.primary {
  background: linear-gradient(90deg, #ff0000, #8b0000);
  color: #ffffff;
  box-shadow: 0 0 20px rgba(255,0,0,0.5);
}

.result-box {
  display: grid;
  gap: 16px;
}

.countdown-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #2a2a2a, #1a1a1a 60%, #111);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 22px;
  padding: 20px;
  box-shadow: inset 0 0 12px rgba(255,0,0,0.12), 0 0 15px rgba(255,0,0,0.15);
}

.countdown-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(255,0,0,0.12), transparent 40%);
  pointer-events: none;
}

.countdown-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.countdown-title small {
  display: block;
  color: #9a9a9a;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.countdown-title strong {
  display: block;
  font-size: 1.05rem;
  color: #ffffff;
  margin-top: 4px;
}

.countdown-badge {
  color: #ffffff;
  background: rgba(255,0,0,0.15);
  border: 1px solid rgba(255,0,0,0.4);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.85rem;
  white-space: nowrap;
  box-shadow: 0 0 12px rgba(255,0,0,0.3);
}

.countdown-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.countdown-days-big {
  display: block;
  width: 100%;
  font-size: clamp(3rem, 7vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.95;
  margin: 0 0 8px 0;
}

.countdown-days-big span {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  margin-top: 10px;
  color: var(--muted);
}

.countdown-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
}

.countdown-unit {
  background: #1b1b1b;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  padding: 12px 10px;
  text-align: center;
  min-width: 0;
}

.countdown-unit .value {
  font-size: 1.9rem;
  font-weight: 800;
  display: block;
  line-height: 1;
  margin-bottom: 6px;
}

.countdown-unit .label {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.1;
}

.countdown-note {
  margin-top: 12px;
  color: #cccccc;
  line-height: 1.5;
  font-size: 0.95rem;
}

.metric {
  transition: opacity 0.35s ease, transform 0.35s ease;
  background: linear-gradient(180deg, #2a2a2a, #1a1a1a);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 0 10px rgba(255,0,0,0.12);
}

.metric small {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.big {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.05;
}

.sub {
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

.list {
  margin: 0;
  padding-left: 18px;
  color: #cccccc;
  line-height: 1.7;
}

.warning {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(40,0,0,0.8);
  border: 1px solid rgba(255,0,0,0.3);
  color: #ffb3b3;
  line-height: 1.5;
  font-size: 0.95rem;
  box-shadow: 0 0 15px rgba(255,0,0,0.2);
}

.analyzing-box {
  display: none;
  align-items: center;
  gap: 16px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(255,0,0,0.25);
  background: linear-gradient(180deg, #111, #0a0a0a);
  box-shadow: 0 0 20px rgba(255,0,0,0.15);
}

.analyzing-box.active {
  display: flex;
}

.scanner {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 3px solid rgba(255,0,0,0.2);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
  flex-shrink: 0;
  box-shadow: 0 0 18px rgba(255,0,0,0.4);
}

.analyzing-text strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1rem;
  color: #ffffff;
}

.analyzing-text span {
  color: #cccccc;
  line-height: 1.5;
  display: block;
}

.dots::after {
  content: '';
  display: inline-block;
  width: 1.2em;
  text-align: left;
  animation: dots 1.4s steps(4, end) infinite;
}

.result-box.loading .metric,
.result-box.loading .sub,
.result-box.loading .list,
.result-box.loading .warning {
  opacity: 0.22;
  transform: scale(0.995);
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes dots {
  0% { content: ''; }
  25% { content: '.'; }
  50% { content: '..'; }
  75% { content: '...'; }
  100% { content: ''; }
}

.footer-note {
  margin-top: 20px;
  color: #ccc;
  font-size: 0.92rem;
  line-height: 1.7;
  background: #1a1a1a;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 18px;
  padding: 18px 20px;
}

@media (max-width: 900px) {
  body { padding: 20px 12px; }
  .hero { padding-top: 24px; padding-bottom: 8px; }
  .grid { grid-template-columns: 1fr; gap: 16px; }
  .card { padding: 18px; border-radius: 20px; }
  .form-grid, .chips { grid-template-columns: 1fr; }
  .countdown-title { flex-direction: column; align-items: flex-start; }
  .countdown-badge { align-self: flex-start; }
}

@media (max-width: 640px) {
  h1 { font-size: 1.8rem; }
  .lead { font-size: 0.96rem; }
  .section-title { font-size: 1.1rem; }
  .card { padding: 16px; }
  input, select, button { min-height: 52px; }
  .chip { padding: 14px 12px; align-items: flex-start; }
  .chip input[type="checkbox"] { width: 20px; height: 20px; margin-top: 2px; }
  .info { width: 20px; height: 20px; font-size: 12px; }
  .info::after {
    width: min(240px, calc(100vw - 48px));
    right: -4px;
    bottom: calc(100% + 8px);
  }
  .countdown-card { padding: 16px; }
  .countdown-days-big { font-size: 2.6rem; }
  .countdown-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .countdown-unit { padding: 10px 8px; }
  .countdown-unit .value { font-size: 1.4rem; }
  .big { font-size: 2rem; }
  .footer-note { padding: 16px; }
}

@media (max-width: 400px) {
  body { padding: 14px 8px; }
  .card { padding: 14px; border-radius: 18px; }
  .countdown-row { grid-template-columns: 1fr; }
  .countdown-unit .value { font-size: 1.25rem; }
  .countdown-days-big { font-size: 2.2rem; }
}
