*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, sans-serif;
  background: #f3f4f6;
  color: #111827;
}

/* ── Center page (blocked, landing, done) ── */
.center-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.blocked-card, .landing-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
  padding: 2rem 1.5rem;
  max-width: 400px;
  width: 100%;
  text-align: center;
}

.blocked-icon, .landing-logo {
  font-size: 3rem;
  margin-bottom: .75rem;
}

.blocked-card h1, .landing-card h1 {
  font-size: 1.4rem;
  margin: 0 0 .75rem;
}

.blocked-card p, .landing-card p {
  color: #6b7280;
  font-size: .95rem;
  line-height: 1.5;
}

.evaluator-info {
  background: #f9fafb;
  border-radius: 8px;
  padding: .75rem 1rem;
  margin: 1rem 0;
}

.evaluator-name {
  font-size: 1.05rem;
  font-weight: 600;
  color: #111827;
  margin: 0 0 .2rem;
}

.evaluator-position {
  font-size: .85rem;
  color: #6b7280;
  margin: 0 0 .5rem;
}

.landing-desc {
  font-size: .9rem;
  color: #4b5563;
  margin: 1rem 0 1.5rem;
  line-height: 1.6;
}

/* ── Badges ── */
.badge {
  display: inline-block;
  padding: .2rem .65rem;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 600;
}
.badge-tech { background: #dbeafe; color: #1e40af; }
.badge-non_tech { background: #fce7f3; color: #9d174d; }

/* ── Buttons ── */
.btn {
  display: inline-block;
  padding: .65rem 1.4rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: .95rem;
  font-weight: 600;
  text-decoration: none;
  transition: opacity .15s;
  min-height: 48px;
  line-height: 1.3;
  vertical-align: middle;
}
.btn:active { opacity: .8; }
.btn-primary { background: #1e3a5f; color: #fff; }
.btn-secondary { background: #e5e7eb; color: #374151; }
.btn-large { padding: .85rem 2rem; font-size: 1.05rem; width: 100%; display: block; }

/* ── Form page ── */
.form-page {
  min-height: 100vh;
  padding-bottom: 80px;
}

.form-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  padding: 0;
}

.progress-bar-wrap {
  height: 4px;
  background: #e5e7eb;
}

.progress-bar {
  height: 4px;
  background: #1e3a5f;
  transition: width .3s ease;
}

.progress-label {
  text-align: center;
  font-size: .85rem;
  font-weight: 600;
  color: #6b7280;
  padding: .4rem 1rem;
}

.form-main {
  padding: 1rem 1rem 2rem;
  max-width: 540px;
  margin: 0 auto;
}

.team-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0 0 .25rem;
  color: #111827;
}

.evaluator-hint {
  font-size: .85rem;
  color: #9ca3af;
  margin: 0 0 1.25rem;
}

/* ── Criterion blocks ── */
.criterion-block {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: .75rem;
}

.criterion-block.has-error {
  border-color: #ef4444;
  background: #fff5f5;
}

.criterion-label {
  display: block;
  font-size: .95rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: .5rem;
  line-height: 1.4;
}

.criterion-error {
  font-size: .82rem;
  color: #ef4444;
  margin-bottom: .4rem;
}

.score-input-wrap {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.score-input {
  width: 80px;
  padding: .55rem .75rem;
  border: 2px solid #d1d5db;
  border-radius: 8px;
  font-size: 1.2rem;
  font-weight: 700;
  text-align: center;
  -moz-appearance: textfield;
}

.score-input:focus {
  outline: none;
  border-color: #1e3a5f;
}

.score-input::-webkit-inner-spin-button,
.score-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
}

.score-hint {
  font-size: .8rem;
  color: #9ca3af;
}

.repo-link-readonly {
  display: block;
  padding: .55rem .75rem;
  background: #F5F6FB;
  border: 1px solid #E8EBF2;
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .85rem;
  word-break: break-all;
  color: #1d4ed8;
  text-decoration: none;
  margin-bottom: .35rem;
  line-height: 1.4;
}
.repo-link-readonly:hover { background: #EEF2FF; border-color: #C7D2FE; }
.repo-link-readonly.empty { color: #9ca3af; font-style: italic; font-family: inherit; }

.comment-textarea {
  width: 100%;
  padding: .65rem .85rem;
  border: 2px solid #d1d5db;
  border-radius: 8px;
  font-size: .92rem;
  font-family: inherit;
  resize: vertical;
  min-height: 70px;
  box-sizing: border-box;
  margin-bottom: .35rem;
  line-height: 1.45;
}
.comment-textarea:focus {
  outline: none;
  border-color: #5B3DF5;
  box-shadow: 0 0 0 3px rgba(91,61,245,.12);
}

/* ── Sticky footer ── */
.form-footer-sticky {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1px solid #e5e7eb;
  padding: .75rem 1rem;
  display: flex;
  gap: .5rem;
  justify-content: flex-end;
  z-index: 100;
}

.form-footer-sticky .btn {
  min-width: 120px;
}

/* ── Menu page ── */
.menu-page {
  min-height: 100vh;
  padding-bottom: 2rem;
  background: #f3f4f6;
}

.menu-header {
  background: #fff;
  padding: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid #e5e7eb;
}

.menu-evaluator {
  margin-bottom: .75rem;
}

.menu-name {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 .15rem;
  color: #111827;
}

.menu-position {
  font-size: .8rem;
  color: #6b7280;
  margin: 0;
}

.menu-progress-block {
  background: #f9fafb;
  border-radius: 8px;
  padding: .55rem .75rem;
}

.menu-progress-text {
  font-size: .85rem;
  color: #374151;
  margin-bottom: .35rem;
}

.menu-progress-bar {
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
}

.menu-progress-bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #1e3a5f, #10b981);
  transition: width .3s ease;
}

.menu-banner-success {
  background: #d1fae5;
  border: 1px solid #6ee7b7;
  color: #065f46;
  border-radius: 10px;
  padding: 1rem;
  margin: 1rem;
  font-size: .95rem;
  font-weight: 500;
}

.menu-continue-btn {
  display: block;
  background: #1e3a5f;
  color: #fff;
  text-decoration: none;
  padding: .85rem 1rem;
  margin: 1rem;
  border-radius: 10px;
  text-align: center;
  font-weight: 600;
  font-size: 1rem;
  box-shadow: 0 2px 6px rgba(30,58,95,.25);
}
.menu-continue-btn:active { opacity: .8; }

.menu-list {
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: .75rem .9rem;
  text-decoration: none;
  color: inherit;
  transition: transform .1s;
}
.menu-item:active { transform: scale(.98); }

.menu-item-done { border-color: #6ee7b7; background: #f0fdf4; }
.menu-item-partial { border-color: #fcd34d; background: #fffbeb; }
.menu-item-empty { background: #fff; }

.menu-item-num {
  font-size: .9rem;
  font-weight: 700;
  color: #6b7280;
  min-width: 32px;
  text-align: center;
}
.menu-item-done .menu-item-num { color: #059669; }
.menu-item-partial .menu-item-num { color: #d97706; }

.menu-item-body { flex: 1; min-width: 0; }

.menu-item-name {
  font-size: .95rem;
  font-weight: 600;
  color: #111827;
  margin-bottom: .25rem;
  word-break: break-word;
}

.menu-item-meta {
  font-size: .78rem;
}

.chip {
  display: inline-block;
  padding: .15rem .55rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
}
.chip-done { background: #d1fae5; color: #065f46; }
.chip-partial { background: #fef3c7; color: #92400e; }
.chip-empty { background: #e5e7eb; color: #6b7280; }

.menu-item-arrow {
  color: #9ca3af;
  font-size: 1.5rem;
  font-weight: 300;
}

/* ── Team context card on form ── */
.team-context-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: .85rem 1rem;
  margin-bottom: .85rem;
}
.ctx-block { margin-bottom: .65rem; }
.ctx-block:last-child { margin-bottom: 0; }
.ctx-label {
  font-size: .72rem;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: .25rem;
}
.ctx-members {
  margin: 0;
  padding-left: 1.1rem;
  font-size: .88rem;
  color: #374151;
}
.ctx-members li { margin-bottom: 1px; }
.ctx-case {
  background: #fffbeb;
  border-left: 3px solid #f59e0b;
  padding: .45rem .65rem;
  border-radius: 4px;
  font-size: .9rem;
  color: #78350f;
}

.repo-input {
  width: 100%;
  padding: .55rem .75rem;
  border: 2px solid #d1d5db;
  border-radius: 8px;
  font-size: .92rem;
  margin-bottom: .35rem;
  box-sizing: border-box;
  font-family: inherit;
}
.repo-input:focus { outline: none; border-color: #1e3a5f; }

/* ── Form: back-to-menu link in header ── */
.form-back-link {
  display: block;
  text-align: center;
  font-size: .8rem;
  color: #1e3a5f;
  text-decoration: none;
  padding: .35rem;
  border-bottom: 1px solid #e5e7eb;
  background: #f9fafb;
}
.form-back-link:active { background: #e5e7eb; }

/* ── Error banner ── */
.error-banner {
  background: #fee2e2;
  border: 1px solid #fca5a5;
  color: #991b1b;
  border-radius: 8px;
  padding: .65rem 1rem;
  font-size: .9rem;
  margin-bottom: 1rem;
}
