/* ==========================================================================
   PORTAL DE ALUNOS & EQ 360° — STYLESHEET + PRINT/PDF EXECUTIVE LAYOUT
   ========================================================================== */

body.portal-body {
  background: var(--slate-100);
  min-height: 100vh;
}

/* ==================== AUTH / LOGIN SCREEN ==================== */
.auth-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  background: var(--navy-950);
}

.auth-brand-pane {
  padding: 56px 48px;
  color: var(--white);
  background:
    radial-gradient(circle at 20% 20%, rgba(203, 161, 74, 0.2), transparent 48%),
    radial-gradient(circle at 80% 90%, rgba(15, 92, 78, 0.32), transparent 50%),
    linear-gradient(160deg, var(--navy-950) 0%, var(--navy-900) 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
}

.auth-logo-card {
  background: var(--white);
  padding: 12px 20px;
  border-radius: 14px;
  display: inline-block;
  width: fit-content;
  box-shadow: var(--shadow-md);
}

.auth-logo-card img {
  height: 58px;
  width: auto;
}

.auth-brand-pane h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.9rem, 3vw, 2.75rem);
  line-height: 1.15;
  margin: 14px 0;
}

.auth-brand-pane h1 span {
  color: var(--gold-300);
}

.auth-highlights {
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
  display: grid;
  gap: 12px;
}

.auth-highlights li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.92rem;
  color: var(--slate-200);
}

.auth-highlights li::before {
  content: '✦';
  color: var(--gold-300);
  flex-shrink: 0;
}

.auth-form-pane {
  background: var(--slate-50);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 28px;
  overflow-y: auto;
}

.auth-card {
  width: 100%;
  max-width: 480px;
  background: var(--white);
  border: var(--border-light);
  border-radius: var(--radius-xl);
  padding: 34px 32px;
  box-shadow: var(--shadow-lg);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--slate-100);
  padding: 4px;
  border-radius: var(--radius-md);
  margin-bottom: 22px;
}

.auth-tab {
  border: none;
  background: transparent;
  padding: 10px;
  border-radius: 9px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--slate-600);
  cursor: pointer;
}

.auth-tab.active {
  background: var(--white);
  color: var(--navy-900);
  box-shadow: var(--shadow-sm);
}

.demo-profiles-box {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px dashed var(--slate-300);
}

.demo-profiles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.demo-btn {
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: 10px;
  padding: 9px 10px;
  text-align: left;
  cursor: pointer;
  transition: all var(--transition);
}

.demo-btn:hover {
  border-color: var(--gold-500);
  background: var(--gold-100);
}

.demo-btn strong {
  display: block;
  font-size: 0.8rem;
  color: var(--navy-900);
}

.demo-btn span {
  display: block;
  font-size: 0.72rem;
  color: var(--slate-500);
}

/* ==================== PORTAL APP SHELL ==================== */
.portal-shell {
  display: grid;
  grid-template-columns: 272px 1fr;
  min-height: 100vh;
}

.portal-sidebar {
  background: linear-gradient(180deg, var(--navy-950) 0%, var(--navy-900) 100%);
  color: var(--white);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  background: var(--white);
  border-radius: 12px;
  padding: 10px 14px;
  text-align: center;
}

.sidebar-brand img {
  height: 44px;
  margin: 0 auto;
  object-fit: contain;
}

.sidebar-plan-box {
  background: rgba(203, 161, 74, 0.14);
  border: var(--border-gold);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.sidebar-plan-box span {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold-300);
  font-weight: 700;
}

.sidebar-plan-box strong {
  display: block;
  font-size: 0.9rem;
  color: var(--white);
  margin-top: 2px;
}

.sidebar-group-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--slate-400);
  font-weight: 700;
  padding: 8px 10px 4px;
}

.sidebar-nav {
  display: grid;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: transparent;
  border: none;
  color: var(--slate-300);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all var(--transition);
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(203, 161, 74, 0.24) 0%, rgba(203, 161, 74, 0.08) 100%);
  color: var(--gold-200);
  border-left: 3px solid var(--gold-400);
}

.nav-item.locked {
  opacity: 0.58;
}

.nav-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: grid;
  gap: 8px;
}

/* Main Content Area */
.portal-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.portal-topbar {
  background: var(--white);
  border-bottom: var(--border-light);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 40;
}

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

.sidebar-toggle-btn {
  display: none;
  background: var(--slate-100);
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  font-size: 1.15rem;
  cursor: pointer;
}

