:root {
  --navy: #0f2942;
  --navy-light: #1a3c5e;
  --teal: #0d9488;
  --teal-dark: #0f766e;
  --teal-soft: #ccfbf1;
  --bg: #f1f5f9;
  --surface: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --amber: #d97706;
  --amber-soft: #fef3c7;
  --green: #16a34a;
  --green-soft: #dcfce7;
  --red: #dc2626;
  --red-soft: #fee2e2;
  --shadow: 0 12px 32px rgba(15, 41, 66, 0.08);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  font-size: 15px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  min-height: 100dvh;
}

button, input, select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Header */
.portal-header {
  background: linear-gradient(135deg, var(--navy) 0%, #091d32 100%);
  color: #fff;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.portal-header-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-badge {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--teal);
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-info strong {
  display: block;
  font-size: 16px;
  letter-spacing: -0.3px;
}

.brand-info small {
  display: block;
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
}

.collab-pill {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  color: #e2e8f0;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 28px 18px 60px;
}

/* Welcome Banner Card */
.intro-banner {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 26px 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--teal);
  display: block;
  margin-bottom: 6px;
}

.intro-banner h1 {
  margin: 0 0 10px;
  font-size: 25px;
  letter-spacing: -0.6px;
  color: var(--navy);
}

.intro-banner p {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.6;
}

.info-highlights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
}

.info-highlight {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}

.profile-bar {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.profile-field {
  flex: 1;
  min-width: 150px;
}

.profile-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 4px;
}

.profile-field input {
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  font-size: 13.5px;
}

/* Survey Cards Grid */
.surveys-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 760px) {
  .surveys-grid {
    grid-template-columns: 1fr;
  }
}

.survey-card {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 18px;
  padding: 26px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  box-shadow: var(--shadow);
  transition: transform 0.15s, border-color 0.15s;
}

.survey-card:hover {
  border-color: var(--teal);
}

.survey-card.completed {
  border-color: #86efac;
  background: linear-gradient(180deg, #ffffff 0%, #f0fdf4 100%);
}

.survey-meta-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.pill-time {
  background: #eff6ff;
  color: #1d4ed8;
}

.pill-count {
  background: #f1f5f9;
  color: #475569;
}

.pill-status-completed {
  background: var(--green-soft);
  color: var(--green);
}

.pill-status-progress {
  background: var(--amber-soft);
  color: var(--amber);
}

.pill-status-pending {
  background: #f1f5f9;
  color: var(--muted);
}

.survey-card h2 {
  margin: 0 0 10px;
  font-size: 21px;
  color: var(--navy);
  letter-spacing: -0.4px;
}

.survey-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.survey-progress-box {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
}

.survey-progress-head {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 8px;
}

.progress-bar-track {
  height: 9px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--teal);
  border-radius: 999px;
  transition: width 0.25s;
}

.progress-bar-fill.completed {
  background: var(--green);
}

.stopped-note {
  display: block;
  margin-top: 7px;
  font-size: 12px;
  color: var(--muted);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14.5px;
  border: 1px solid transparent;
  transition: all 0.15s;
}

.btn-primary {
  background: var(--navy);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--navy-light);
}

.btn-teal {
  background: var(--teal);
  color: #fff;
}

.btn-teal:hover:not(:disabled) {
  background: var(--teal-dark);
}

.btn-green {
  background: var(--green);
  color: #fff;
}

.btn-green:hover:not(:disabled) {
  background: #15803d;
}

.btn-secondary {
  background: #fff;
  color: var(--ink);
  border-color: #cbd5e1;
}

.btn-secondary:hover:not(:disabled) {
  background: #f8fafc;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 13px;
  border-radius: 9px;
}

/* Active Questionnaire Runner */
.runner-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.save-badge {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--teal-dark);
  background: var(--teal-soft);
  padding: 6px 12px;
  border-radius: 999px;
}

.step-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.step-pill {
  min-width: 38px;
  height: 36px;
  padding: 0 10px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-weight: 600;
  font-size: 12.5px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.step-pill.answered {
  background: #e6fffa;
  border-color: #5eead4;
  color: var(--teal-dark);
}

.step-pill.current {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

.question-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.question-number {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--teal);
  margin-bottom: 8px;
  display: block;
}

.question-title {
  font-size: 21px;
  line-height: 1.45;
  color: var(--navy);
  margin: 0 0 24px;
  font-weight: 700;
}

/* Melbourne Option Cards */
.options-list {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.option-btn {
  width: 100%;
  text-align: left;
  padding: 16px 18px;
  border-radius: 13px;
  border: 2px solid var(--line);
  background: #fff;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all 0.14s;
}

.option-btn:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

.option-btn.selected {
  border-color: var(--teal);
  background: #f0fdfa;
}

.option-radio {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.option-btn.selected .option-radio {
  border-color: var(--teal);
  background: var(--teal);
}

.option-btn.selected .option-radio::after {
  content: '';
  width: 8px;
  height: 8px;
  background: #fff;
  border-radius: 50%;
}

.option-label {
  font-weight: 600;
  font-size: 15.5px;
  color: var(--ink);
}

/* Estado de EGO Criteria & Alternatives */
.criteria-banner {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 18px;
}

.criteria-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.criteria-chip {
  background: #fff;
  border: 1px solid var(--line);
  padding: 8px 12px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--navy);
}

.ego-alt-card {
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 14px;
  background: #fff;
  transition: border-color 0.15s;
}

.ego-alt-card.ranked {
  border-color: #99f6e4;
  background: #fafffe;
}

.ego-alt-text {
  font-size: 15px;
  line-height: 1.55;
  margin: 0 0 14px;
  color: var(--ink);
}

.rank-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

@media (max-width: 560px) {
  .rank-buttons {
    grid-template-columns: repeat(2, 1fr);
  }
}

.rank-btn {
  padding: 10px 8px;
  border-radius: 10px;
  border: 2px solid var(--line);
  background: #f8fafc;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: all 0.14s;
}

.rank-btn strong {
  font-size: 17px;
  color: var(--navy);
}

.rank-btn.used-elsewhere {
  opacity: 0.45;
}

.rank-btn.active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
  opacity: 1;
}

.rank-btn.active strong {
  color: #5eead4;
}

.runner-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  background: var(--navy);
  color: #fff;
  padding: 13px 20px;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.25);
  font-weight: 600;
  max-width: 92vw;
}

.toast.error {
  background: var(--red);
}
