/* Hallmark · genre: atmospheric · macrostructure: none — functional 2-person tool, not a
   marketing/content page, so none of the 21 catalog shapes apply. Aurora's design system
   (dark canvas + two cool blooms, Geist, glow-on-hover, fade-only motion) is applied
   directly to the existing login screen + two-column tier board + modal chrome.
   theme: Aurora (no local spec file — built from the atmospheric genre's structural
   rules with a cool cyan/violet palette instead of the genre default warm amber)
   · enrichment: none · nav: N1a (2 genuine destinations: title + logout) · footer: none
   · contrast: pass (40–41) · tokens: pass (48) · mobile: pass (34, 49) */
/* Hallmark · pre-emit critique: P4 H4 E4 S4 R5 V5 */

* { box-sizing: border-box; }

html, body {
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(ellipse 60% 45% at 12% -5%, var(--glow-cyan), transparent 70%),
    radial-gradient(ellipse 55% 45% at 95% 105%, var(--glow-violet), transparent 70%),
    var(--color-paper);
  background-attachment: fixed;
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.5;
}

h1, h2 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
  overflow-wrap: anywhere;
  min-width: 0;
}

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
  border-radius: inherit;
}

/* ---------- login screen ---------- */

.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: var(--space-md);
}

.login-screen form {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  width: 100%;
  max-width: 22rem;
  background: var(--color-paper-2);
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-card);
  padding: var(--space-lg);
  box-shadow: 0 24px 48px -24px var(--scrim-ink-35);
}

.login-screen h1 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-2xs);
}

.field-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-ink-2);
  margin-bottom: var(--space-3xs);
}

.login-screen input {
  width: 100%;
}

/* ---------- shared form controls ---------- */

input[type="text"],
input[type="password"],
textarea,
select {
  width: 100%;
  height: 44px;
  padding: 0 var(--space-sm);
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-ink);
  background: var(--color-paper);
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-input);
  outline: 2px solid transparent;
  outline-offset: 1px;
  transition: background-color var(--dur-short) var(--ease-out), border-color var(--dur-short) var(--ease-out);
}

textarea {
  height: auto;
  min-height: 6rem;
  padding: var(--space-2xs) var(--space-sm);
  resize: vertical;
}

@media (hover: hover) and (pointer: fine) {
  input[type="text"]:hover,
  input[type="password"]:hover,
  textarea:hover,
  select:hover {
    background: var(--color-paper-2);
  }
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline-color: var(--color-focus);
  border-color: var(--color-ink-2);
}

input:disabled,
textarea:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ---------- top bar ---------- */

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-md) var(--space-sm);
  max-width: 90rem;
  margin-inline: auto;
}

.topbar h1 {
  font-size: var(--text-2xl);
}

/* ---------- tabs (mobile list switcher) ---------- */

.tabs {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
  padding: 0 var(--space-md) var(--space-sm);
  max-width: 90rem;
  margin-inline: auto;
}

.tab-btn {
  flex: 1;
  padding: var(--space-xs) var(--space-sm);
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-pill);
  background: var(--color-paper-2);
  color: var(--color-ink-2);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color var(--dur-short) var(--ease-out), color var(--dur-short) var(--ease-out);
}

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

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

/* ---------- the two lists ---------- */

.lists {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  padding: 0 var(--space-md) var(--space-2xl);
  max-width: 90rem;
  margin-inline: auto;
}

.tierlist {
  display: none;
  min-width: 0;
}
.tierlist.active { display: block; }

.tierlist h2 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-xs);
}

.tier-row {
  display: flex;
  gap: var(--space-2xs);
  margin-bottom: var(--space-2xs);
  align-items: stretch;
}

.tier-label {
  flex-shrink: 0;
  width: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-outlier);
  font-weight: 700;
  font-size: var(--text-lg);
  color: var(--color-accent-ink);
  border-radius: var(--radius-input);
}

.tier-s { background: var(--tier-s); }
.tier-a { background: var(--tier-a); }
.tier-b { background: var(--tier-b); }
.tier-c { background: var(--tier-c); }
.tier-d { background: var(--tier-d); }
.tier-e { background: var(--tier-e); }

.tier-items {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: var(--space-2xs);
  padding: var(--space-2xs);
  min-height: 4.5rem;
  background: var(--color-paper-2);
  border-radius: var(--radius-input);
  cursor: pointer;
}

