:root {
  color-scheme: light;
  --bg: #f7f8f6;
  --surface: #ffffff;
  --text: #18201f;
  --muted: #64716e;
  --line: #d9e0dc;
  --accent: #087f73;
  --accent-strong: #075f57;
  --warm: #b46a24;
  --danger-bg: #fff2ef;
  --danger: #a23120;
  --shadow: 0 12px 34px rgba(24, 32, 31, 0.09);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

button,
input {
  font: inherit;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  padding: 0 18px;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  background: var(--accent-strong);
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.secondary-button {
  background: #eef3f1;
  color: var(--text);
  border: 1px solid var(--line);
}

.secondary-button:hover {
  background: #e2ebe7;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px clamp(16px, 4vw, 44px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 2;
}

.topbar h1,
.login-panel h1 {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2.1rem);
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--warm);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.lookup-shell {
  width: min(980px, 100%);
  margin: 0 auto;
  padding: 24px clamp(16px, 4vw, 32px) 48px;
}

.search-band {
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  padding: 0 14px;
}

input:focus {
  outline: 3px solid rgba(8, 127, 115, 0.18);
  border-color: var(--accent);
}

.status {
  min-height: 22px;
  margin: 12px 0 0;
  color: var(--muted);
}

.status.error,
.error-message {
  color: var(--danger);
  background: var(--danger-bg);
  border: 1px solid #f1c8c0;
  border-radius: 8px;
  padding: 10px 12px;
}

.results {
  display: grid;
  gap: 18px;
  margin-top: 22px;
}

.loading-card {
  min-height: 64px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.loading-spinner {
  width: 26px;
  height: 26px;
  border: 3px solid #d8e4df;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: loading-spin 0.8s linear infinite;
}

.loading-pulse {
  position: relative;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9efec;
}

.loading-pulse::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 38%;
  background: linear-gradient(90deg, transparent, rgba(180, 106, 36, 0.5), transparent);
  animation: loading-sweep 1.35s ease-in-out infinite;
}

.result-group,
.selection-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.result-group h2,
.selection-panel h2 {
  margin: 0 0 12px;
  font-size: 1.1rem;
}

.artist-name {
  margin: 18px 0 8px;
  color: var(--accent-strong);
  font-size: 1rem;
}

.album-block {
  border-left: 3px solid #d3e8e3;
  margin: 10px 0 14px;
  padding-left: 12px;
}

.result-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.song-list {
  margin-top: 8px;
  padding-left: 14px;
}

.result-button {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  background: #f9fbfa;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}

.result-button:hover {
  background: #edf6f3;
  border-color: #afd8ce;
}

.result-title {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.result-meta {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.92rem;
}

.provider-errors {
  display: grid;
  gap: 8px;
}

.provider-error {
  margin: 0;
  color: var(--danger);
}

.selection-panel {
  margin-top: 22px;
}

pre {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #16201e;
  color: #f5fffb;
  border-radius: 8px;
  padding: 14px;
}

.login-body {
  display: grid;
  place-items: center;
  padding: 20px;
}

.login-panel {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.login-form {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.login-form label {
  font-weight: 700;
}

.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;
}

@keyframes loading-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes loading-sweep {
  0% {
    transform: translateX(-120%);
  }

  100% {
    transform: translateX(280%);
  }
}

@media (max-width: 640px) {
  .topbar {
    align-items: flex-start;
  }

  .search-form {
    grid-template-columns: 1fr;
  }

  .result-button {
    align-items: flex-start;
    flex-direction: column;
  }

  .result-meta {
    flex: 0 1 auto;
  }
}
