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

body {
  font-family: system-ui, sans-serif;
  background: #f5f5f5;
  color: #1a1a1a;
  padding: 1.5rem;
}

main {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

h1 {
  font-size: 1.75rem;
}

h2 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

/* Form */
.add-song form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

label {
  font-size: 0.875rem;
  font-weight: 600;
}

input[type="text"] {
  padding: 0.5rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
  width: 100%;
}

input[type="text"]:focus {
  outline: 2px solid #4f6ef7;
  outline-offset: 1px;
  border-color: transparent;
}

button[type="submit"] {
  align-self: flex-start;
  padding: 0.5rem 1.25rem;
  background: #4f6ef7;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
}

button[type="submit"]:hover {
  background: #3a58e0;
}

/* Song list */
#songs {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

#songs li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font-size: 0.95rem;
}

.song-meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.song-artist {
  font-size: 0.8rem;
  color: #666;
}

button.remove {
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0 0.25rem;
}

button.remove:hover {
  color: #e53e3e;
}

#song-count {
  font-size: 0.85rem;
  color: #666;
  font-weight: normal;
}

/* Download controls */
.download-controls {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
}

.download-controls .field {
  flex-shrink: 0;
}

input[type="number"] {
  padding: 0.5rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
  width: 6rem;
}

input[type="number"]:focus {
  outline: 2px solid #4f6ef7;
  outline-offset: 1px;
  border-color: transparent;
}

input[type="number"].invalid {
  border-color: #e53e3e;
  outline: none;
}

.field-hint {
  font-size: 0.8rem;
  color: #888;
  margin-top: 0.2rem;
}

.field-hint.invalid {
  color: #e53e3e;
}

/* Preview button */
#preview-pdf {
  padding: 0.65rem 1.5rem;
  background: #fff;
  color: #4f6ef7;
  border: 1.5px solid #4f6ef7;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
}

#preview-pdf:hover:not(:disabled) {
  background: #eef1fe;
}

#preview-pdf:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Download button */
#download-pdf {
  padding: 0.65rem 1.5rem;
  background: #2d8a4e;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
}

#download-pdf:hover:not(:disabled) {
  background: #246b3e;
}

#download-pdf:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
