:root {
  --blue: #1a3a6c;
  --accent: #e87722;
  --ink: #1f2933;
  --muted: #667085;
  --line: #d0d5dd;
  --page: #f6f7f9;
  --surface: #ffffff;
  --error: #b42318;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  min-height: 44px;
  border: 0;
  cursor: pointer;
}

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

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(232, 119, 34, 0.38);
  outline-offset: 3px;
}

.brand-logo {
  display: block;
  width: 118px;
  height: auto;
}

.poc-label {
  margin: 0;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.login-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.login-shell {
  width: min(100%, 440px);
}

.login-panel {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.auth-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.brand-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.98rem;
  font-weight: 700;
}

.login-panel h1 {
  margin: 0 0 22px;
  color: var(--blue);
  font-size: 2rem;
  line-height: 1.15;
}

.login-form {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 700;
}

.field input {
  min-height: 48px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  font-size: 1rem;
}

.field input[aria-invalid="true"] {
  border-color: var(--error);
}

.login-error {
  display: none;
  margin: -2px 0 0;
  color: var(--error);
  font-size: 0.94rem;
  font-weight: 700;
}

.login-error.is-visible {
  display: block;
}

.primary-button,
.secondary-button,
.open-button {
  border-radius: 6px;
  font-weight: 800;
  transition: background 150ms ease, transform 150ms ease;
}

.primary-button {
  width: 100%;
  margin-top: 4px;
  background: var(--blue);
  color: #fff;
}

.secondary-button {
  padding: 0 16px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.primary-button:active,
.secondary-button:active,
.open-button:active {
  transform: scale(0.99);
}

.legal-note,
.legal-footer {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.legal-note {
  margin: 22px 0 0;
}

.app-layout {
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px clamp(18px, 4vw, 40px);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.topbar > div:first-child {
  display: flex;
  align-items: center;
  gap: 18px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.student-card {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.94rem;
}

.student-card span {
  display: block;
  color: var(--muted);
}

.avatar {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-weight: 900;
}

.shelf-main {
  padding: 32px clamp(18px, 4vw, 40px) 40px;
}

.shelf-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  max-width: 960px;
  margin-bottom: 24px;
}

.shelf-header h1 {
  margin: 0;
  font-size: 2rem;
  line-height: 1.15;
}

.shelf-header p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.books-grid {
  display: grid;
  max-width: 860px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.book-card {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 18px;
  align-items: center;
  min-height: 188px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #fff;
}

.cover-frame {
  width: 108px;
  aspect-ratio: 3 / 4;
}

.cover-frame img {
  width: 100%;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  object-fit: cover;
}

.book-type {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  text-transform: uppercase;
}

.book-card h2 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.2;
}

.publisher {
  margin: 6px 0 18px;
  color: var(--muted);
  font-weight: 700;
}

.open-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 112px;
  padding: 0 16px;
  background: var(--blue);
  color: #fff;
}

.launch-status {
  min-height: 24px;
  margin: 20px 0 0;
  color: var(--error);
  font-weight: 800;
}

.legal-footer {
  max-width: 860px;
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.legal-footer p {
  margin: 0 0 8px;
}

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

  .topbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .books-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .auth-header,
  .topbar > div:first-child,
  .topbar-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .login-panel {
    padding: 22px;
  }

  .book-card {
    grid-template-columns: 88px 1fr;
    gap: 14px;
    padding: 14px;
  }

  .cover-frame {
    width: 88px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
