:root {
  --bg: #f7f4ef;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-strong: #ffffff;
  --text: #1f2430;
  --muted: #667085;
  --border: rgba(31, 36, 48, 0.1);
  --primary: #6d5efc;
  --primary-2: #8b7dff;
  --shadow: 0 18px 50px rgba(31, 36, 48, 0.12);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(109, 94, 252, 0.18), transparent 32%),
    radial-gradient(circle at top right, rgba(255, 167, 38, 0.18), transparent 26%),
    linear-gradient(180deg, #fffdf8, var(--bg));
  min-height: 100vh;
}

.app {
  width: min(100%, 960px);
  margin: 0 auto;
  padding: 20px 16px 40px;
}

.hero {
  padding: 24px 0 16px;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(109, 94, 252, 0.12);
  color: var(--primary);
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 3.5rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.hero p {
  margin: 12px 0 0;
  color: var(--muted);
  max-width: 58ch;
  font-size: 1rem;
  line-height: 1.6;
}

.panel {
  background: var(--surface);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: var(--radius-xl);
  padding: 18px;
  margin-top: 18px;
}

.panel__header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 16px;
}

.panel__header h2 {
  margin: 0;
  font-size: 1.2rem;
}

.panel__hint {
  color: var(--muted);
  font-size: 0.95rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

input,
select,
button {
  width: 100%;
  border-radius: var(--radius-md);
  font: inherit;
  min-height: 48px;
}

input,
select {
  border: 1px solid rgba(31, 36, 48, 0.14);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  padding: 0 14px;
  outline: none;
}

input::placeholder {
  color: #98a2b3;
}

input:focus,
select:focus {
  border-color: rgba(109, 94, 252, 0.5);
  box-shadow: 0 0 0 4px rgba(109, 94, 252, 0.12);
}

.btn {
  border: 0;
  cursor: pointer;
  font-weight: 800;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: white;
  box-shadow: 0 12px 25px rgba(109, 94, 252, 0.28);
}

.btn--primary:hover {
  opacity: 0.96;
}

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

.book-card {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 14px;
  align-items: start;
  background: var(--surface-strong);
  border: 1px solid rgba(31, 36, 48, 0.08);
  border-radius: 20px;
  padding: 12px;
  box-shadow: 0 10px 24px rgba(31, 36, 48, 0.06);
}

.book-card__image {
  width: 92px;
  height: 124px;
  object-fit: cover;
  border-radius: 16px;
  background: #f1f5f9;
  border: 1px solid rgba(31, 36, 48, 0.08);
}

.book-card__image--placeholder {
  display: grid;
  place-items: center;
  font-size: 2rem;
  color: var(--primary);
}

.book-card__content {
  min-width: 0;
}

.book-card__top {
  display: flex;
  gap: 10px;
  align-items: start;
  justify-content: space-between;
}

.book-card__top h3 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.3;
}

.badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: capitalize;
}

.badge--normal {
  background: rgba(15, 23, 42, 0.08);
  color: #334155;
}

.badge--alta {
  background: rgba(255, 152, 0, 0.14);
  color: #b45309;
}

.badge--primero {
  background: rgba(16, 185, 129, 0.14);
  color: #047857;
}

.book-card__meta {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.book-card__notes {
  margin: 10px 0 0;
  color: #344054;
  line-height: 1.5;
}

.empty-state {
  border: 1px dashed rgba(31, 36, 48, 0.14);
  border-radius: 20px;
  padding: 28px 18px;
  text-align: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
}

.empty-state__emoji {
  font-size: 2rem;
  margin-bottom: 8px;
}

.empty-state strong {
  display: block;
  color: var(--text);
  margin-bottom: 6px;
}

.empty-state p {
  margin: 0;
}

.empty-state--error {
  border-style: solid;
  background: rgba(255, 235, 235, 0.72);
}

@media (min-width: 640px) {
  .app {
    padding: 28px 20px 48px;
  }

  .hero {
    padding-top: 34px;
  }

  .panel {
    padding: 24px;
  }

  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-grid button {
    grid-column: 1 / -1;
    width: fit-content;
    min-width: 180px;
    justify-self: end;
  }

  .panel__header {
    flex-direction: row;
    justify-content: space-between;
    align-items: end;
  }
}

@media (max-width: 420px) {
  .book-card {
    grid-template-columns: 1fr;
  }

  .book-card__image {
    width: 100%;
    height: 200px;
  }

  .book-card__top {
    flex-direction: column;
  }
}