:root {
  --bg: #08080b;
  --card: #101017;
  --card-2: #16161f;
  --line: #23232e;
  --text: #eceaf3;
  --muted: #8a879a;
  --accent: #7c5cff;
  --accent-soft: rgba(124, 92, 255, 0.12);
  --ok: #3ddc97;
  --err: #ff5c7a;
  --radius: 18px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 32px 20px;
  background: var(--bg);
  background-image:
    radial-gradient(60rem 40rem at 50% -18%, rgba(124, 92, 255, 0.16), transparent 65%),
    radial-gradient(40rem 30rem at 88% 108%, rgba(61, 220, 151, 0.07), transparent 60%);
  color: var(--text);
  font: 400 16px/1.55 "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* --- Карточка --- */

.card {
  width: 100%;
  max-width: 460px;
  padding: 34px 30px 30px;
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: 0 24px 70px -20px rgba(0, 0, 0, 0.8);
}

.head {
  text-align: center;
  margin-bottom: 26px;
}

.logo {
  margin: 0;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.logo span { color: var(--accent); }

.tagline {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

/* Обязательно: display:flex выше перебивает браузерное скрытие по [hidden],
   и без этого правила все экраны показывались бы разом. */
.stage[hidden] { display: none; }

/* --- Зона загрузки --- */

.drop {
  width: 100%;
  padding: 42px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: var(--accent-soft);
  border: 1.5px dashed rgba(124, 92, 255, 0.4);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: center;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.drop:hover,
.drop:focus-visible,
.drop.over {
  background: rgba(124, 92, 255, 0.2);
  border-color: var(--accent);
  outline: none;
  transform: translateY(-2px);
}

.drop-icon {
  width: 40px;
  height: 40px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.drop-title {
  font-size: 17px;
  font-weight: 600;
}

.drop-hint {
  font-size: 13px;
  color: var(--muted);
}

/* --- Обработка --- */

.spinner {
  width: 38px;
  height: 38px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 2.4s; }
  .drop { transition: none; }
}

.filename {
  max-width: 100%;
  font-size: 14px;
  font-weight: 500;
  overflow-wrap: anywhere;
  text-align: center;
}

.status {
  font-size: 14px;
  color: var(--muted);
  text-align: center;
}

.status-error { color: var(--err); }

.meta {
  font-size: 13px;
  color: var(--muted);
}

/* --- Иконки результата --- */

.ok, .err {
  width: 44px;
  height: 44px;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ok { stroke: var(--ok); }
.err { stroke: var(--err); }

/* --- Кнопки --- */

.btn {
  width: 100%;
  padding: 14px 20px;
  font: inherit;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: 14px;
  cursor: pointer;
  transition: filter 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

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

.btn-primary {
  margin-top: 4px;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 26px -10px rgba(124, 92, 255, 0.9);
}

.btn-primary:hover { filter: brightness(1.12); }

.btn-ghost {
  padding: 11px 20px;
  background: transparent;
  border-color: var(--line);
  color: var(--muted);
  font-weight: 500;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

/* --- Инструкция после патча --- */

.rules {
  width: 100%;
  margin: 4px 0;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: left;
  font-size: 13.5px;
}

.rules-title {
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--accent);
}

.rules-title + .rules-title { margin-top: 16px; }

.rules-lead, .rules-note {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.rules-lead a { color: var(--text); }

.rules-list {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.rules-list li { margin-bottom: 3px; }

.rules-list li::marker { color: var(--err); }

.foot {
  max-width: 460px;
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 420px) {
  .card { padding: 26px 20px 22px; }
  .drop { padding: 34px 16px; }
}

/* --- Вход и плашка пользователя --- */

.auth-lead {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.auth-wait {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

.auth-wait[hidden] { display: none; }

.userbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 13px;
}

.userbar[hidden] { display: none; }

.userbar-name { font-weight: 600; }

.userbar-quota {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
