:root {
  color-scheme: light;
  --bg: #eef1f4;
  --bg-accent: #e3e8ee;
  --surface: rgba(255, 255, 255, 0.96);
  --surface-strong: #ffffff;
  --text: #1f2933;
  --muted: #5f6b76;
  --line: rgba(31, 41, 51, 0.12);
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
  --button: #32485f;
  --button-hover: #24384d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Manrope', sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, var(--bg), var(--bg-accent));
}

.app-shell {
  width: min(1080px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 0.65rem 0 0.75rem;
}

.auth-card {
  max-width: 640px;
  margin: 3.5rem auto 0;
}

.auth-topline {
  justify-content: flex-start;
}

.login-form {
  display: grid;
  gap: 1rem;
  margin-top: 1.25rem;
}

.input-field {
  display: grid;
  gap: 0.45rem;
  font-weight: 700;
}

.input-field span {
  font-size: 0.92rem;
}

.input-field input {
  width: 100%;
  padding: 0.85rem 0.95rem;
  border: 1px solid rgba(31, 41, 51, 0.16);
  border-radius: 8px;
  font: inherit;
  color: var(--text);
  background: #ffffff;
  font-weight: normal;
}

.input-field input:focus {
  outline: 2px solid rgba(50, 72, 95, 0.18);
  outline-offset: 2px;
}

.form-message {
  margin: 0;
  padding: 0.8rem 0.95rem;
  border-radius: 8px;
  border: 1px solid rgba(146, 64, 14, 0.16);
  background: #fff7ed;
  color: #9a3412;
}

.hero-meta {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}

.juror-badge-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.juror-badge {
  display: inline-flex;
  align-items: center;
  min-height: 2.25rem;
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.secondary-button {
  appearance: none;
  border: 1px solid rgba(31, 41, 51, 0.14);
  border-radius: 8px;
  padding: 0.65rem 0.9rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  background: #ffffff;
  cursor: pointer;
}

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

.hero {
  padding: 1.25rem 1.4rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-topline {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
}

.hero h1 {
  margin: 0;
  font-family: 'Fraunces', serif;
  font-size: 2rem;
  line-height: 1.05;
}

.hero img {
  float: right;
  width: 78px;
}

.counter {
  font-size: 0.88rem;
  color: var(--muted);
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafc;
  cursor: pointer;
}

.difficulty-badge {
  font-size: 0.92rem;
  color: var(--text);
}

.difficulty-prefix {
  font-weight: 400;
}

.difficulty-value {
  font-weight: 700;
}

.instruction {
  margin: 1rem 0 0;
  font-size: 0.98rem;
  line-height: 1.5;
  color: var(--text);
}

.pair-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1.2rem;
}

.evaluation-layout {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1.1rem;
  align-items: start;
  min-height: calc(100vh - 2rem);
}

.evaluation-pair-grid {
  grid-template-columns: 1fr;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  width: clamp(300px, 31vw, 390px);
  margin-top: 0;
  height: calc(100vh - 2rem);
  min-height: calc(100vh - 2rem);
  max-height: calc(100vh - 2rem);
  gap: 0.7rem;
  justify-self: end;
}

.evaluation-shell {
  margin-top: 1.2rem;
  padding: 0.85rem 0.95rem;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.evaluation-panel {
  margin-top: 0;
  min-height: calc(100vh - 2rem);
  max-height: calc(100vh - 2rem);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.evaluation-heading {
  margin-bottom: 0.7rem;
}

.evaluation-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  width: 100%;
  margin-bottom: 1.2rem;
}

.evaluation-context .counter {
  margin-right: 0;
}

.evaluation-context .difficulty-badge {
  margin-right: auto;
}

.evaluation-context .juror-badge {
  margin-left: auto;
}

.evaluation-scroll-area {
  min-height: 0;
  overflow: auto;
  padding-right: 0.15rem;
}

.evaluation-heading h2 {
  margin: 0;
  font-family: 'Fraunces', serif;
  font-size: clamp(1.25rem, 2vw, 1.7rem);
}

.evaluation-form {
  display: grid;
  gap: 0.8rem;
}

.criterion-card {
	margin: 0;
	border: 0;
	/* border-radius: 8px; */
	background: #fbfcfd;
	border-bottom: 1px solid #b8b8b8;
	padding-bottom: 1em;
  transition: background-color 180ms ease, border-color 180ms ease;
}

.criterion-card:has(input:checked) {
  background: #bee5fc;
  border-bottom-color: #8ac8eb;
}

.criterion-title {
  margin: 0 0 0.35rem;
  font-family: 'Manrope', sans-serif;
  font-size: 1rem;
  font-weight: 800;
}

.criterion-description {
  margin: 0.15rem 0 0.7rem;
  color: var(--muted);
  line-height: 1.4;
  font-size: 0.86rem;
}

.criterion-description-value {
  display: inline-block;
  margin-left: 0.3rem;
  padding: 0.08rem 0.45rem;
  border: 1px solid var(--text);
  border-radius: 999px;
  font-weight: 700;
  color: var(--text);
}

.radio-group {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid rgba(31, 41, 51, 0.12);
  background: #ffffff;
  cursor: pointer;
  font-size: 0.88rem;
  transition: border-color 180ms ease, opacity 180ms ease;
}

.radio-group:has(input:checked) .radio-option {
  opacity: 0.6;
}

.radio-group:has(input:checked) .radio-option:has(input:checked) {
  opacity: 1;
  border-color: rgba(31, 41, 51, 1);
}

.radio-option input {
  accent-color: var(--button);
}

.observations-field {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.7rem;
  font-weight: normal;
}

.observations-field span {
  font-size: 0.84rem;
}

.observations-field textarea {
  width: 100%;
  resize: vertical;
  min-height: 4.2rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(31, 41, 51, 0.14);
  font: inherit;
  font-weight: normal;
  font-size: 0.9rem;
  color: var(--text);
  background: #ffffff;
}

.observations-field textarea:focus,
.radio-option:has(input:focus-visible) {
  outline: 3px solid rgba(31, 41, 51, 1);
  outline-offset: 2px;
}

.criterion-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.55rem;
}

.criterion-accept-button {
  appearance: none;
  border: 0;
  border-radius: 8px;
  padding: 0.65rem 1rem;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 800;
  color: #f8fafc;
  background: var(--button);
  cursor: pointer;
  transition: background 180ms ease;
}

.criterion-accept-button:hover {
  background: var(--button-hover);
}

.image-card {
  padding: 0.65rem;
  border-radius: 10px;
  background: var(--surface-strong);
  border: 1px solid rgba(31, 41, 51, 0.1);
  box-shadow: var(--shadow);
  transform: none;
  opacity: 1;
  animation: none;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 0;
  overflow: hidden;
}

.image-frame {
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid rgba(31, 41, 51, 0.08);
}

.image-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.image-card h2 {
  margin: 0.45rem 0 0;
  font-family: 'Manrope', sans-serif;
  font-size: clamp(0.9rem, 1.4vw, 1.05rem);
  font-weight: 800;
  text-transform: capitalize;
}

.image-card-title-meta {
  font-weight: 400;
  color: var(--muted);
}

.controls {
  display: flex;
  justify-content: center;
  margin-top: 0.9rem;
}

.controls-inline {
  gap: 0.7rem;
  justify-content: flex-end;
  margin-top: 0.8rem;
  padding-top: 0.2rem;
}

.previous-button,
.next-button {
  appearance: none;
  border-radius: 8px;
  padding: 0.85rem 1.3rem;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: none;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease;
}

.previous-button {
  border: 1px solid var(--button);
  color: var(--button);
  background: transparent;
}

.next-button:hover {
  background: var(--button-hover);
}

.next-button {
  border: 0;
  color: #f8fafc;
  background: var(--button);
}

.previous-button:hover {
  border-color: var(--button-hover);
  color: var(--button-hover);
  background: rgba(50, 72, 95, 0.06);
}

.previous-button:disabled,
.next-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  box-shadow: none;
}

.error-state {
  padding: 1.25rem;
  border-radius: 8px;
  background: #f5f7fa;
  border: 1px solid rgba(31, 41, 51, 0.14);
  color: var(--text);
}

@media (max-width: 780px) {
  .evaluation-layout {
    grid-template-columns: 1fr;
    min-height: auto;
  }

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

  .evaluation-pair-grid,
  .evaluation-panel {
    min-height: auto;
    max-height: none;
    height: auto;
  }

  .evaluation-scroll-area {
    overflow: visible;
  }

  .hero-meta {
    flex-direction: column;
  }

  .juror-badge-row {
    justify-content: flex-start;
  }

  .radio-group {
    grid-template-columns: 1fr;
  }

  .evaluation-heading {
    align-items: start;
    flex-direction: column;
  }

  .evaluation-context {
    flex-wrap: wrap;
  }

  .evaluation-context .juror-badge {
    margin-left: 0;
  }

  .app-shell {
    width: min(100% - 1rem, 1100px);
    padding-top: 0.65rem;
  }

  .hero,
  .image-card {
    border-radius: 10px;
  }

  .controls-inline {
    justify-content: center;
  }
}