/* ---------- item tile — elevate + glow on hover, no colour-mix, no press ---------- */

.item {
  width: 5.5rem;
  min-width: 0;
  cursor: pointer;
  text-align: center;
  background: var(--color-paper-3);
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-input);
  padding: var(--space-2xs);
  box-shadow: 0 6px 16px -10px var(--scrim-ink-18);
  transition: transform var(--dur-short) var(--ease-out),
              box-shadow var(--dur-short) var(--ease-out),
              border-color var(--dur-short) var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .item:hover {
    transform: translateY(-3px);
    border-color: var(--color-accent);
    box-shadow: 0 12px 28px -12px var(--glow-cyan);
  }
}

.item img {
  width: 100%;
  height: 3.5rem;
  object-fit: cover;
  border-radius: calc(var(--radius-input) - 4px);
  display: block;
}

.item-title {
  display: block;
  font-size: var(--text-xs);
  font-weight: 500;
  margin-top: var(--space-3xs);
  overflow-wrap: anywhere;
  min-width: 0;
}

.item-parent-label {
  display: block;
  font-family: var(--font-outlier);
  font-size: 0.6rem;
  letter-spacing: 0.02em;
  color: var(--color-ink-2);
  opacity: 0.8;
  margin-top: 2px;
}

/* ---------- modal ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  background: var(--scrim-ink-45);
}
.modal[hidden] { display: none; }

.modal-content {
  width: 100%;
  max-width: 26rem;
  max-height: min(85dvh, 40rem);
  overflow-y: auto;
  background: var(--color-paper-2);
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-card);
  padding: var(--space-lg);
  box-shadow: 0 32px 64px -24px var(--scrim-ink-35);
}

.modal-content h2 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-sm);
}

.modal-content label {
  display: block;
  margin-bottom: var(--space-sm);
}

.modal-content label > input,
.modal-content label > textarea,
.modal-content label > select {
  margin-top: var(--space-3xs);
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2xs);
  margin-top: var(--space-sm);
}

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

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

#item-variants-list {
  list-style: none;
  margin: 0 0 var(--space-sm);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
}

#item-variants-list button {
  width: 100%;
}

/* ---------- button system — flat fill + glow on hover, fade only, no bounce ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  height: 44px;
  padding: 0 var(--space-md);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--color-accent-ink);
  background: var(--color-accent);
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 0 0 0 var(--glow-cyan);
  transition: box-shadow var(--dur-short) var(--ease-out),
              background-color var(--dur-short) var(--ease-out),
              opacity var(--dur-micro) var(--ease-out);
}
.btn:hover {
  box-shadow: 0 8px 24px -6px var(--glow-cyan);
}
.btn:active {
  opacity: 0.85;
}
.btn:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
}

.btn--outline {
  background: transparent;
  color: var(--color-ink);
  border: 1px solid var(--color-rule);
}
.btn--outline:hover {
  border-color: var(--color-ink-2);
  box-shadow: none;
}
.btn--outline:active {
  opacity: 0.75;
}

.btn--coral {
  background: var(--color-error);
  color: var(--color-accent-ink);
  box-shadow: 0 0 0 0 var(--glow-error);
}
.btn--coral:hover {
  box-shadow: 0 8px 24px -6px var(--glow-error);
}

/* ---------- tooltip ---------- */

.tooltip {
  position: absolute;
  z-index: var(--z-tooltip);
  max-width: 14rem;
  padding: var(--space-2xs) var(--space-sm);
  background: var(--color-paper-3);
  border: 1px solid var(--color-rule);
  color: var(--color-ink);
  font-size: var(--text-xs);
  border-radius: var(--radius-input);
  pointer-events: none;
  opacity: 1;
  transition: opacity 150ms var(--ease-out);
}
.tooltip[hidden] { display: none; }

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 150ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 150ms !important;
  }
  .item:hover { transform: none; }
  .tab-btn:active { transform: none; }
}

/* ---------- responsive: side-by-side once there's room for both lists ---------- */

@media (min-width: 60rem) {
  .tabs { display: none; }
  .lists { flex-direction: row; align-items: flex-start; }
  .tierlist { display: block; flex: 1; }
}
