:root {
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef2ff;
  --bg: #f6f7f9;
  --card: #ffffff;
  --text: #1a1d23;
  --muted: #6b7280;
  --border: #e3e6ea;
  --border-strong: #cbd0d8;
  --ok: #16a34a;
  --ok-soft: #ecfdf3;
  --err: #dc2626;
  --err-soft: #fef2f2;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 28px rgba(16, 24, 40, .08);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

/* An explicit `display` rule otherwise overrides the [hidden] attribute. */
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  -webkit-font-smoothing: antialiased;
}

.card {
  width: 100%;
  max-width: 480px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 30px 22px;
}

/* Header */
.head { margin-bottom: 24px; }
.brand { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; }
.brand-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent);
}
.brand-name { font-weight: 700; letter-spacing: -.01em; font-size: 15px; }
.head h1 { margin: 0 0 6px; font-size: 22px; font-weight: 650; letter-spacing: -.02em; }
.sub { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }

/* Fields */
.field-label {
  display: block;
  font-size: 13px; font-weight: 600;
  margin: 18px 0 8px;
  color: var(--text);
}

/* Dropzone */
.dropzone {
  border: 1.5px dashed var(--border-strong);
  border-radius: 12px;
  background: #fbfcfd;
  padding: 26px 18px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  outline: none;
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--accent); background: var(--accent-soft); }
.dropzone.dragover { border-color: var(--accent); background: var(--accent-soft); }
.dropzone.filled { cursor: default; border-style: solid; border-color: var(--border); background: #fff; }

.drop-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--muted); }
.drop-icon { width: 30px; height: 30px; color: var(--accent); margin-bottom: 4px; }
.drop-primary { font-size: 14px; font-weight: 600; color: var(--text); }
.drop-secondary { font-size: 13px; }

.drop-filled { display: flex; align-items: center; gap: 12px; text-align: left; }
.file-icon { width: 30px; height: 30px; color: var(--accent); flex: none; }
.file-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.file-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-size { font-size: 12px; color: var(--muted); }
.file-clear {
  flex: none; border: none; background: #f0f2f5; color: var(--muted);
  width: 26px; height: 26px; border-radius: 50%; font-size: 18px; line-height: 1;
  cursor: pointer; transition: background .15s, color .15s;
}
.file-clear:hover { background: var(--err-soft); color: var(--err); }

/* URL input */
.url-input {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
.url-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.url-input::placeholder { color: #aeb4be; }

/* Validation */
.validation {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--err);
  background: var(--err-soft);
  border: 1px solid #fbd5d5;
  padding: 9px 12px;
  border-radius: 8px;
}

/* Progress */
.progress-wrap { margin-top: 20px; }
.progress-track { height: 8px; background: #eef0f3; border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; width: 0%; background: var(--accent); border-radius: 999px; transition: width .15s ease; }
.progress-meta { display: flex; justify-content: space-between; margin-top: 7px; font-size: 12px; color: var(--muted); }

/* Result */
.result { margin-top: 20px; padding: 12px 14px; border-radius: 10px; font-size: 14px; line-height: 1.45; }
.result.ok  { background: var(--ok-soft);  border: 1px solid #bbf7d0; color: #15803d; }
.result.err { background: var(--err-soft); border: 1px solid #fbd5d5; color: var(--err); }
.result .result-title { font-weight: 650; display: flex; align-items: center; gap: 7px; }
.result .result-detail { margin-top: 4px; font-size: 13px; opacity: .9; }
.result .check { width: 17px; height: 17px; flex: none; }

/* Submit */
.submit-btn {
  width: 100%;
  margin-top: 22px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 15px; font-weight: 600;
  padding: 13px;
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s, opacity .15s;
}
.submit-btn:hover:not(:disabled) { background: var(--accent-hover); }
.submit-btn:disabled { opacity: .55; cursor: not-allowed; }

/* Footer */
.foot { margin-top: 20px; }
.foot p { margin: 0; font-size: 12px; color: var(--muted); text-align: center; line-height: 1.5; }

@media (max-width: 520px) {
  .card { padding: 24px 20px 18px; }
}
