/* ============================================================
   Just Yukti – ISO 14971 Analyzer
   Brand: Red #C0392B | Black #000 | Dark Grey #3D3D3D
          Mid Grey #6B6B6B | Light Grey #F2F2F2
   ============================================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
}

body {
  font-family: 'Montserrat', Arial, sans-serif;
  color: #3D3D3D;
  background: #ffffff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: #C0392B;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ── Navbar ─────────────────────────────────────────────── */
.navbar {
  background: #ffffff;
  border-bottom: 2px solid #C0392B;
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0.6rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-brand {
  display: flex;
  align-items: center;
}

.navbar-logo {
  height: 36px;
  width: auto;
}

.navbar-user {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.navbar-email {
  font-size: 0.85rem;
  color: #6B6B6B;
}

/* ── Main content ───────────────────────────────────────── */
.main-content {
  flex: 1;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* ── Footer ─────────────────────────────────────────────── */
.footer {
  background: #F2F2F2;
  border-top: 1px solid #ddd;
  text-align: center;
  padding: 1rem;
  font-size: 0.8rem;
  color: #6B6B6B;
}

.footer a {
  color: #6B6B6B;
}

/* ── Alerts ─────────────────────────────────────────────── */
.alert {
  padding: 0.75rem 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.alert-error {
  background: #fdecea;
  border-left: 4px solid #C0392B;
  color: #C0392B;
}

.alert-success {
  background: #eafaf1;
  border-left: 4px solid #27AE60;
  color: #27AE60;
}

.alert-info {
  background: #eaf4fb;
  border-left: 4px solid #2980B9;
  color: #2980B9;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 0.6rem 1.4rem;
  border-radius: 4px;
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.15s ease;
  text-align: center;
}

.btn-primary {
  background: #C0392B;
  color: #ffffff;
}

.btn-primary:hover {
  background: #a93226;
  text-decoration: none;
  color: #ffffff;
}

.btn-primary:disabled {
  background: #e08070;
  cursor: not-allowed;
}

.btn-outline {
  background: transparent;
  color: #C0392B;
  border: 2px solid #C0392B;
}

.btn-outline:hover {
  background: #C0392B;
  color: #ffffff;
  text-decoration: none;
}

.btn-sm {
  padding: 0.35rem 0.9rem;
  font-size: 0.8rem;
}

/* ── Forms ───────────────────────────────────────────────── */
.form-group {
  margin-bottom: 1.25rem;
}

label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
  color: #3D3D3D;
}

input[type="text"],
input[type="email"],
select,
textarea {
  width: 100%;
  padding: 0.55rem 0.8rem;
  border: 1px solid #6B6B6B;
  border-radius: 4px;
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 0.9rem;
  color: #3D3D3D;
  background: #ffffff;
  transition: border-color 0.15s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #C0392B;
}

textarea {
  resize: vertical;
  min-height: 90px;
}

.char-counter {
  font-size: 0.75rem;
  color: #6B6B6B;
  text-align: right;
  margin-top: 0.2rem;
}

.char-counter.over-limit {
  color: #C0392B;
}

/* Radio group */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.radio-card {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.75rem 1rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.radio-card:hover {
  border-color: #C0392B;
}

.radio-card input[type="radio"] {
  margin-top: 3px;
  flex-shrink: 0;
  accent-color: #C0392B;
}

.radio-card.selected {
  border-color: #C0392B;
  background: #fdf5f4;
}

.radio-card-label {
  font-weight: 600;
  font-size: 0.9rem;
}

.radio-card-desc {
  font-size: 0.8rem;
  color: #6B6B6B;
  margin-top: 2px;
}

/* ── File upload zone ───────────────────────────────────── */
.upload-zone {
  border: 2px dashed #6B6B6B;
  border-radius: 6px;
  padding: 2rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  background: #fafafa;
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: #C0392B;
  background: #fdf5f4;
}

.upload-zone p {
  color: #6B6B6B;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.upload-zone input[type="file"] {
  display: none;
}

.upload-file-info {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: #3D3D3D;
  font-weight: 600;
}

/* ── Section heading ────────────────────────────────────── */
.section-heading {
  font-size: 1.1rem;
  font-weight: 700;
  color: #C0392B;
  margin-bottom: 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid #F2F2F2;
}

/* ── Progress / processing ──────────────────────────────── */
.stage-list {
  list-style: none;
  margin: 2rem 0;
}

.stage-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 4px;
  margin-bottom: 0.5rem;
  background: #F2F2F2;
  font-size: 0.95rem;
}

.stage-item.active {
  background: #eaf4fb;
  border-left: 4px solid #2980B9;
}

.stage-item.done {
  background: #eafaf1;
  border-left: 4px solid #27AE60;
}

.stage-item.error {
  background: #fdecea;
  border-left: 4px solid #C0392B;
}

.stage-icon {
  font-size: 1.2rem;
  width: 1.4rem;
  text-align: center;
  flex-shrink: 0;
}

.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 3px solid #ddd;
  border-top-color: #2980B9;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Results ─────────────────────────────────────────────── */
.coverage-score {
  font-size: 3rem;
  font-weight: 700;
  text-align: center;
  margin: 1rem 0;
}

.coverage-score.high  { color: #27AE60; }
.coverage-score.mid   { color: #F39C12; }
.coverage-score.low   { color: #C0392B; }

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin-bottom: 1.5rem;
}

.results-table th {
  background: #C0392B;
  color: #ffffff;
  padding: 0.6rem 0.8rem;
  text-align: left;
  font-weight: 600;
}

.results-table td {
  padding: 0.55rem 0.8rem;
  border-bottom: 1px solid #F2F2F2;
  vertical-align: top;
}

.results-table tr:nth-child(even) td {
  background: #F2F2F2;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #ffffff;
}

.badge-complete  { background: #27AE60; }
.badge-partial   { background: #F39C12; }
.badge-absent    { background: #E74C3C; }
.badge-unclear   { background: #95A5A6; }

/* ── Star rating ─────────────────────────────────────────── */
.star-rating {
  display: flex;
  gap: 0.3rem;
  margin-bottom: 0.5rem;
}

.star {
  font-size: 1.8rem;
  cursor: pointer;
  color: #ddd;
  transition: color 0.1s ease;
  line-height: 1;
}

.star.active,
.star:hover,
.star.hover {
  color: #F39C12;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 640px) {
  .main-content {
    padding: 1.25rem 1rem;
  }

  .navbar-inner {
    padding: 0.5rem 1rem;
  }

  .navbar-email {
    display: none;
  }

  .coverage-score {
    font-size: 2.2rem;
  }
}

/* ── Field help text ────────────────────────────────────────── */
.field-help {
  font-size: 0.78rem;
  color: #6B6B6B;
  margin-top: 0.3rem;
  line-height: 1.4;
}

/* ── Info bubble tooltip ────────────────────────────────────── */
.info-bubble {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #6B6B6B;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  font-style: italic;
  cursor: help;
  position: relative;
  vertical-align: middle;
  margin-left: 4px;
}

.info-bubble:hover::after {
  content: attr(title);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #3D3D3D;
  color: #fff;
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-style: normal;
  font-weight: 400;
  line-height: 1.4;
  width: 280px;
  white-space: normal;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.info-bubble:hover::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #3D3D3D;
  z-index: 100;
}

/* ── Blurred/locked results ─────────────────────────────────── */
.results-locked {
  filter: blur(5px);
  user-select: none;
  pointer-events: none;
  position: relative;
}

.results-gate-overlay {
  text-align: center;
  padding: 1.5rem;
  margin: 1rem 0 2rem;
  background: #FFF9F0;
  border: 1px solid #F39C12;
  border-radius: 6px;
}
