:root {
  --bg: #f3f6f8;
  --surface: #ffffff;
  --ink: #1a2b33;
  --muted: #5a6d76;
  --line: #d3dde3;
  --accent: #0b6e99;
  --accent-hover: #085578;
  --danger: #9b1c1c;
  --ok: #0f6b3a;
  --shadow: 0 1px 2px rgba(26, 43, 51, 0.06), 0 8px 24px rgba(26, 43, 51, 0.06);
  --radius: 10px;
  --font: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", "Consolas", "Menlo", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, #d9eef7 0%, transparent 55%),
    radial-gradient(900px 400px at 100% 0%, #e7f3ea 0%, transparent 50%),
    var(--bg);
}

.page {
  width: min(680px, calc(100% - 2rem));
  margin: 2.5rem auto 3rem;
}

.header h1 {
  margin: 0 0 0.5rem;
  font-size: 1.75rem;
  letter-spacing: -0.02em;
}

.header p {
  margin: 0 0 1.5rem;
  color: var(--muted);
  line-height: 1.5;
}

.form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.25rem 1.5rem;
  display: grid;
  gap: 1rem;
}

.field {
  margin: 0;
  padding: 0.85rem 1rem 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafcfd;
}

.field legend {
  padding: 0 0.35rem;
  font-size: 0.92rem;
  font-weight: 600;
}

.file-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.file-button {
  display: inline-block;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font-size: 0.92rem;
  font-weight: 600;
}

.file-label:hover .file-button,
.file-label:focus-within .file-button {
  border-color: var(--accent);
  color: var(--accent);
}

.file-name {
  color: var(--muted);
  font-size: 0.92rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filename-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

input[type="text"],
input[type="number"] {
  width: 100%;
  max-width: 16rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  background: #fff;
}

input[type="text"]:focus,
input[type="number"]:focus {
  outline: 2px solid rgba(11, 110, 153, 0.35);
  border-color: var(--accent);
}

.suffix {
  color: var(--muted);
  font-weight: 600;
}

.primary {
  justify-self: start;
  padding: 0.65rem 1.15rem;
  border: none;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.primary:disabled {
  opacity: 0.65;
  cursor: wait;
}

.status {
  margin-top: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.15rem 1.15rem;
}

.status h2 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.status-log {
  margin: 0;
  padding: 0.75rem 0.85rem;
  border-radius: 6px;
  background: #0f1c22;
  color: #d7e6ee;
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.45;
  white-space: pre-wrap;
  min-height: 4.5rem;
}

.status-log.is-error {
  background: #3a1212;
  color: #ffd7d7;
}

.status-log.is-ok {
  background: #0f2418;
  color: #d7f0e2;
}

.footer {
  margin-top: 1.25rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

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

@media (max-width: 520px) {
  .page {
    margin-top: 1.25rem;
  }

  .filename-row,
  input[type="number"] {
    max-width: none;
  }

  input[type="text"],
  input[type="number"] {
    max-width: none;
  }
}
