@import url('https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@400;600;700;800&display=swap');

:root{
  --pink:#C65A7A;
  --blue:#7EB3D1;
  --ink:#111827;
  --muted:#6b7280;
  --bg:rgba(255,255,255,.96);
}

*{box-sizing:border-box}

body{
  margin:0;
  font-family:'Nunito Sans',system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial;
  color:var(--ink);
  background:linear-gradient(145deg,#f7fafc,#fdfdfd);
  padding:28px 12px;
}

.container{
  max-width:1040px;
  margin:0 auto;
  background:var(--bg);
  border-radius:20px;
  box-shadow:0 18px 48px rgba(0,0,0,.12);
  padding:20px 20px 26px;
}

.topbar{
  display:flex;
  align-items:flex-start;
  gap:8px;
}

.brand{
  font-weight:800;
  font-size:26px;
  color:var(--pink);
  letter-spacing:.2px;
  margin:0;
  cursor:pointer;
}

.sub{
  color:var(--muted);
  font-size:14px;
  margin-top:4px;
}

.topright{
  margin-left:auto;
  display:flex;
  gap:8px;
  align-items:center;
}

.badge,
.toggle,
.info{
  border:1px solid #e5e7eb;
  background:#fff;
  color:#334155;
  padding:6px 10px;
  border-radius:999px;
  cursor:pointer;
  font-weight:700;
  font-size:13px;
}

.lang-toggle{
  display:flex;
  align-items:center;
  gap:4px;
  border:1px solid #e5e7eb;
  background:#fff;
  padding:4px 8px;
  border-radius:999px;
}

.lang-btn{
  border:none;
  background:transparent;
  font-weight:700;
  font-size:13px;
  color:#64748b;
  cursor:pointer;
  padding:2px 6px;
}

.lang-btn.active{
  color:#111827;
  text-decoration:underline;
}

.mode{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:12px;
  margin:12px 0;
}

.mode-btn{
  border:none;
  border-radius:14px;
  padding:16px;
  color:#fff;
  font-weight:800;
  font-size:16px;
  cursor:pointer;
  transition:transform .08s ease,opacity .15s ease;
  background:linear-gradient(135deg,var(--blue),#6aa3c1);
}

.mode-btn:nth-child(1){
  background:linear-gradient(135deg,var(--pink),#a64b69);
}

.mode-btn:nth-child(3){
  background:linear-gradient(135deg,#b46a85,#7EB3D1);
}

.mode-btn:hover{
  transform:translateY(-2px);
  opacity:.95;
}

.section-banner{
  background:#ebf5ff;
  color:#0f3a62;
  padding:9px 12px;
  border-radius:10px;
  margin:16px 0 8px;
  font-weight:800;
  display:flex;
  justify-content:space-between;
  align-items:center;
}

.progress{
  text-align:right;
  color:#475569;
  font-size:13px;
  margin:4px 2px 8px;
}

/* Horizontal legend bar at top */
.legend-horizontal{
  display:flex;
  flex-direction:row;
  justify-content:space-between;
  align-items:center;
  gap:14px;
  background:#fbfdff;
  border:1px dashed #e5e7eb;
  border-radius:12px;
  padding:10px 14px;
  margin-bottom:12px;
}

.legend-item{
  display:flex;
  flex-direction:row;
  align-items:center;
  gap:6px;
}

.legend-item svg{
  width:26px;
  height:26px;
}

.leg-label{
  font-size:13px;
  color:#334155;
  font-weight:600;
}

.qcard{
  background:#fff;
  border-radius:16px;
  box-shadow:0 6px 16px rgba(0,0,0,.08);
  padding:14px;
  margin:8px 0;
}

.qtitle{
  font-weight:800;
  margin:0 0 6px;
}

.qguide{
  font-size:13px;
  color:#52525b;
  margin:0 0 8px;
}

.qlegend{
  font-size:12px;
  color:#6b7280;
  margin:2px 0 10px;
}

/* Horizontal faces + numbers */
.scale{
  display:flex;
  flex-direction:row;
  justify-content:flex-start;
  align-items:center;
  gap:14px;
}

.pill{
  border:2px solid #cbd5e1;
  background:#fff;
  color:#111827;
  padding:8px 12px;
  border-radius:12px;
  min-width:62px;
  font-weight:800;
  cursor:pointer;
  transition:all .12s ease;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:4px;
}

.pill:hover{
  transform:translateY(-1px);
}

.pill svg{
  width:22px;
  height:22px;
}

.pill .num{
  font-size:14px;
}

.pill.selected{
  border-color:#64748b;
  box-shadow:0 0 0 4px rgba(100,116,139,.15);
}

.controls{
  display:flex;
  gap:10px;
  justify-content:space-between;
  align-items:center;
  margin-top:10px;
}

.btn{
  border:none;
  border-radius:12px;
  padding:10px 14px;
  font-weight:800;
  color:#fff;
  background:var(--pink);
  cursor:pointer;
  font-size:14px;
}

.btn.secondary{
  background:#334155;
}

.btn.ghost{
  background:#64748b;
}

.result{
  display:none;
  margin-top:14px;
  background:var(--pink);
  color:#fff;
  padding:16px;
  border-radius:14px;
  font-size:18px;
  font-weight:800;
  text-align:center;
  box-shadow:0 10px 28px rgba(198,90,122,.35);
}

.summary{
  display:none;
  margin-top:10px;
  background:#fff;
  border-radius:14px;
  box-shadow:0 8px 22px rgba(0,0,0,.12);
  padding:14px;
  line-height:1.55;
  color:#1f2937;
}

.bars{
  display:grid;
  grid-template-columns:1fr;
  gap:8px;
  margin-top:10px;
}

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

.bar>div{
  height:10px;
  background:linear-gradient(90deg,var(--blue),var(--pink));
}

.barlabel{
  display:flex;
  justify-content:space-between;
  font-size:12px;
  color:#334155;
  margin-bottom:4px;
}

.footer{
  margin-top:18px;
  text-align:center;
  color:#6b7280;
  font-size:11px;
}

/* Instructions modal */
.modal{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.45);
  display:none;
  align-items:center;
  justify-content:center;
  padding:16px;
  z-index:50;
}

.modal>.card{
  max-width:880px;
  background:#fff;
  border-radius:16px;
  box-shadow:0 20px 50px rgba(0,0,0,.25);
  padding:18px;
}

.modal h2{
  margin:0 0 6px;
}

.modal .close{
  float:right;
  border:none;
  background:#334155;
  color:#fff;
  padding:8px 12px;
  border-radius:10px;
  cursor:pointer;
}

.legend-grid{
  display:grid;
  grid-template-columns:repeat(5,1fr);
  gap:10px;
  margin:10px 0;
}

.legend-tile{
  border:1px solid #e5e7eb;
  border-radius:12px;
  padding:10px;
  text-align:center;
}

.legend-tile .lab{
  font-size:12px;
  color:#475569;
  margin-top:6px;
}

@media (max-width:900px){
  .mode{grid-template-columns:1fr}
  .topbar{flex-direction:column;align-items:flex-start;gap:8px}
  .topright{margin-left:0;align-self:flex-end}
  .legend-horizontal{flex-wrap:wrap;justify-content:flex-start}
}
/* ==== POLISH: GLOBAL FEEL ==== */

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f6fb;
  color: #222;
}

/* Main heading + intro text */
h1 {
  font-size: 2rem;
  margin-bottom: 0.25rem;
}

.subtitle,
.intro-text {
  margin-top: 0.25rem;
  font-size: 0.95rem;
  color: #555;
  line-height: 1.5;
}

/* If your main content is wrapped, this gently “cards” it without being loud */
.main-wrapper,
.app-wrapper,
.main-container {
  max-width: 960px;
  margin: 24px auto 40px;
  padding: 24px 28px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
}

/* ==== POLISH: TOP BAR / LANGUAGE / SMALL BUTTONS ==== */

header,
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

/* Left: “QualLife” brand text */
.brand,
.logo-text {
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: 1.05rem;
}

/* Right cluster: EN/HI + Instructions + Saved */
.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* EN | HI toggle – pill-like look */
.language-toggle,
.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #d0d5ff;
  background: #f7f7ff;
  font-size: 0.8rem;
  cursor: pointer;
}

.language-toggle span.active,
.lang-toggle span.active {
  font-weight: 600;
  color: #1e3a8a;
}

/* “Instructions” / “Saved” style – quiet, not shouty */
.top-actions button,
.top-btn,
.header-btn {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.top-actions button:hover,
.top-btn:hover,
.header-btn:hover {
  background: #f8fafc;
  box-shadow: 0 3px 10px rgba(148, 163, 184, 0.4);
  transform: translateY(-0.5px);
}

/* ==== POLISH: MODE BUTTONS ROW (Clinic / RWE / Comprehensive) ==== */

/* FIXED: use the actual class used in HTML */

.mode {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 24px;
}

.mode button {
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid #4f46e5;
  background: #4f46e5;
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
  transition:
    background 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
}

.mode button:hover {
  background: #4338ca;
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.45);
  transform: translateY(-1px);
}

.mode button:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.35);
}

  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
  transition:
    background 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
}

