/*
 * Seans web frontend — design tokens + primitives + app chrome.
 * Ported from seans-client (M3/M4/M5/M6) so web and desktop share one look.
 */

/* ---------------------------------------------------------------- tokens */

:root {
  color-scheme: light;

  --font-ui: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Code", Consolas, monospace;

  --text-xs: 12px;
  --text-sm: 14px;
  --text-md: 16px;
  --text-lg: 20px;
  --text-xl: 28px;
  --text-2xl: 36px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 999px;

  --focus-width: 2px;
  --focus-offset: 2px;

  --bg: #f6f7f9;
  --bg-elevated: #ffffff;
  --bg-sunken: #e9ecf1;
  --bg-hover: rgba(20, 22, 26, 0.06);
  --ink: #14161a;
  --ink-muted: #5c6370;
  --accent: #0f766e;
  --accent-ink: #ffffff;
  --accent-soft: rgba(15, 118, 110, 0.12);
  --danger: #d93025;
  --danger-ink: #ffffff;
  --border: #d8dce3;
  --overlay: rgba(20, 22, 26, 0.45);
  --shadow-1: 0 1px 2px rgba(20, 22, 26, 0.06), 0 4px 12px rgba(20, 22, 26, 0.06);
  --shadow-2: 0 8px 32px rgba(20, 22, 26, 0.16);
  --focus-color: var(--accent);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121418;
  --bg-elevated: #1b1e24;
  --bg-sunken: #0c0e12;
  --bg-hover: rgba(238, 241, 246, 0.08);
  --ink: #eef1f6;
  --ink-muted: #9aa3b2;
  --accent: #2dd4bf;
  --accent-ink: #042f2e;
  --accent-soft: rgba(45, 212, 191, 0.16);
  --danger: #f28b82;
  --danger-ink: #3b0a07;
  --border: #2c313a;
  --overlay: rgba(0, 0, 0, 0.55);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.35), 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-2: 0 8px 32px rgba(0, 0, 0, 0.5);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #121418;
    --bg-elevated: #1b1e24;
    --bg-sunken: #0c0e12;
    --bg-hover: rgba(238, 241, 246, 0.08);
    --ink: #eef1f6;
    --ink-muted: #9aa3b2;
    --accent: #2dd4bf;
    --accent-ink: #042f2e;
    --accent-soft: rgba(45, 212, 191, 0.16);
    --danger: #f28b82;
    --danger-ink: #3b0a07;
    --border: #2c313a;
    --overlay: rgba(0, 0, 0, 0.55);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.35), 0 4px 12px rgba(0, 0, 0, 0.35);
    --shadow-2: 0 8px 32px rgba(0, 0, 0, 0.5);
  }
}

html, body, #root {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: var(--text-md);
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

:focus-visible {
  outline: var(--focus-width) solid var(--focus-color);
  outline-offset: var(--focus-offset);
}

/* ------------------------------------------------------------- primitives */

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  border: 1px solid transparent;
  background: var(--bg-elevated);
  color: var(--ink);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 550;
  line-height: 1.3;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-sm {
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.06);
}

.btn-secondary {
  background: var(--bg-elevated);
  border-color: var(--border);
  color: var(--ink);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-hover);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--ink-muted);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--ink);
}

.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: var(--danger-ink);
}

.input-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  font-size: var(--text-sm);
}

.input-label {
  color: var(--ink);
  font-weight: 550;
}

.input {
  appearance: none;
  font: inherit;
  font-size: var(--text-sm);
  color: var(--ink);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  min-height: 40px;
  box-sizing: border-box;
}

.input::placeholder {
  color: var(--ink-muted);
}

.input-invalid {
  border-color: var(--danger);
}

.input-hint {
  color: var(--ink-muted);
  font-size: var(--text-xs);
}

.input-error {
  color: var(--danger);
  font-size: var(--text-xs);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1.4;
  border: 1px solid transparent;
  white-space: nowrap;
}

.badge-neutral {
  background: var(--bg-sunken);
  color: var(--ink-muted);
  border-color: var(--border);
}

.badge-accent {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: transparent;
}

.badge-danger {
  background: var(--danger);
  color: var(--danger-ink);
}

.spinner-wrap {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--ink-muted);
  font-size: var(--text-sm);
}

.spinner {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  border-radius: var(--radius-full);
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

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

.progress {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  width: 100%;
}

.progress-label {
  font-size: var(--text-xs);
  color: var(--ink-muted);
}

.progress-track {
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--bg-sunken);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--accent);
  transition: width 0.2s ease;
}

.state {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  border: 1px dashed var(--border);
  background: var(--bg-elevated);
  color: var(--ink-muted);
  font-size: var(--text-sm);
}

.state strong {
  color: var(--ink);
  font-size: var(--text-md);
}

.state p {
  margin: 0;
}

.state-actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-1);
}

.state-error {
  border-style: solid;
  border-color: var(--danger);
  color: var(--danger);
}

.state-error strong {
  color: var(--danger);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  z-index: 100;
}

