:root {
  color-scheme: light;
  --blue-700: #1d4ed8;
  --blue-600: #2563eb;
  --blue-100: #dbeafe;
  --blue-50: #eff6ff;
  --slate-950: #0f172a;
  --slate-600: #475569;
  --slate-400: #94a3b8;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --danger: #b42318;
  --danger-bg: #fef3f2;
  --success: #067647;
  --white: #fff;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--slate-950);
  background:
    radial-gradient(circle at 15% 10%, rgba(59, 130, 246, .12), transparent 28rem),
    linear-gradient(145deg, #f8fafc, #eef4ff);
}

button, input { font: inherit; }

.page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 40px 20px;
}

.card {
  width: min(100%, 780px);
  padding: clamp(26px, 5vw, 52px);
  border: 1px solid rgba(226, 232, 240, .85);
  border-radius: 24px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 24px 60px rgba(30, 64, 175, .10), 0 4px 16px rgba(15, 23, 42, .05);
}

.card__header { margin-bottom: 34px; }
.eyebrow {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--blue-600);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

h1 { margin: 0; font-size: clamp(1.8rem, 5vw, 2.65rem); line-height: 1.12; letter-spacing: -.035em; }
.card__header p { margin: 12px 0 0; color: var(--slate-600); line-height: 1.6; }

.file-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.file-field {
  display: flex;
  min-width: 0;
  padding: 18px;
  flex-direction: column;
  gap: 12px;
  border: 1px solid var(--slate-200);
  border-radius: 16px;
  background: #fbfdff;
}

.file-field__label { font-weight: 750; }
.file-picker {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  cursor: pointer;
  border: 1px solid var(--blue-100);
  border-radius: 11px;
  color: var(--blue-700);
  background: var(--blue-50);
  font-weight: 700;
  transition: border-color .2s, background .2s, transform .2s;
}

.file-picker:hover { border-color: #93c5fd; background: #e8f1ff; transform: translateY(-1px); }
.visually-hidden:focus + .file-picker { outline: 3px solid rgba(37, 99, 235, .25); outline-offset: 2px; }
.file-picker__icon { font-size: 1.25rem; line-height: 1; }
.file-name { overflow: hidden; color: var(--slate-600); font-size: .875rem; text-overflow: ellipsis; white-space: nowrap; }
.file-name.has-file { color: var(--slate-950); font-weight: 650; }

.button {
  min-height: 48px;
  padding: 0 22px;
  cursor: pointer;
  border: 0;
  border-radius: 11px;
  font-weight: 750;
  transition: background .2s, box-shadow .2s, transform .2s;
}

.button--primary { color: var(--white); background: var(--blue-600); box-shadow: 0 8px 18px rgba(37, 99, 235, .2); }
.button--primary:hover:not(:disabled) { background: var(--blue-700); transform: translateY(-1px); }
.button--secondary { color: var(--slate-950); border: 1px solid var(--slate-200); background: var(--white); }
.button--compare { display: flex; width: 100%; margin-top: 24px; align-items: center; justify-content: center; gap: 10px; letter-spacing: .04em; }
.button:disabled { cursor: not-allowed; opacity: .52; box-shadow: none; }

.spinner { display: none; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.42); border-top-color: #fff; border-radius: 50%; animation: spin .75s linear infinite; }
.button.is-loading .spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 1.5s; } * { scroll-behavior: auto !important; } }

.message { margin-top: 20px; padding: 13px 15px; border: 1px solid #fecdca; border-radius: 11px; color: var(--danger); background: var(--danger-bg); line-height: 1.45; }
.result { margin-top: 28px; padding-top: 26px; border-top: 1px solid var(--slate-200); }
.result h2 { margin: 0 0 18px; color: var(--success); font-size: 1.25rem; }
.statistics { display: grid; grid-template-columns: minmax(110px, 1fr) auto; gap: 9px 24px; max-width: 360px; margin: 0 0 22px; }
.statistics dt { position: relative; overflow: hidden; color: var(--slate-600); }
.statistics dt::after { position: absolute; padding-left: 6px; color: var(--slate-400); content: "................................"; }
.statistics dd { z-index: 1; margin: 0; padding-left: 4px; background: var(--white); font-weight: 800; }
.download-actions { display: flex; flex-wrap: wrap; gap: 12px; }

@media (max-width: 620px) {
  .page { align-items: start; padding: 18px 12px; }
  .card { padding: 25px 18px; border-radius: 19px; }
  .file-grid { grid-template-columns: 1fr; }
  .download-actions { flex-direction: column; }
  .download-actions .button { width: 100%; }
}

