:root {
  --green: #3fb56f;
  --green-dim: rgba(63, 181, 111, 0.2);
}

* { box-sizing: border-box; }

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

body {
  min-height: 100dvh;
  background: linear-gradient(to bottom, #1e293b, #020617) fixed;
  color: #e2e8f0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  display: flex;
  flex-direction: column;
}

.wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 1rem;
}

.header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2.5rem;
  color: #e2e8f0;
}

.logo {
  width: 3rem;
  height: 3rem;
  color: var(--green);
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4));
}

.header h1 {
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0;
  text-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: min(600px, 92vw);
  margin-top: 2.5rem;
}

.row {
  display: flex;
  gap: 0.5rem;
}

input[type="text"] {
  border: 0;
  outline: none;
  background: #e2e2df;
  border-radius: 0.5rem;
  padding: 0.65rem 0.85rem;
  font-size: 1rem;
  color: #1e293b;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

input#url {
  flex: 1;
}

input#pages {
  width: 5.5rem;
  text-align: center;
}

input[type="text"]:focus {
  box-shadow: 0 0 0 2px var(--green), 0 10px 25px -5px var(--green-dim);
}

button#downloadBtn {
  border: 0;
  border-radius: 0.5rem;
  background: var(--green);
  color: #06210f;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.7rem 1rem;
  cursor: pointer;
  box-shadow: 0 10px 25px -5px var(--green-dim);
  transition: opacity 0.15s ease;
}

button#downloadBtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button#downloadBtn:not(:disabled):hover {
  opacity: 0.92;
}

.status {
  width: min(600px, 92vw);
  margin-top: 1.5rem;
}

.status-line {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: #cbd5e1;
  margin-bottom: 0.4rem;
}

.bar {
  height: 0.6rem;
  border-radius: 999px;
  background: #1e293b;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(to right, var(--green), #7ee2a0);
  transition: width 0.3s ease;
}

.detail {
  font-size: 0.8rem;
  color: #64748b;
  margin: 0.5rem 0 0;
  min-height: 1.1em;
}

.error {
  width: min(600px, 92vw);
  margin-top: 1rem;
  color: #f87171;
  font-size: 0.9rem;
}

.footer {
  text-align: center;
  color: #475569;
  font-size: 0.75rem;
  padding: 1rem;
}

.footer a {
  color: #64748b;
}

@media (max-width: 480px) {
  .header h1 {
    font-size: 1.4rem;
  }

  .logo {
    width: 2.25rem;
    height: 2.25rem;
  }

  .row {
    flex-direction: column;
  }

  input#pages {
    width: 100%;
  }
}