.modal {
  background: var(--bg-elevated);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2);
  width: min(480px, 100%);
  max-height: min(80vh, 640px);
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-4) var(--space-2);
}

.modal-title {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 650;
}

.modal-body {
  padding: var(--space-2) var(--space-4) var(--space-4);
  overflow: auto;
}

.rating {
  display: inline-flex;
  gap: 2px;
  font-size: var(--text-sm);
  line-height: 1;
  color: var(--accent);
}

.rating-star {
  position: relative;
  display: inline-block;
}

.rating-star-empty {
  color: var(--border);
}

.rating-star-fill {
  position: absolute;
  inset: 0;
  overflow: hidden;
  white-space: nowrap;
  color: var(--accent);
}

.poster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 200px));
  gap: var(--space-4);
}

.poster-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  text-align: left;
  color: inherit;
  text-decoration: none;
  background: transparent;
  border: none;
  padding: 0;
  font: inherit;
  cursor: default;
  min-width: 0;
}

.poster-card-interactive {
  cursor: pointer;
}

.poster-art {
  aspect-ratio: 2 / 3;
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
}

.poster-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.poster-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--ink-muted);
  background: var(--bg-sunken);
  text-transform: uppercase;
}

.poster-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.poster-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.poster-subtitle {
  font-size: var(--text-xs);
  color: var(--ink-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.poster-rating {
  margin-top: 2px;
  font-size: var(--text-xs);
}

/* ------------------------------------------------------------- app chrome */

.app {
  height: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.app-shell {
  display: flex;
  min-height: 100%;
  width: 100%;
}

.app-nav {
  width: 220px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  box-sizing: border-box;
}

.nav-brand {
  padding: var(--space-4) var(--space-4) var(--space-2);
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--accent);
}

.nav-items {
  list-style: none;
  margin: 0;
  padding: var(--space-2);
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.nav-link {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-md);
  color: var(--ink-muted);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 550;
}

.nav-link:hover {
  background: var(--bg-hover);
  color: var(--ink);
}

.nav-link-selected {
  background: var(--accent-soft);
  color: var(--accent);
}

.nav-footer {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
  padding: var(--space-3);
  border-top: 1px solid var(--border);
}

.nav-theme {
  align-self: stretch;
  justify-content: flex-start;
}

.nav-user {
  display: block;
  max-width: 100%;
  padding: var(--space-1) var(--space-2);
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-user:hover {
  color: var(--accent);
}

.app-content {
  flex: 1;
  min-width: 0;
  overflow: auto;
  background: var(--bg);
}

.screen {
  max-width: 880px;
  margin: 0 auto;
  padding: var(--space-8) var(--space-6);
  width: 100%;
  box-sizing: border-box;
}

.screen-header h1 {
  margin: 0 0 var(--space-4);
  font-size: var(--text-xl);
  font-weight: 650;
  letter-spacing: -0.02em;
}

.screen-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.lede {
  margin: 0;
  color: var(--ink-muted);
  font-size: var(--text-md);
}

.hint {
  margin: var(--space-2) 0 0;
  color: var(--ink-muted);
  font-size: var(--text-sm);
}

.panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
}

/* ------------------------------------------------------------ search (M4) */

.search-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* JacRed attribution — required when search is powered by JacRed. */
.jacred-attribution {
  display: inline-flex;
  align-items: center;
  gap: 0.25em;
  margin: 0;
  color: var(--ink-muted);
  font-size: var(--text-xs);
  line-height: 1.4;
  white-space: nowrap;
  flex-shrink: 0;
}

.jacred-attribution-link {
  color: #c72d33;
  font-weight: 600;
  text-decoration: none;
}

.jacred-attribution-link:hover {
  text-decoration: underline;
}

/* Input + attribution on one line, vertically centered with the input. */
.search-input-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}

.search-input-row .input {
  flex: 1;
  min-width: 180px;
  width: auto;
}

/* Section heading with a small credit on the right. */
.section-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2) var(--space-4);
}

.section-title-row h3 {
  margin: 0;
}

/* ------------------------------------------------------------ media (M4) */

.media-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.media-detail {
  display: flex;
  gap: var(--space-6);
  align-items: flex-start;
}

.media-poster-col {
  width: 200px;
  flex-shrink: 0;
}

.media-info-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
}

.media-title {
  margin: 0;
  font-size: var(--text-xl);
  font-weight: 650;
}

.media-original-title {
  margin: 0;
  color: var(--ink-muted);
  font-size: var(--text-sm);
}

.media-meta {
  margin: 0;
  color: var(--ink-muted);
  font-size: var(--text-sm);
}