.mode-buttons button:hover {
  background: #4338ca;
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.45);
  transform: translateY(-1px);
}

.mode-buttons button:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.35);
}

/* If you ever add an “active” state in JS */
.mode-buttons button.active {
  background: #ffffff;
  color: #1e293b;
  border-color: #4f46e5;
}

/* ==== SMALL FEATURE: BETA FOOTER TAG ==== */

.beta-footer {
  text-align: center;
  font-size: 0.8rem;
  color: #6b7280;
  margin: 12px 0 20px;
}

.beta-footer::before {
  content: "●";
  display: inline-block;
  font-size: 0.55rem;
  margin-right: 6px;
  vertical-align: middle;
  color: #22c55e;
}

/* ==== OPTIONAL: SMOOTHER QUESTION AREA FEEL (safe and mild) ==== */

.question-card,
.question-block {
  padding: 14px 16px;
  border-radius: 12px;
  background: #f8fafc;
  margin-bottom: 12px;
}

/* Make emoji row stay neat horizontally, if you use a class like this */
.face-row,
.scale-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
}

/* Gentle hover on emoji / numbers if they are buttons/labels */
.face-row button,
.scale-row button,
.face-row label,
.scale-row label {
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.face-row button:hover,
.scale-row button:hover,
.face-row label:hover,
.scale-row label:hover {
  transform: translateY(-0.5px);
  box-shadow: 0 3px 8px rgba(148, 163, 184, 0.35);
}
