/* ============================================================
   INTEGRITY-AI · IMGIA Platform Styles v2.0
   Design system aligned with login UI
   Font: Inter only · Colors: blue-dark palette
   ============================================================ */

/* ── Design tokens ────────────────────────────────────────── */
:root {
  /* Brand blues (from login) */
  --blue-dark:    #102a72;
  --blue-mid:     #183caa;
  --blue-bright:  #2a63ea;
  --blue-btn:     #2f63eb;
  --blue-btn-h:   #2656d2;
  --blue-focus:   rgba(47,99,235,0.14);

  /* Surfaces */
  --bg:           #f3f3f7;
  --surface:      #ffffff;
  --surface2:     #f0f2f7;
  --surface3:     #e4e7ef;
  --border:       #d6dae3;
  --border-strong:#b8bfcc;

  /* Text */
  --text:         #0f172a;
  --text-2:       #4b5563;
  --text-3:       #9aa1af;

  /* Accent (maps to blue-btn) */
  --accent:       #2f63eb;
  --accent-h:     #2656d2;
  --accent-lt:    #eff4ff;

  /* Semantic */
  --success:      #059669;
  --success-lt:   #ecfdf5;
  --warn:         #d97706;
  --warn-lt:      #fffbeb;
  --danger:       #dc2626;
  --danger-lt:    #fef2f2;

  /* Radii */
  --radius:       12px;
  --radius-sm:    8px;
  --radius-lg:    16px;
  --radius-xl:    20px;

  /* Shadows */
  --shadow:       0 1px 3px rgba(0,0,0,.07), 0 4px 14px rgba(0,0,0,.05);
  --shadow-lg:    0 8px 28px rgba(16,42,114,.10);
  --shadow-btn:   0 8px 18px rgba(47,99,235,.18);

  /* Font */
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
          'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }

/* ── Typography ───────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--font);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

/* ── APP LAYOUT ───────────────────────────────────────────── */
.app-page { min-height: 100vh; display: flex; flex-direction: column; }

/* ── TOPNAV ───────────────────────────────────────────────── */
.topnav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue-mid) 60%, var(--blue-bright) 100%);
  padding: .7rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: 0 2px 12px rgba(16,42,114,.18);
}

/* Grid overlay on topnav */
.topnav::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}

.topnav > * { position: relative; z-index: 1; }

