:root {
  --color-primary: #2196f3;
  --color-primary-dark: #1769aa;
  --color-success: #4caf50;
  --color-error: #f44336;
  --color-warning: #f59e0b;
  --color-bg: #f5f5f5;
  --color-panel: #ffffff;
  --color-text: #333333;
  --color-muted: #6b7280;
  --color-border: #cbd5e1;
  --shadow: 0 24px 60px rgba(26, 43, 61, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--color-text);
  background:
    radial-gradient(circle at top left, rgba(33, 150, 243, 0.14), transparent 30%),
    linear-gradient(180deg, #eef6fd 0%, var(--color-bg) 55%, #f8fafc 100%);
}

button,
input {
  font: inherit;
}

.app-shell {
  width: min(100%, 800px);
  margin: 0 auto;
  padding: 32px 16px 48px;
}

.panel {
  background: var(--color-panel);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 32px;
}

.panel-header {
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--color-primary-dark);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  font-weight: 700;
}

h1,
.section-title {
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.05;
}

.lead {
  margin: 14px 0 0;
  max-width: 62ch;
  color: var(--color-muted);
  line-height: 1.6;
}

.section-title {
  font-size: 1.25rem;
  margin-bottom: 16px;
}

.drop-zone {
  width: 100%;
  min-height: 300px;
  border: 3px dashed rgba(33, 150, 243, 0.45);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(33, 150, 243, 0.08), rgba(76, 175, 80, 0.06)),
    #fcfdff;
  color: inherit;
  padding: 32px;
  display: grid;
  place-items: center;
  gap: 12px;
  text-align: center;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.drop-zone:hover,
.drop-zone:focus-visible,
.drop-zone.drag-over {
  transform: translateY(-2px);
  border-color: var(--color-primary);
  box-shadow: 0 18px 40px rgba(33, 150, 243, 0.16);
  outline: none;
}

.drop-zone-icon {
  width: 88px;
  height: 88px;
  border-radius: 24px;
  display: inline-grid;
  place-items: center;
  background: linear-gradient(135deg, var(--color-primary), #60a5fa);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.drop-zone-title {
  font-size: 1.35rem;
  font-weight: 700;
}

.drop-zone-subtitle,
.helper-text {
  color: var(--color-muted);
}

.status-card,
.stat,
.result-message {
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 16px;
  background: #fbfdff;
}

.status-card,
.result-message {
  padding: 16px 18px;
}

.status-label,
.stat-label {
  margin: 0 0 8px;
  color: var(--color-muted);
  font-size: 0.88rem;
}

.status-value,
.stat-value {
  margin: 0;
  font-weight: 700;
}

.progress-area {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
  margin: 20px 0 14px;
}

.spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid rgba(33, 150, 243, 0.18);
  border-top-color: var(--color-primary);
  animation: spin 0.9s linear infinite;
}

.progress-track {
  width: 100%;
  height: 14px;
  background: #dbeafe;
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #60a5fa, var(--color-primary), #4caf50);
  border-radius: inherit;
  transition: width 160ms ease;
}

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

.stat {
  padding: 16px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.button {
  border: none;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease, background 160ms ease;
}

.button:hover:not(:disabled),
.button:focus-visible:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.12);
  outline: none;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  box-shadow: none;
}

.button.primary {
  background: var(--color-primary);
  color: #fff;
}

.button.secondary {
  background: #e2e8f0;
  color: var(--color-text);
}

.button.tertiary {
  background: #f8fafc;
  color: var(--color-primary-dark);
  border: 1px solid rgba(33, 150, 243, 0.16);
}

.success-message {
  color: #166534;
  background: rgba(76, 175, 80, 0.08);
}

.warning-message {
  color: #92400e;
  background: rgba(245, 158, 11, 0.08);
}

.error-message {
  color: #991b1b;
  background: rgba(244, 67, 54, 0.08);
}

.hidden {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

@media (max-width: 640px) {
  .app-shell {
    padding: 20px 12px 32px;
  }

  .panel {
    padding: 22px;
    border-radius: 20px;
  }

  .drop-zone {
    min-height: 240px;
    padding: 20px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .button-row {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }
}
