:root {
  --bg: #101828;
  --card: #171f2f;
  --field: #1e293b;
  --field-border: #334155;
  --text: #ffffff;
  --muted: #94a3b8;
  --soft: #cbd5e1;
  --line: rgba(255, 255, 255, 0.04);
  --green: #00995d;
  --green-dark: #004e4c;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

.screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background-color: var(--bg);
  background-image: url("/assets/fundo.png");
  background-position: center;
  background-size: cover;
}

.screen.upload-screen {
  background-image: url("/assets/fundo-upload.png");
}

.card {
  width: min(100%, 500px);
  min-height: min(755px, calc(100vh - 40px));
  display: flex;
  flex-direction: column;
  padding: 15px 15px 25px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--card);
}

.upload-card {
  width: 600px;
  max-width: calc(100vw - 40px);
  height: min(755px, calc(100vh - 40px));
  min-height: min(755px, calc(100vh - 40px));
  padding: 15px 15px 25px;
  border-radius: 28px;
  overflow-y: auto;
}

.hidden {
  display: none;
}

.cloud-logo {
  width: clamp(150px, 28vh, 190px);
  height: auto;
  object-fit: contain;
  align-self: center;
}

.upload-logo {
  width: 180px;
  height: auto;
  margin-top: 58px;
  margin-bottom: 5px;
}

h1 {
  margin: 0;
  color: var(--text);
  font-size: 34px;
  font-weight: 700;
  line-height: 1.12;
  text-align: center;
}

.subtitle {
  margin: 6px 0 15px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

input,
select,
button {
  width: 100%;
  min-height: 52px;
  border-radius: 10px;
  font: inherit;
}

input,
select {
  border: 1px solid var(--field-border);
  background-color: var(--field);
  color: var(--text);
  padding: 14px;
  font-size: 14px;
  outline: none;
}

select {
  appearance: none;
  cursor: pointer;
  padding-right: 42px;
  background-image: url("/assets/chevron-down.svg");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px 16px;
}

input:focus,
select:focus {
  border: 2px solid var(--green);
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  border: 1px solid var(--field-border);
  box-shadow: 0 0 0 1000px var(--field) inset;
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  transition: background-color 9999s ease-in-out 0s;
}

input:autofill {
  border: 1px solid var(--field-border);
  box-shadow: 0 0 0 1000px var(--field) inset;
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
}

button {
  border: 0;
  background-color: var(--green);
  color: var(--text);
  padding: 14px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  background-color: var(--green-dark);
}

button:active {
  background-color: #047857;
}

button:disabled {
  background-color: var(--field-border);
  color: var(--muted);
  cursor: not-allowed;
}

.footer-logo {
  display: flex;
  justify-content: flex-end;
  margin-top: auto;
}

.footer-logo img {
  width: clamp(85px, 16vh, 110px);
  height: auto;
}

.topbar {
  display: flex;
  justify-content: flex-end;
  min-height: 32px;
}

.icon-button {
  width: 32px;
  min-height: 32px;
  padding: 6px;
  border-radius: 16px;
  background: transparent;
}

.icon-button:hover {
  background: rgba(255, 255, 255, 0.08);
}

.icon-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.drop-area {
  min-height: 115px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  padding: 16px;
  border: 1px solid var(--green);
  border-radius: 10px;
  background-color: rgba(15, 23, 42, 0.72);
  cursor: pointer;
  text-align: center;
}

.drop-area.drag-active,
.drop-area:hover {
  background-color: rgba(0, 153, 93, 0.1);
}

.drop-area input,
.file-actions input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.drop-area img {
  width: 34px;
  height: 34px;
  margin-bottom: 8px;
}

.drop-area span {
  color: #e2e8f0;
  font-size: 13px;
}

.drop-area strong {
  color: var(--green);
  font-size: 13px;
}

.file-actions {
  display: none;
}

.secondary-button {
  min-height: 42px;
  border: 1px solid var(--field-border);
  background: transparent;
  color: var(--soft);
  padding: 10px 12px;
}

.secondary-button:hover {
  border-color: var(--green);
  background: rgba(0, 153, 93, 0.1);
}

.path-label {
  min-height: 22px;
  margin: -10px 0 0;
  padding: 4px 6px;
  color: var(--soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 16px;
  font-size: 15px;
}

.progress-track {
  height: 20px;
  margin-top: 16px;
  overflow: hidden;
  border-radius: 10px;
  background: var(--field);
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  transition: width 180ms ease;
}

.status-text {
  min-height: 38px;
  margin: 12px 0 0;
  color: var(--soft);
  text-align: center;
  overflow-wrap: anywhere;
}

.upload-footer {
  padding-right: 5px;
}

.upload-card #uploadTitle {
  margin-bottom: 17px;
  font-size: 34px;
  line-height: 1.12;
}

.upload-card .form-stack {
  gap: 16px;
}

.upload-card select {
  min-height: 52px;
  padding: 14px 42px 14px 14px;
  font-size: 14px;
}

.upload-card #startButton {
  min-height: 52px;
  font-size: 14px;
}

.upload-card .path-label {
  min-height: 0;
  margin: 0;
  padding: 0 6px;
}

.upload-card .progress-header {
  margin-top: 16px;
  font-size: 15px;
}

.upload-card .progress-track {
  height: 20px;
  margin-top: 16px;
}

.upload-card .footer-logo img {
  width: 110px;
}

dialog {
  width: min(90vw, 420px);
  border: 1px solid var(--field-border);
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
  padding: 18px;
}

dialog::backdrop {
  background: rgba(2, 6, 23, 0.72);
}

dialog p {
  margin: 0 0 18px;
  color: var(--soft);
  /* A falha do lote vem em várias linhas (um arquivo por linha); sem isto o
     textContent colapsaria tudo num parágrafo só. */
  white-space: pre-line;
  overflow-wrap: anywhere;
  max-height: 50vh;
  overflow-y: auto;
}

dialog button {
  width: 70px;
  min-height: 50px;
  margin-left: auto;
  display: block;
}

@media (max-height: 750px) {
  .card:not(.upload-card) {
    gap: 0;
    padding-bottom: 15px;
  }

  .form-stack {
    gap: 10px;
  }

  .cloud-logo {
    width: 150px;
    height: 110px;
  }

  .upload-logo {
    width: 160px;
    height: auto;
    margin-top: 20px;
    margin-bottom: 5px;
  }

  .upload-card {
    padding-top: 15px;
    padding-bottom: 15px;
  }

  .upload-card #uploadTitle {
    margin-bottom: 18px;
  }

  .upload-card .form-stack {
    gap: 14px;
  }

  .drop-area {
    min-height: 115px;
  }

  .upload-card .path-label {
    min-height: 12px;
  }

  .upload-card .progress-header {
    margin-top: 14px;
  }

  .upload-card .progress-track {
    margin-top: 14px;
  }

  .status-text {
    min-height: 24px;
    margin-top: 10px;
  }
}

@media (max-width: 520px) {
  .screen {
    padding: 12px;
  }

  .card {
    min-height: calc(100vh - 24px);
    padding-inline: 12px;
  }
}