.topnav-brand { display: flex; align-items: center; gap: .75rem; }
.topnav-center { display: flex; align-items: center; gap: .75rem; flex: 1; justify-content: center; }
.topnav-right  { display: flex; align-items: center; gap: .75rem; }
.topnav-title  { font-weight: 600; font-size: .95rem; color: rgba(255,255,255,.85); }
.back-link     { color: rgba(255,255,255,.75); font-size: .9rem; font-weight: 500; }
.back-link:hover { color: #fff; text-decoration: none; }

/* Logo in topnav */
.logo-mark {
  background: var(--blue-btn);
  color: white;
  font-weight: 800;
  font-size: 1rem;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  letter-spacing: -0.02em;
  flex-shrink: 0;
}
.logo-mark.sm { width: 30px; height: 30px; font-size: .8rem; }

.logo-text {
  font-weight: 800;
  font-size: 1.1rem;
  color: #fff;
  letter-spacing: -0.02em;
}
.logo-text em { font-style: normal; color: #93c5fd; }

/* Topnav buttons */
.topnav .btn-ghost {
  background: rgba(255,255,255,.1);
  color: rgba(255,255,255,.85);
  border-color: rgba(255,255,255,.2);
}
.topnav .btn-ghost:hover {
  background: rgba(255,255,255,.18);
  color: #fff;
  border-color: rgba(255,255,255,.35);
  text-decoration: none;
}
.topnav .btn-danger {
  color: #fca5a5 !important;
  border-color: rgba(255,255,255,.2) !important;
}
.topnav .btn-danger:hover {
  background: rgba(220,38,38,.25) !important;
  color: #fff !important;
}
.topnav .btn-secondary {
  background: rgba(255,255,255,.12);
  color: #fff;
  border-color: rgba(255,255,255,.25);
}
.topnav .btn-secondary:hover {
  background: rgba(255,255,255,.2);
  color: #fff;
}

/* User pill in topnav */
.user-pill {
  font-size: .82rem;
  color: rgba(255,255,255,.75);
  font-weight: 500;
}
.user-pill em { color: rgba(255,255,255,.5); font-style: normal; }

/* Admin badge */
.admin-badge {
  background: rgba(255,255,255,.15);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  padding: .15rem .55rem;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: .06em;
  border: 1px solid rgba(255,255,255,.2);
}

/* ── MAIN CONTENT ─────────────────────────────────────────── */
.app-main {
  flex: 1;
  padding: 2rem 2.5rem 3rem;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}

.page-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.page-title {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: .25rem;
  letter-spacing: -0.04em;
}

.page-sub {
  font-size: .95rem;
  color: var(--text-2);
  line-height: 1.5;
}

/* ── FORMS ────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1rem; }
.form-group label {
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-2);
}
.form-group small { font-size: .78rem; color: var(--text-3); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

input[type=text],
input[type=email],
input[type=password],
input[type=number],
input[type=date],
select,
textarea {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: .95rem;
  color: var(--text);
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}
textarea { height: auto; min-height: 80px; padding: 10px 14px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--blue-focus);
}

.form-section-title {
  font-weight: 700;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--text-3);
  margin: 1.5rem 0 .75rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--border);
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  cursor: pointer;
  font-size: .9rem;
  line-height: 1.5;
}
.checkbox-label input[type=checkbox] { margin-top: .2rem; width: auto; flex-shrink: 0; }
.consent-group { margin: 1.5rem 0; }

/* ── BUTTONS ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .6rem 1.25rem;
  border-radius: var(--radius);
  font-family: var(--font);
  font-weight: 700;
  font-size: .9rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all .18s;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--blue-btn);
  color: #fff;
  border-color: var(--blue-btn);
  box-shadow: var(--shadow-btn);
}
.btn-primary:hover {
  background: var(--blue-btn-h);
  border-color: var(--blue-btn-h);
  color: #fff;
  text-decoration: none;
}
.btn-secondary {
  background: var(--surface);
  color: var(--accent);
  border-color: var(--accent);
}
.btn-secondary:hover { background: var(--accent-lt); text-decoration: none; }
.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--surface2); text-decoration: none; }
.btn-danger  { color: var(--danger) !important; border-color: var(--border) !important; }
.btn-danger:hover { background: var(--danger-lt) !important; }
.btn-success { background: var(--success-lt); color: var(--success); border-color: #6ee7b7; }
.btn-success:hover { background: #d1fae5; }
.btn-full  { width: 100%; }
.btn-lg    { padding: .75rem 1.75rem; font-size: 1rem; }
.btn-sm    { padding: .38rem .85rem; font-size: .82rem; }
.btn-xs    { padding: .22rem .6rem;  font-size: .77rem; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn:active   { transform: translateY(1px); }

/* ── ALERTS ───────────────────────────────────────────────── */
.alert {
  padding: .85rem 1.1rem;
  border-radius: var(--radius);
  font-size: .9rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: .6rem;
  line-height: 1.4;
}
.alert-error   { background: var(--danger-lt);  color: #991b1b; border: 1px solid #fca5a5; }
.alert-success { background: var(--success-lt); color: #065f46; border: 1px solid #6ee7b7; }
.alert-info    { background: var(--accent-lt);  color: #1e3a8a; border: 1px solid #bfdbfe; }

/* ── CARDS ────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

/* ── AUTH LAYOUT ──────────────────────────────────────────── */
.auth-page { background: var(--bg); min-height: 100vh; }

.auth-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

/* Left brand panel */
.auth-brand {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 16% 18%, rgba(255,255,255,.06), transparent 24%),
    radial-gradient(circle at 72% 92%, rgba(42,99,234,.26), transparent 28%),
    linear-gradient(180deg, var(--blue-dark) 0%, var(--blue-mid) 58%, var(--blue-bright) 100%);
  color: #fff;
  padding: 46px 42px 32px;
  display: flex;
  flex-direction: column;
}

.auth-brand::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

.brand-inner {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin-left: 60px;
  margin-top: 50px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1.75rem;
}

.brand-headline {
  font-size: clamp(2.6rem, 4vw, 4.2rem);
  font-weight: 800;
  color: #fff;
  line-height: .93;
  letter-spacing: -0.05em;
  margin-bottom: 1rem;
}

.brand-sub {
  color: rgba(255,255,255,.75);
  font-size: .95rem;
  margin-bottom: 1.75rem;
  line-height: 1.55;
}

.brand-dims {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.dim-chip {
  background: rgba(255,255,255,.1);
  color: #bfdbfe;
  font-size: .74rem;
  font-weight: 600;
  padding: .28rem .75rem;
  border-radius: 100px;
  border: 1px solid rgba(255,255,255,.15);
}

/* Right form panel */
.auth-form-wrap {
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 2rem;
  overflow-y: auto;
}

.auth-form-inner { width: 100%; max-width: 440px; }

.form-header { margin-bottom: 1.75rem; }
.form-header h2 {
  font-size: clamp(2rem, 3vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: .95;
  margin-bottom: .4rem;
  color: var(--text);
}
.form-header p { color: var(--text-2); font-size: .97rem; }
.form-header p a { color: var(--accent); font-weight: 500; }

/* Simple auth (single panel — forgot, reset, activate) */
.auth-split--simple {
  grid-template-columns: 1fr;
  max-width: 500px;
  margin: 6vh auto;
  min-height: unset;
}
.auth-split--simple .auth-form-wrap {
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

/* Auth accessories */
.form-forgot { text-align: right; margin: -.4rem 0 1rem; }
.form-forgot a { font-size: .85rem; color: var(--text-3); }
.form-forgot a:hover { color: var(--accent); }

.gdpr-note {
  margin-top: 1.25rem;
  padding: .65rem 1rem;
  background: rgba(255,255,255,.56);
  border: 1px solid rgba(15,23,42,.05);
  border-radius: var(--radius);
  color: var(--text-3);
  font-size: .84rem;
  line-height: 1.4;
}

.activation-icon { font-size: 3.5rem; margin-bottom: .5rem; }

/* Input with icon/toggle */
.input-icon-wrap { position: relative; }
.input-icon-wrap input { padding-right: 2.75rem; }
.input-icon-btn {
  position: absolute; right: .65rem; top: 50%;
  transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  font-size: 1rem; padding: .25rem; color: var(--text-3); line-height: 1;
}

/* Password strength */
.password-strength {
  font-size: .78rem; font-weight: 600;
  margin-top: .35rem; padding: .2rem .5rem;
  border-radius: 4px; display: inline-block;
}
.pw-weak   { color: var(--danger);  background: var(--danger-lt); }
.pw-fair   { color: var(--warn);    background: var(--warn-lt); }
.pw-good   { color: #7c3aed;        background: #f5f3ff; }
.pw-strong { color: var(--success); background: var(--success-lt); }

/* ── DASHBOARD ────────────────────────────────────────────── */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
  transition: box-shadow .18s, transform .18s;
}
.stat-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }

.stat-num {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--blue-btn);
  line-height: 1;
  margin-bottom: .35rem;
}
.stat-label { font-size: .82rem; color: var(--text-2); font-weight: 500; }
.stat-green { color: var(--success) !important; }
.stat-warn  { color: var(--warn) !important; }

/* Instructions card */
.instructions-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--blue-btn);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}

.instructions-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: .85rem;
  color: var(--text);
}

.instructions-card ol {
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .45rem;
}

.instructions-card li {
  font-size: .9rem;
  color: var(--text-2);
  line-height: 1.5;
}

/* Dimension grid */
.dims-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.dim-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .18s, box-shadow .18s;
  display: flex;
  flex-direction: column;
}
.dim-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.dim-card--completed { border-color: #6ee7b7; }
.dim-card--in-progress { border-color: #93c5fd; }

.dim-card-header {
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  background: color-mix(in srgb, var(--dim-color, var(--blue-btn)) 8%, white);
  border-bottom: 1px solid var(--border);
}

.dim-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}

.dim-code {
  font-weight: 800;
  font-size: .85rem;
  color: var(--dim-color, var(--blue-btn));
  letter-spacing: -0.01em;
}

.dim-badge {
  margin-left: auto;
  font-size: .72rem;
  font-weight: 700;
  padding: .2rem .6rem;
  border-radius: 100px;
}
.badge-done     { background: #d1fae5; color: #065f46; }
.badge-progress { background: #dbeafe; color: #1e40af; }
.badge-pending  { background: var(--surface2); color: var(--text-3); }
.badge-info     { background: var(--accent-lt); color: var(--accent); font-size: .72rem; font-weight: 700; padding: .2rem .6rem; border-radius: 100px; }
.badge-warn     { background: var(--warn-lt); color: var(--warn); font-size:.75rem; font-weight:600; padding:.15rem .55rem; border-radius:100px; }

.dim-card-body { padding: 1.1rem 1.25rem; flex: 1; }
.dim-card-body h3 { font-size: .97rem; font-weight: 700; margin-bottom: .35rem; letter-spacing: -0.02em; }
.dim-card-body p  { font-size: .83rem; color: var(--text-2); margin-bottom: .9rem; line-height: 1.5; }

.dim-progress-bar {
  height: 5px;
  background: var(--surface2);
  border-radius: 100px;
  overflow: hidden;
  margin-bottom: .4rem;
}
.dim-progress-fill {
  height: 100%;
  border-radius: 100px;
  transition: width .4s ease;
}
.dim-progress-label { font-size: .78rem; color: var(--text-3); font-weight: 500; }

.dim-card-footer {
  padding: .9rem 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  background: var(--surface2);
}
.dim-date { font-size: .78rem; color: var(--text-3); }

/* Progress ring */
.progress-summary {
  display: flex;
  align-items: center;
  gap: .85rem;
}
.progress-ring-wrap {
  position: relative;
  width: 64px; height: 64px;
  flex-shrink: 0;
}
.progress-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  font-weight: 800;
  color: var(--text);
}
.progress-text {
  font-size: .82rem;
  color: var(--text-2);
  font-weight: 500;
  line-height: 1.4;
}

/* Results CTA */
.results-cta {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}
.cta-note { font-size: .85rem; color: var(--text-3); }

/* ── QUESTIONNAIRE ────────────────────────────────────────── */
.section-header {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.section-title { font-size: 1.15rem; font-weight: 800; letter-spacing: -0.03em; }
.section-badge {
  background: linear-gradient(135deg, var(--blue-dark), var(--blue-bright));
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  padding: .3rem .8rem;
  border-radius: 100px;
  letter-spacing: .04em;
}
.section-max-pts {
  font-size: .8rem;
  color: var(--text-3);
  font-weight: 600;
}

.question-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 1.25rem;
  transition: border-color .15s;
}
.question-row.answered { border-color: #93c5fd; }

.question-id {
  font-weight: 800;
  font-size: .8rem;
  color: var(--text-3);
  padding-top: .2rem;
  letter-spacing: .02em;
}

.question-text {
  font-size: .9rem;
  line-height: 1.55;
  margin-bottom: 1rem;
  color: var(--text);
  font-weight: 500;
}

/* Likert */
.likert-options {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: .5rem;
  margin-bottom: .75rem;
}

.likert-option { cursor: pointer; }

.likert-option input[type=radio] { display: none; }

.likert-option .likert-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .3rem;
  padding: .5rem .35rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: all .15s;
  cursor: pointer;
}

.likert-option .likert-num {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-3);
}

.likert-option .likert-label {
  font-size: .68rem;
  text-align: center;
  color: var(--text-3);
  line-height: 1.3;
}

.likert-option input:checked ~ .likert-num,
.likert-option input:checked ~ .likert-tip {
  color: var(--blue-btn);
  font-weight: 700;
}

.likert-option input:checked {
  /* no visible, pero puedes usar el label */
}

.likert-option input:checked ~ * {
  /* opcional */
}

.likert-option:hover {
  background: var(--accent-lt);
  border-color: var(--blue-btn);
}

/* Binary / Evidence */
.binary-options {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
  margin-bottom: .75rem;
}

.binary-option {
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .45rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  font-size: .88rem;
  font-weight: 500;
  transition: all .15s;
}
.binary-option input { display: none; }
.binary-option:hover { border-color: var(--blue-btn); background: var(--accent-lt); }
.binary-option.selected,
.binary-option--sí.selected,
.binary-option--sim.selected,
.binary-option--oui.selected,
.binary-option--yes.selected      { border-color: var(--success); background: var(--success-lt); color: var(--success); font-weight: 700; }
.binary-option--enproceso.selected,
.binary-option--emandamento.selected,
.binary-option--encours.selected,
.binary-option--inprogress.selected { border-color: var(--warn); background: var(--warn-lt); color: var(--warn); font-weight: 700; }
.binary-option--no.selected,
.binary-option--non.selected       { border-color: var(--danger); background: var(--danger-lt); color: var(--danger); font-weight: 700; }
.binary-option--disponible.selected,
.binary-option--available.selected,
.binary-option--disponivel.selected { border-color: var(--success); background: var(--success-lt); color: var(--success); font-weight: 700; }
.binary-option--endesarrollo.selected,
.binary-option--emdesenvolvimento.selected,
.binary-option--indevelopment.selected { border-color: var(--warn); background: var(--warn-lt); color: var(--warn); font-weight: 700; }
.binary-option--nodisponible.selected,
.binary-option--notavailable.selected  { border-color: var(--danger); background: var(--danger-lt); color: var(--danger); font-weight: 700; }

/* Observations */
.obs-toggle { margin-top: .5rem; }
.obs-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: .82rem;
  color: var(--text-3);
  padding: .25rem 0;
  font-weight: 500;
}
.obs-btn:hover { color: var(--accent); }
.obs-input {
  display: none;
  margin-top: .5rem;
  width: 100%;
  min-height: 68px;
}
.obs-input.visible { display: block; }

/* Quest actions bar */
.quest-actions {
  display: flex;
  gap: .75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  align-items: center;
}

/* ── RESULTS ──────────────────────────────────────────────── */
.imgia-score-card {
  background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue-mid) 60%, var(--blue-bright) 100%);
  border-radius: var(--radius-xl);
  padding: 2rem 2.5rem;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.imgia-score-card::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}