.topbar-title h2 {
  margin: 0;
  font-size: 1.15rem;
  color: var(--navy-900);
}

.topbar-title span {
  font-size: 0.78rem;
  color: var(--slate-500);
}

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

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--navy-900);
  color: var(--gold-300);
  font-weight: 800;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.portal-content {
  padding: 28px;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}

/* ==================== UI COMPONENTS ==================== */
.card {
  background: var(--white);
  border: var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.card-navy {
  background: linear-gradient(155deg, var(--navy-950) 0%, var(--navy-900) 100%);
  color: var(--white);
  border: var(--border-gold);
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.card-header h3 {
  margin: 0;
  font-size: 1.12rem;
  color: var(--navy-900);
}

.card-navy .card-header h3 {
  color: var(--white);
}

.card-header p {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: var(--slate-500);
}

.card-navy .card-header p {
  color: var(--slate-300);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

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

.stack-20 {
  display: grid;
  gap: 20px;
}

.kpi-card {
  background: var(--white);
  border: var(--border-light);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}

.kpi-card.highlight {
  border-top: 3px solid var(--gold-500);
}

.kpi-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--slate-500);
}

.kpi-value {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--navy-900);
  margin: 6px 0 4px;
}

.kpi-value.positive {
  color: var(--emerald-600);
}

.kpi-value.negative {
  color: var(--danger);
}

.kpi-value.muted {
  font-size: 1rem;
  color: var(--slate-400);
}

.kpi-sub {
  font-size: 0.78rem;
  color: var(--slate-500);
}

/* Progress Bar */
.progress-track {
  width: 100%;
  height: 10px;
  background: var(--slate-200);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--emerald-600), var(--gold-400));
  border-radius: var(--radius-full);
  transition: width 0.35s ease;
}

/* Alerts */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  border-left: 4px solid;
}

.alert-warning {
  background: var(--warning-bg);
  border-left-color: var(--warning);
  color: #78350f;
}

.alert-info {
  background: var(--info-bg);
  border-left-color: var(--info);
  color: #1e3a8a;
}

.alert-emerald {
  background: var(--emerald-100);
  border-left-color: var(--emerald-600);
  color: var(--navy-900);
}

.alert-gold {
  background: var(--gold-100);
  border-left-color: var(--gold-500);
  color: var(--navy-900);
}

/* Sub-tabs inside views */
.subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--slate-200);
  padding-bottom: 12px;
}

.subtab {
  border: 1px solid var(--slate-200);
  background: var(--white);
  color: var(--slate-700);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.subtab.active {
  background: var(--navy-900);
  color: var(--white);
  border-color: var(--navy-900);
}

/* Forms inside Portal */
.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--navy-900);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  color: var(--slate-900);
  background: var(--white);
}

.form-control:focus {
  outline: none;
  border-color: var(--gold-500);
  box-shadow: 0 0 0 3px rgba(184, 140, 50, 0.16);
}

/* Questionnaire Wizard */
.wizard-steps {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
  margin-bottom: 22px;
}

.wizard-step-btn {
  background: var(--slate-100);
  border: 1px solid var(--slate-200);
  border-radius: 10px;
  padding: 8px 6px;
  text-align: center;
  cursor: pointer;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--slate-600);
}

.wizard-step-btn.active {
  background: var(--navy-900);
  color: var(--gold-300);
  border-color: var(--navy-900);
}

.wizard-step-btn.done {
  background: var(--emerald-100);
  color: var(--emerald-700);
  border-color: rgba(15, 92, 78, 0.3);
}

.question-box {
  padding: 16px 18px;
  border: var(--border-light);
  border-radius: var(--radius-md);
  background: var(--slate-50);
  margin-bottom: 12px;
}

.question-box.business-q {
  background: #fdfaf2;
  border-color: rgba(184, 140, 50, 0.32);
}

.question-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  font-size: 0.78rem;
}

.certainty-toggle {
  display: inline-flex;
  border: 1px solid var(--slate-300);
  border-radius: 8px;
  overflow: hidden;
  background: var(--white);
}

.certainty-toggle button {
  border: none;
  background: transparent;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--slate-600);
}

.certainty-toggle button.active {
  background: var(--navy-900);
  color: var(--white);
}

/* Tables */
.data-table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.data-table th {
  text-align: left;
  padding: 11px 14px;
  background: var(--navy-900);
  color: var(--white);
  font-weight: 600;
  font-size: 0.8rem;
  white-space: nowrap;
}

