:root {
  color-scheme: light;
  --ink: #18222b;
  --muted: #66727c;
  --line: #d7dde2;
  --surface: #ffffff;
  --soft: #f3f6f7;
  --green: #126b52;
  --green-dark: #0b513d;
  --red: #b42318;
  --amber: #d79224;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: #eef2f3;
  color: var(--ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  letter-spacing: 0;
}

button, input { font: inherit; }

.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 5vw, 72px);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; }

.brand-mark {
  width: 52px;
  height: 52px;
  display: inline-grid;
  place-items: center;
  background: var(--green);
  color: white;
  border-radius: 6px;
  font-weight: 800;
  font-size: 18px;
}

.brand-mark.small { width: 36px; height: 36px; font-size: 13px; }

.workspace {
  width: min(880px, calc(100% - 32px));
  margin: 0 auto;
  padding: 64px 0 40px;
}

.intro { margin-bottom: 28px; }
.eyebrow { margin: 0 0 8px; color: var(--green); font-size: 13px; font-weight: 800; text-transform: uppercase; }
h1 { margin: 0 0 14px; font-size: clamp(30px, 5vw, 48px); line-height: 1.08; letter-spacing: 0; }
.intro p:last-child { max-width: 700px; margin: 0; color: var(--muted); line-height: 1.6; }

.converter {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.drop-zone {
  min-height: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 30px;
  border: 2px dashed #aeb8bf;
  border-radius: 6px;
  background: var(--soft);
  cursor: pointer;
  text-align: center;
  transition: border-color .18s, background .18s;
}

.drop-zone:hover, .drop-zone:focus-visible, .drop-zone.dragging { border-color: var(--green); background: #e9f4ef; outline: none; }
.drop-zone.disabled { pointer-events: none; opacity: .65; }
.drop-zone span:last-child { color: var(--muted); font-size: 14px; }
.upload-icon { color: var(--green); font-size: 36px; line-height: 1; }

.file-list { display: grid; gap: 8px; margin-top: 16px; }
.file-list:empty { display: none; }
.file-row {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.pdf-badge { padding: 5px 7px; border-radius: 4px; background: #fde9e7; color: var(--red); font-size: 11px; font-weight: 800; }
.file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.file-size { color: var(--muted); font-size: 13px; }

.actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.primary-button, .secondary-button {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
}
.primary-button { background: var(--green); color: white; }
.primary-button:hover:not(:disabled) { background: var(--green-dark); }
.secondary-button { background: white; border-color: var(--line); color: var(--ink); }
button:disabled { cursor: not-allowed; opacity: .5; }

.icon-button {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  cursor: pointer;
}

.spinner { display: none; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.5); border-top-color: white; border-radius: 50%; animation: spin .8s linear infinite; }
.processing .primary-button { display: inline-flex; align-items: center; gap: 9px; opacity: 1; }
.processing .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.process-strip { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 22px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.process-strip div { display: flex; align-items: center; gap: 10px; padding: 18px 12px; font-size: 14px; }
.process-strip span { color: var(--amber); font-weight: 800; }

.alert { margin: 16px 0; padding: 13px 15px; border-left: 4px solid var(--red); background: #fff0ef; color: #7a271a; }
footer { padding: 16px; color: var(--muted); font-size: 12px; text-align: center; }

.login-page { display: grid; min-height: 100vh; place-items: center; padding: 20px; }
.login-shell { width: min(440px, 100%); }
.login-panel { padding: 38px; background: white; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 16px 46px rgba(24,34,43,.10); }
.login-panel h1 { margin-top: 18px; font-size: 32px; }
.muted { color: var(--muted); }
.login-form { display: grid; gap: 10px; margin-top: 24px; }
.login-form label { font-size: 14px; font-weight: 700; }
.password-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.password-row input { min-width: 0; height: 44px; padding: 0 12px; border: 1px solid #9da9b1; border-radius: 6px; }
.password-row input:focus { border-color: var(--green); outline: 3px solid rgba(18,107,82,.15); }
.login-form .primary-button { margin-top: 8px; }

@media (max-width: 640px) {
  .workspace { padding-top: 38px; }
  .converter { padding: 14px; }
  .drop-zone { min-height: 190px; padding: 20px; }
  .process-strip { grid-template-columns: 1fr; }
  .process-strip div + div { border-top: 1px solid var(--line); }
  .actions { display: grid; grid-template-columns: 1fr 1fr; }
  .login-panel { padding: 28px 22px; }
}