.imgia-score-card > * { position: relative; z-index: 1; }

.imgia-label { font-size: .9rem; color: rgba(255,255,255,.75); font-weight: 600; margin-bottom: .35rem; }
.imgia-number {
  font-size: 4rem;
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1;
}
.imgia-sub { font-size: .85rem; color: rgba(255,255,255,.6); margin-top: .25rem; }
.imgia-maturity {
  text-align: right;
}
.imgia-maturity-label {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: .25rem;
}
.imgia-category {
  display: inline-block;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 100px;
  padding: .25rem .85rem;
  font-size: .82rem;
  font-weight: 600;
}

.chart-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.chart-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-legend {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.chart-legend h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.legend-row {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  margin-bottom: .6rem;
}

.legend-range {
  font-size: .75rem;
  font-weight: 700;
  color: var(--blue-btn);
  background: var(--accent-lt);
  padding: .15rem .5rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Score bars */
.score-bar-wrap {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex: 1;
}
.score-bar-fill {
  height: 8px;
  background: linear-gradient(90deg, var(--blue-bright), var(--blue-btn));
  border-radius: 100px;
  flex-shrink: 0;
}
.score-bar-wrap span { font-weight: 700; font-size: .88rem; color: var(--text); }

/* Maturity badges */
.maturity-badge {
  display: inline-block;
  background: var(--accent-lt);
  color: var(--blue-btn);
  font-size: .78rem;
  font-weight: 700;
  padding: .2rem .65rem;
  border-radius: 100px;
  border: 1px solid #bfdbfe;
}

.category-badge {
  display: inline-block;
  font-size: .78rem;
  font-weight: 700;
  padding: .2rem .65rem;
  border-radius: 100px;
}
.category-critico      { background: var(--danger-lt);  color: var(--danger);  border: 1px solid #fca5a5; }
.category-deficiente   { background: var(--warn-lt);    color: var(--warn);    border: 1px solid #fcd34d; }
.category-endesarrollo,
.category-endeveloppement,
.category-developing   { background: #fef9c3;           color: #854d0e;        border: 1px solid #fde047; }
.category-establecido,
.category-etabli,
.category-established  { background: var(--accent-lt);  color: var(--blue-btn);border: 1px solid #bfdbfe; }
.category-referente,
.category-reference    { background: var(--success-lt); color: var(--success); border: 1px solid #6ee7b7; }

/* ── TABLES ───────────────────────────────────────────────── */
.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.results-table th {
  background: var(--blue-dark);
  color: rgba(255,255,255,.9);
  font-weight: 700;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .85rem 1.1rem;
  text-align: left;
  white-space: nowrap;
}
.results-table td {
  padding: .8rem 1.1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
  vertical-align: middle;
}
.results-table tr:last-child td { border-bottom: none; }
.results-table tr:hover td { background: var(--surface2); }
.results-table tfoot td {
  background: var(--surface2);
  font-weight: 700;
  color: var(--text);
}
.row-disabled { opacity: .5; }

/* ── ADMIN ────────────────────────────────────────────────── */
.admin-page .app-main { max-width: 100%; }

.admin-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

.admin-section h2 {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
  color: var(--text);
}

.admin-tabs {
  display: flex;
  gap: .25rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--border);
  overflow-x: auto;
}
.admin-tab {
  padding: .65rem 1.25rem;
  font-weight: 700;
  font-size: .87rem;
  color: var(--text-2);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
}
.admin-tab:hover { color: var(--accent); text-decoration: none; }
.admin-tab.active { color: var(--accent); border-color: var(--accent); font-weight: 700; }

.section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: .75rem;
}
.section-header-row h2 { margin-bottom: 0; }

.filter-form { margin-bottom: 1.25rem; }
.filter-row  {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: flex-end;
}
.filter-row .form-group { margin-bottom: 0; flex: 1; min-width: 140px; }

.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.action-btns { display: flex; flex-wrap: wrap; gap: .3rem; }

.role-badge {
  font-size: .74rem; font-weight: 700;
  padding: .18rem .6rem;
  border-radius: 100px;
}
.role-admin     { background: #fef3c7; color: #92400e; }
.role-evaluator { background: var(--accent-lt); color: var(--blue-btn); }
.role-viewer    { background: var(--surface2); color: var(--text-2); }

.audit-action {
  font-family: monospace;
  font-size: .8rem;
  background: var(--surface2);
  padding: .15rem .45rem;
  border-radius: 4px;
  color: var(--text-2);
}

/* Code form */
.code-form {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

/* Reports */
.report-export-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 2rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.export-label {
  font-weight: 700;
  font-size: .84rem;
  color: var(--text-2);
  margin-right: .25rem;
}
.report-section { page-break-inside: avoid; }

/* Page hero nav link (reports back) */
.page-hero .back-link-plain {
  font-size: .88rem;
  color: var(--text-3);
  font-weight: 500;
}
.page-hero .back-link-plain:hover { color: var(--accent); text-decoration: none; }

/* ── MODAL ────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.modal-box {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0;
  background: var(--surface);
  z-index: 1;
}
.modal-header h3 { font-size: 1.05rem; font-weight: 800; letter-spacing: -0.02em; }
.modal-close {
  background: none; border: none; font-size: 1.2rem;
  cursor: pointer; color: var(--text-3); padding: .25rem;
}
.modal-close:hover { color: var(--danger); }
.modal-box form { padding: 1.5rem; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: .75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  margin-top: 1rem;
}

/* ── LANGUAGE SELECTOR ────────────────────────────────────── */
.lang-selector { position: relative; display: inline-block; }

.lang-selector__btn {
  display: flex;
  align-items: center;
  gap: .4rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .38rem .75rem;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-2);
  transition: background .15s, border-color .15s;
  white-space: nowrap;
}
.lang-selector__btn:hover { background: var(--surface3); border-color: var(--accent); }
.lang-caret { font-size: .65rem; opacity: .6; }

/* In topnav: white variant */
.topnav .lang-selector__btn {
  background: rgba(255,255,255,.1);
  border-color: rgba(255,255,255,.2);
  color: rgba(255,255,255,.85);
}
.topnav .lang-selector__btn:hover {
  background: rgba(255,255,255,.18);
  border-color: rgba(255,255,255,.35);
  color: #fff;
}
.topnav .lang-option { color: var(--text); }

.lang-selector__dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 150px;
  z-index: 200;
  overflow: hidden;
}
.lang-selector__dropdown.open { display: block; animation: fadeIn .12s ease; }

.lang-option {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .6rem 1rem;
  font-size: .85rem;
  color: var(--text);
  text-decoration: none;
  transition: background .1s;
}
.lang-option:hover { background: var(--surface2); text-decoration: none; }
.lang-option--active { background: var(--accent-lt); color: var(--blue-btn); font-weight: 700; }

@keyframes fadeIn { from { opacity:0; transform:translateY(-4px); } to { opacity:1; transform:none; } }

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 1100px) {
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
  .chart-section { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
  .auth-split { grid-template-columns: 1fr; }
  .auth-brand { padding: 28px 18px 22px; }
  .brand-inner { margin-left: 0; margin-top: 8px; max-width: 100%; }
  .auth-form-wrap { padding: 2rem 1.25rem 2.5rem; }
  .auth-form-inner { max-width: 540px; }
  .dims-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .app-main { padding: 1.5rem 1.25rem 2.5rem; }
  .admin-tabs { gap: 0; }
  .admin-tab  { padding: .55rem .85rem; font-size: .82rem; }
  .report-export-bar { flex-direction: column; align-items: flex-start; }
  .modal-box { max-width: 100%; margin: 0; }
  .section-header-row { flex-direction: column; align-items: flex-start; }
  .topnav { padding: .65rem 1.25rem; }
}

@media (max-width: 700px) {
  .dims-grid { grid-template-columns: 1fr; }
  .form-row  { grid-template-columns: 1fr; }
  .likert-options { grid-template-columns: repeat(5, 1fr); gap: .3rem; }
  .imgia-score-card { flex-direction: column; gap: 1rem; }
  .imgia-maturity { text-align: left; }
}

@media (max-width: 600px) {
  .page-hero { flex-direction: column; gap: 1rem; }
  .action-btns { flex-direction: column; }
  .filter-row  { flex-direction: column; }
  .filter-row .form-group { min-width: 100%; }
  .admin-stats { grid-template-columns: 1fr 1fr; }
  .modal-overlay { padding: .5rem; align-items: flex-end; }
  .modal-box { border-radius: var(--radius-lg) var(--radius-lg) 0 0; max-height: 85vh; }
  .question-row { grid-template-columns: 1fr; gap: .75rem; }
  .quest-actions { flex-direction: column; }
  .quest-actions .btn { width: 100%; }
  .brand-headline { font-size: clamp(2.2rem, 10vw, 3rem); }
}

/* ── PRINT ────────────────────────────────────────────────── */
@media print {
  .topnav, .report-export-bar, .action-btns, .btn { display: none !important; }
  .admin-section { box-shadow: none; border: 1px solid #ccc; }
  body { background: white; }
}

/* ── AUTH LEFT PANEL (shared across auth pages) ───────────── */
.left-panel {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 16% 18%, rgba(255,255,255,.06), transparent 24%),
    radial-gradient(circle at 72% 92%, rgba(42,99,234,.26), transparent 28%),
    linear-gradient(180deg, #102a72 0%, #183caa 58%, #2a63ea 100%);
  color: #fff;
  padding: 46px 42px 32px;
  display: flex;
  flex-direction: column;
}

.left-panel::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

.left-panel > * { position: relative; z-index: 1; }

.left-top {
  max-width: 520px;
  margin-left: 60px;
  margin-top: 50px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.welcome-banner {
  margin-bottom: 14px;
  font-size: .8rem;
  font-weight: 600;
  color: rgba(255,255,255,.6);
  letter-spacing: .02em;
  line-height: 1.7;
}
.welcome-banner span { color: rgba(255,255,255,.88); }
.welcome-banner .sep { margin: 0 5px; opacity: .35; }

.left-title {
  margin: 0;
  font-weight: 800;
  font-size: clamp(2.6rem, 4vw, 4.2rem);
  line-height: .93;
  letter-spacing: -0.05em;
  color: #fff;
  max-width: 460px;
}

.left-meta {
  margin-top: 12px;
  font-size: .92rem;
  line-height: 1.45;
  color: rgba(255,255,255,.75);
}

.left-intro {
  margin-top: 14px;
  max-width: 480px;
  padding: 13px 15px;
  border-radius: 12px;
  background: rgba(255,255,255,.075);
  border: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(6px);
  box-shadow: 0 6px 14px rgba(8,16,48,.10);
}

.left-intro p {
  margin: 0 0 8px 0;
  font-size: .875rem;
  line-height: 1.5;
  color: rgba(255,255,255,.92);
}
.left-intro p:last-child { margin-bottom: 0; }

.left-summary { margin-top: 10px; display: grid; gap: 5px; }

.left-summary-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: .85rem;
  line-height: 1.4;
  color: rgba(255,255,255,.92);
}
.left-summary-item .icon { width: 17px; flex: 0 0 17px; text-align: center; }

.left-privacy {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,.12);
  font-size: .74rem;
  line-height: 1.45;
  color: rgba(255,255,255,.68);
}
.left-privacy a { color: rgba(255,255,255,.82); text-decoration: underline; text-underline-offset: 2px; }

/* Responsive for left panel */
@media (max-width: 1180px) {
  .left-top { margin-left: 32px; margin-top: 36px; }
}
@media (max-width: 980px) {
  .left-panel { padding: 26px 18px 22px; }
  .left-top   { margin-left: 0; margin-top: 6px; max-width: 100%; }
  .left-title { font-size: clamp(2.2rem, 8vw, 3.2rem); max-width: 100%; }
}
@media (max-width: 640px) {
  .left-intro p, .left-summary-item { font-size: .83rem; }
  .left-privacy { font-size: .72rem; }
}