.media-rating {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.media-rating-text {
  font-size: var(--text-sm);
  color: var(--ink-muted);
}

.media-overview {
  margin: 0;
  color: var(--ink);
  font-size: var(--text-md);
  line-height: 1.55;
  white-space: pre-wrap;
}

.media-reviews {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.media-reviews h3,
.media-releases h3 {
  margin: 0;
  font-size: var(--text-lg);
}

/* ---------------------------------------------------------- reviews (M4) */

.review-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.review-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.review-item-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.review-score-text {
  font-size: var(--text-sm);
  color: var(--ink-muted);
}

.review-date {
  margin-left: auto;
  font-size: var(--text-xs);
  color: var(--ink-muted);
}

.review-text {
  margin: 0;
  font-size: var(--text-sm);
  line-height: 1.5;
  white-space: pre-wrap;
}

.review-form-title {
  margin: 0;
  font-size: var(--text-lg);
}

.score-fieldset {
  border: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.score-fieldset legend {
  font-size: var(--text-sm);
  font-weight: 550;
  padding: 0;
}

.score-picker {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.score-btn {
  appearance: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--ink);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 550;
  cursor: pointer;
}

.score-btn:hover:not(:disabled) {
  background: var(--bg-hover);
}

.score-btn-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.score-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.review-textarea {
  min-height: 88px;
  resize: vertical;
  width: 100%;
  max-width: 560px;
}

/* ---------------------------------------------------------- releases (M5) */

.media-releases {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.release-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.release-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: flex-end;
}

.release-filter-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  flex: 1 1 260px;
  min-width: 220px;
}

.release-filter {
  min-width: 200px;
  flex: 1;
}

.release-sort {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.release-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.release-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.release-table th,
.release-table td {
  padding: var(--space-2) var(--space-3);
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.release-table th {
  background: var(--bg-elevated);
  color: var(--ink-muted);
  font-weight: 600;
  position: sticky;
  top: 0;
}

.release-title {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.release-row {
  cursor: pointer;
}

.release-row:hover {
  background: var(--bg-hover);
}

.release-row-selected {
  background: var(--accent-soft);
}

.release-feedback {
  margin: 0;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: var(--text-sm);
}

.release-feedback-error {
  background: transparent;
  color: var(--danger);
}

.release-confirm {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.release-confirm-actions {
  display: flex;
  gap: var(--space-2);
}

/* ------------------------------------------------------------- tasks (M5) */

.task-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.task-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.task-item-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.task-stage {
  font-size: var(--text-sm);
  color: var(--ink-muted);
}

.task-date {
  margin-left: auto;
  font-size: var(--text-xs);
  color: var(--ink-muted);
}

.task-item-meta {
  font-size: var(--text-sm);
  color: var(--ink-muted);
}

.task-error {
  margin: 0;
  color: var(--danger);
  font-size: var(--text-sm);
}

.task-item-actions {
  display: flex;
  gap: var(--space-2);
}

/* ----------------------------------------------------------- library (M6) */

.library-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.library-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.library-item-header {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
}

.library-item-poster {
  width: 96px;
  flex-shrink: 0;
}

.library-item-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
  flex: 1;
}

.library-item-title {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 650;
}

.library-item-meta {
  margin: 0;
  color: var(--ink-muted);
  font-size: var(--text-sm);
}

.library-item-badges {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.library-item-actions {
  display: flex;
  gap: var(--space-2);
}

.library-files {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  border-top: 1px solid var(--border);
  padding-top: var(--space-3);
}

.library-file {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border);
}

.library-file:last-child {
  border-bottom: none;
}

.library-file-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  justify-content: space-between;
}

.library-file-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2);
  min-width: 0;
}

.library-file-episode {
  font-size: var(--text-sm);
  color: var(--ink-muted);
  white-space: nowrap;
}

.library-file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 42ch;
}

.library-file-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--ink-muted);
  font-size: var(--text-sm);
  white-space: nowrap;
}

.library-file-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

/* --------------------------------------------------------------- history */

.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.history-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
}

.history-row:last-child {
  border-bottom: none;
}

.history-row-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  justify-content: space-between;
}

.history-row-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.history-row-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 42ch;
}

.history-row-meta {
  color: var(--ink-muted);
  font-size: var(--text-sm);
  white-space: nowrap;
}

.history-row-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

/* ---------------------------------------------------------------- auth */

.auth-screen {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
}

.auth-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  padding: var(--space-8) var(--space-6);
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.auth-logo {
  text-align: center;
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--accent);
}

.auth-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
}

.auth-tab {
  flex: 1;
  padding: 10px 0;
  text-align: center;
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: 550;
  color: var(--ink-muted);
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  transition: color 0.2s, border-color 0.2s;
}

.auth-tab.active {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

.auth-form {
  display: none;
  flex-direction: column;
  gap: var(--space-4);
}

.auth-form.active {
  display: flex;
}

.auth-form label {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  font-size: var(--text-sm);
  color: var(--ink-muted);
}

.auth-message {
  text-align: center;
  font-size: var(--text-sm);
  min-height: 20px;
}

.auth-message.error {
  color: var(--danger);
}

.auth-message.success {
  color: var(--accent);
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 720px) {
  .app-shell {
    flex-direction: column;
  }

  .app-nav {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .nav-items {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .media-detail {
    flex-direction: column;
  }

  .media-poster-col {
    width: 160px;
  }
}