.data-table th:first-child {
  border-radius: 8px 0 0 0;
}

.data-table th:last-child {
  border-radius: 0 8px 0 0;
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--slate-200);
  color: var(--slate-700);
  vertical-align: middle;
}

.data-table tr:hover td {
  background: var(--slate-50);
}

/* Chat / EQ Assistant */
.chat-shell {
  display: flex;
  flex-direction: column;
  height: 560px;
  border: var(--border-light);
  border-radius: var(--radius-lg);
  background: var(--white);
  overflow: hidden;
}

.chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--slate-50);
}

.chat-bubble {
  max-width: 82%;
  padding: 14px 16px;
  border-radius: 14px;
  font-size: 0.9rem;
  line-height: 1.55;
  white-space: pre-line;
}

.chat-bubble.user {
  align-self: flex-end;
  background: var(--navy-900);
  color: var(--white);
  border-bottom-right-radius: 4px;
}

.chat-bubble.assistant {
  align-self: flex-start;
  background: var(--white);
  color: var(--slate-800);
  border: var(--border-light);
  border-bottom-left-radius: 4px;
  box-shadow: var(--shadow-sm);
}

.chat-bubble.guardrail {
  border-left: 4px solid var(--warning);
  background: #fffbeb;
}

.chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 16px;
  background: var(--white);
  border-top: 1px solid var(--slate-200);
}

.chat-chip {
  background: var(--slate-100);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-full);
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--navy-900);
  cursor: pointer;
}

.chat-chip:hover {
  background: var(--gold-100);
  border-color: var(--gold-400);
}

.chat-input-bar {
  display: flex;
  gap: 10px;
  padding: 14px 16px;
  background: var(--white);
  border-top: 1px solid var(--slate-200);
}

/* Upgrade / Paywall Card */
.upgrade-gate {
  text-align: center;
  padding: 48px 28px;
  background: linear-gradient(160deg, var(--navy-950) 0%, var(--navy-900) 100%);
  color: var(--white);
  border-radius: var(--radius-xl);
  border: var(--border-gold);
}

.upgrade-gate h3 {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  margin: 14px 0 10px;
}

.upgrade-gate p {
  max-width: 560px;
  margin: 0 auto 22px;
  color: var(--slate-300);
}

/* Executive Report Sheet (Screen & Print/PDF) */
.report-document {
  background: var(--white);
  border: var(--border-light);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-md);
}

.report-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 22px;
  border-bottom: 3px solid var(--navy-900);
  margin-bottom: 28px;
}

.report-section {
  margin-bottom: 26px;
  page-break-inside: avoid;
}

.report-section h4 {
  font-size: 1rem;
  color: var(--white);
  background: var(--navy-900);
  padding: 8px 14px;
  border-radius: 6px;
  margin: 0 0 14px;
  border-left: 4px solid var(--gold-400);
}

/* Checklist rows */
.check-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: var(--border-light);
  border-radius: 10px;
  background: var(--slate-50);
  cursor: pointer;
}

.check-item.checked {
  background: var(--emerald-100);
  border-color: rgba(15, 92, 78, 0.28);
}

.check-item input[type="checkbox"] {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  accent-color: var(--emerald-600);
}

/* Responsive */
@media (max-width: 1024px) {
  .auth-screen {
    grid-template-columns: 1fr;
  }
  .auth-brand-pane {
    padding: 36px 24px;
  }
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-3 {
    grid-template-columns: 1fr;
  }
  .wizard-steps {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 860px) {
  .portal-shell {
    grid-template-columns: 1fr;
  }
  .portal-sidebar {
    position: fixed;
    left: -290px;
    top: 0;
    bottom: 0;
    width: 272px;
    z-index: 200;
    transition: left 0.25s ease;
  }
  .portal-sidebar.open {
    left: 0;
  }
  .sidebar-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .grid-2,
  .form-row {
    grid-template-columns: 1fr;
  }
  .portal-content {
    padding: 18px;
  }
}

/* ==================== PRINT / PDF EXPORT (PRD SEÇÃO 10) ==================== */
@media print {
  body.portal-body {
    background: #ffffff !important;
  }
  .portal-sidebar,
  .portal-topbar,
  .no-print,
  .toast-container {
    display: none !important;
  }
  .portal-shell {
    display: block !important;
  }
  .portal-content {
    padding: 0 !important;
    max-width: 100% !important;
  }
  .report-document {
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
  }
  .report-section h4 {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
