/* ============================================================
   Teach for Poland — Portal Design Tokens
   Shared across login, teacher portal, and staff portal.
   ============================================================ */

:root {
  --tfp-bg-warm: #F6F3EC;
  --tfp-surface: #FFFFFF;
  --tfp-surface-muted: #FBFAF6;
  --tfp-teal: #1F8A8A;
  --tfp-teal-light: #2BB3B3;
  --tfp-teal-soft: rgba(31, 138, 138, 0.08);
  --tfp-teal-soft-border: rgba(31, 138, 138, 0.14);
  --tfp-teal-icon-bg: rgba(43, 179, 179, 0.12);
  --tfp-coral: #EE5A52;
  --tfp-coral-icon-bg: rgba(238, 90, 82, 0.1);
  --tfp-ink: #14181C;
  --tfp-ink-2: #3A4148;
  --tfp-ink-3: #6B7480;
  --tfp-ink-icon-bg: rgba(20, 24, 28, 0.06);
  --tfp-border: #E7E4DC;
  --tfp-chart-1: #EE5A52;
  --tfp-chart-2: #F4A261;
  --tfp-chart-3: #2BB3B3;
  --tfp-chart-4: #1F8A8A;
  --tfp-chart-5: #6B7480;
  --tfp-radius-sm: 10px;
  --tfp-radius-md: 12px;
  --tfp-radius-lg: 16px;
  --tfp-sidebar-width: 260px;
  --tfp-font-display: "Instrument Serif", Georgia, "Times New Roman", serif;
  --tfp-font-ui: "Geist", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}
/* ============================================================
   Teach for Poland — Login Page
   Editorial split-screen layout with warm cream background,
   Instrument Serif display type and Geist sans-serif body.
   ============================================================ */

:root {
  --tfp-login-teal:       var(--tfp-teal-light);
  --tfp-login-teal-deep:  var(--tfp-teal);
  --tfp-login-coral:      var(--tfp-coral);
  --tfp-login-coral-deep: #D9433B;
  --tfp-login-ink:        var(--tfp-ink);
  --tfp-login-ink-2:      var(--tfp-ink-2);
  --tfp-login-ink-3:      var(--tfp-ink-3);
  --tfp-login-line:       var(--tfp-border);
  --tfp-login-bg:         var(--tfp-bg-warm);
  --tfp-login-card:       var(--tfp-surface);
  --tfp-login-field:      var(--tfp-surface-muted);
}

/* Override the global login-body background so the warm cream shows through. */
body.login-body {
  background: var(--tfp-login-bg);
  font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  color: var(--tfp-login-ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.login-body * {
  box-sizing: border-box;
}

/* ---------- Shell ---------- */
.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 24px;
  position: relative;
}

/* ---------- LEFT: form panel ---------- */
.login-panel {
  background: var(--tfp-login-card);
  border-radius: 20px;
  border: 1px solid var(--tfp-login-line);
  box-shadow:
    0 1px 0 rgba(20, 24, 28, 0.02),
    0 24px 60px -40px rgba(20, 24, 28, 0.18);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.login-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 32px;
}

.login-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--tfp-login-ink);
  text-decoration: none;
}

.login-brand-logo {
  height: 100px;
  width: auto;
  display: block;
}

.login-top-link {
  font-size: 13px;
  color: var(--tfp-login-ink-3);
}

.login-top-link a {
  color: var(--tfp-login-ink);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid var(--tfp-login-line);
  padding-bottom: 1px;
  margin-left: 4px;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.login-top-link a:hover {
  border-color: var(--tfp-login-teal);
  color: var(--tfp-login-teal-deep);
}

.login-top-link-action {
  color: var(--tfp-login-ink-3);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid var(--tfp-login-line);
  padding-bottom: 1px;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.login-top-link-action:hover {
  color: var(--tfp-login-teal-deep);
  border-color: var(--tfp-login-teal);
}

.login-panel-head-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.login-locale-form {
  display: flex;
  align-items: center;
  gap: 10px;
}

.login-locale-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--tfp-login-ink-3);
  white-space: nowrap;
}

.login-locale-select-wrap {
  position: relative;
}

.login-locale-select {
  appearance: none;
  border: 1px solid var(--tfp-login-line);
  border-radius: 999px;
  background: var(--tfp-login-field);
  color: var(--tfp-login-ink);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  padding: 8px 32px 8px 14px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 20 20' fill='none' stroke='%23667085' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 8l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.login-locale-select:focus {
  outline: none;
  border-color: var(--tfp-login-teal);
  box-shadow: 0 0 0 3px rgba(43, 179, 179, 0.14);
}

.login-panel-body {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 24px 32px 40px;
}

.login-form-wrap {
  width: 100%;
  max-width: 408px;
}

.login-title {
  font-family: 'Instrument Serif', 'Times New Roman', serif;
  font-weight: 400;
  font-size: 44px;
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
  color: var(--tfp-login-ink);
}

.login-title em {
  font-style: italic;
  color: var(--tfp-login-teal-deep);
}

.login-subtitle {
  color: var(--tfp-login-ink-3);
  font-size: 15px;
  line-height: 1.5;
  margin: 0 0 28px;
}

/* ---------- Flash messages ---------- */
.login-flash {
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.4;
  margin-bottom: 18px;
  border: 1px solid transparent;
}

.login-flash.is-alert {
  background: rgba(238, 90, 82, 0.08);
  border-color: rgba(238, 90, 82, 0.25);
  color: var(--tfp-login-coral-deep);
}

.login-flash.is-notice {
  background: rgba(43, 179, 179, 0.08);
  border-color: rgba(43, 179, 179, 0.25);
  color: var(--tfp-login-teal-deep);
}

/* ---------- Form fields ---------- */
.login-field {
  display: block;
  margin-bottom: 14px;
}

.login-field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--tfp-login-ink-2);
  margin-bottom: 6px;
}

.login-field-input {
  position: relative;
}

.login-field-input input {
  width: 100%;
  height: 48px;
  padding: 0 44px 0 14px;
  border-radius: 12px;
  border: 1px solid var(--tfp-login-line);
  background: var(--tfp-login-field);
  font: inherit;
  font-size: 15px;
  color: var(--tfp-login-ink);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

.login-field-input input::placeholder {
  color: #9AA2AC;
}

.login-field-input input:hover {
  border-color: #D9D5CB;
}

.login-field-input input:focus {
  border-color: var(--tfp-login-teal);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(43, 179, 179, 0.14);
}

.login-field-input input:-webkit-autofill,
.login-field-input input:-webkit-autofill:hover,
.login-field-input input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--tfp-login-ink);
  -webkit-box-shadow: 0 0 0 40px var(--tfp-login-field) inset;
  transition: background-color 5000s ease-in-out 0s;
}

.login-field-input .login-icon-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  color: var(--tfp-login-ink-3);
  display: grid;
  place-items: center;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  border-radius: 6px;
  transition: color 0.15s ease, background 0.15s ease;
}

.login-field-input .login-icon-btn:hover {
  color: var(--tfp-login-ink);
  background: rgba(20, 24, 28, 0.05);
}

/* ---------- Row between (checkbox + forgot) ---------- */
.login-row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 6px 0 22px;
}

.login-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--tfp-login-ink-2);
  user-select: none;
  cursor: pointer;
}

.login-check input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1.5px solid #C8C2B4;
  background: #fff;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  margin: 0;
  transition: all 0.15s;
}

.login-check input[type="checkbox"]:checked {
  background: var(--tfp-login-ink);
  border-color: var(--tfp-login-ink);
}

.login-check input[type="checkbox"]:checked::after {
  content: "";
  width: 10px;
  height: 10px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='3 8.5 7 12 13 5'/></svg>") center/contain no-repeat;
}

.login-forgot {
  font-size: 14px;
  color: var(--tfp-login-ink);
  text-decoration: none;
  border-bottom: 1px solid var(--tfp-login-line);
  padding-bottom: 1px;
  transition: color 0.15s, border-color 0.15s;
}

.login-forgot:hover {
  color: var(--tfp-login-coral-deep);
  border-color: var(--tfp-login-coral);
}

.login-form-actions {
  margin-top: 8px;
}

.login-field-hint {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--tfp-login-ink-3);
}

.login-flash-list {
  margin: 0;
  padding-left: 18px;
}

.login-flash-list li + li {
  margin-top: 4px;
}

/* ---------- Buttons ---------- */
.login-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 52px;
  border-radius: 12px;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s, box-shadow 0.15s;
  border: 1px solid transparent;
  -webkit-appearance: none;
  appearance: none;
}

.login-btn-primary {
  background: var(--tfp-login-ink);
  color: #fff;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 8px 20px -10px rgba(20, 24, 28, 0.5);
}

.login-btn-primary:hover {
  background: #000;
}

.login-btn-primary:active {
  transform: translateY(1px);
}

.login-btn-primary .login-arrow {
  width: 16px;
  height: 16px;
  transition: transform 0.2s;
}

.login-btn-primary:hover .login-arrow {
  transform: translate(2px, 0);
}

/* Force override against broad ActiveAdmin input styles */
body.login-body input[type="submit"].login-btn,
body.login-body input[type="submit"].login-btn-primary {
  background: var(--tfp-login-ink) !important;
  color: #ffffff !important;
  border: 1px solid transparent !important;
  text-shadow: none !important;
}

body.login-body input[type="submit"].login-btn-primary:hover {
  background: #000 !important;
}

/* ---------- Footer ---------- */
.login-panel-foot {
  padding: 20px 32px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--tfp-login-ink-3);
  font-size: 12px;
  border-top: 1px solid var(--tfp-login-line);
}

.login-panel-foot .login-foot-links {
  display: flex;
  gap: 18px;
}

.login-panel-foot a {
  color: var(--tfp-login-ink-3);
  text-decoration: none;
  transition: color 0.15s;
}

.login-panel-foot a:hover {
  color: var(--tfp-login-ink);
}

/* ---------- RIGHT: image stage ---------- */
.login-stage {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: #1a1a1a;
  isolation: isolate;
}

.login-stage .login-hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 62% center;
  z-index: 0;
}

.login-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(11, 30, 32, 0.18) 0%, rgba(11, 30, 32, 0) 35%, rgba(11, 30, 32, 0) 55%, rgba(11, 18, 20, 0.7) 100%),
    radial-gradient(120% 80% at 80% 10%, rgba(43, 179, 179, 0.18) 0%, rgba(43, 179, 179, 0) 55%);
  z-index: 1;
}

.login-stage-bottom {
  position: absolute;
  left: 40px;
  right: 40px;
  bottom: 40px;
  z-index: 2;
  color: #fff;
}

.login-stage-headline {
  font-family: 'Instrument Serif', 'Times New Roman', serif;
  font-weight: 400;
  font-size: 52px;
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin: 0 0 14px;
  color: #fff;
  text-shadow: 0 1px 30px rgba(0, 0, 0, 0.35);
}

.login-stage-headline span {
  display: block;
}

.login-stage-headline em {
  font-style: italic;
  color: var(--tfp-login-teal);
}

.login-stage-bottom .login-stage-text {
  font-family: 'Geist', sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.85);
  max-width: 540px;
  margin: 0;
  text-shadow: 0 1px 20px rgba(0, 0, 0, 0.35);
}

/* Slim coral/teal accent strip — echoes the logo bookmark */
.login-accent-strip {
  position: absolute;
  top: 0;
  left: 32px;
  display: flex;
  gap: 4px;
  z-index: 3;
}

.login-accent-strip span {
  width: 4px;
  height: 64px;
  border-bottom-left-radius: 2px;
  border-bottom-right-radius: 2px;
}

.login-accent-strip span:first-child {
  background: var(--tfp-login-coral);
}

.login-accent-strip span:last-child {
  background: var(--tfp-login-teal);
}

/* ---------- Visually-hidden utility (a11y) ---------- */
.login-shell .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .login-shell {
    grid-template-columns: 1fr;
    padding: 16px;
    gap: 16px;
  }

  .login-stage {
    min-height: 320px;
    order: -1;
  }

  .login-title {
    font-size: 36px;
  }

  .login-stage-headline {
    font-size: 40px;
    margin-bottom: 12px;
  }

  .login-panel-head,
  .login-panel-body,
  .login-panel-foot {
    padding-left: 24px;
    padding-right: 24px;
  }
}

@media (max-width: 560px) {
  .login-panel-foot {
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }

  .login-stage-headline {
    font-size: 32px;
    line-height: 1.08;
  }
}
/* ============================================================
   Teach for Poland — Portal Dashboard (Survey Results)
   Paper Single Survey design — portal-* component prefix
   ============================================================ */

/* ---------- Layout Shell ---------- */
.portal-shell {
  display: flex;
  min-height: 100vh;
  font-family: var(--tfp-font-ui);
  background: var(--tfp-bg-warm);
  color: var(--tfp-ink);
}

/* ---------- Sidebar ---------- */
.portal-sidebar {
  width: var(--tfp-sidebar-width);
  min-width: var(--tfp-sidebar-width);
  background: var(--tfp-surface);
  border-right: 1px solid var(--tfp-border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-shrink: 0;
}

.portal-sidebar-top {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--tfp-surface);
}

.portal-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 20px;
  border-bottom: 1px solid var(--tfp-border);
  flex-shrink: 0;
}

.portal-brand-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.portal-brand-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.portal-brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.portal-brand-name {
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
  color: var(--tfp-ink);
}

.portal-brand-sub {
  font-size: 10px;
  font-weight: 600;
  color: var(--tfp-ink-3);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Navigation */
.portal-nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px 0 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.portal-nav-section-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--tfp-ink-3);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0 20px 6px;
}

.portal-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin: 2px 14px;
  border-radius: var(--tfp-radius-sm);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--tfp-ink-3);
  transition: background 0.15s ease, color 0.15s ease;
  border: 1px solid transparent;
}

.portal-nav-link:hover {
  background: var(--tfp-surface-muted);
  color: var(--tfp-ink-2);
}

.portal-nav-link.active {
  background: var(--tfp-teal-soft);
  border-color: var(--tfp-teal-soft-border);
  color: var(--tfp-teal);
  font-weight: 600;
}

.portal-nav-link.is-disabled {
  color: var(--tfp-ink-3);
  cursor: default;
  pointer-events: none;
}

.portal-nav-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: transparent;
  flex-shrink: 0;
}

.portal-nav-link.active .portal-nav-dot {
  background: var(--tfp-teal);
  box-shadow: 0 0 0 3px rgba(31, 138, 138, 0.12);
}

/* Sidebar Footer */
.portal-sidebar-footer {
  border-top: 1px solid var(--tfp-border);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--tfp-surface);
  flex-shrink: 0;
}

.portal-user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: var(--tfp-radius-md);
  border: 1px solid var(--tfp-border);
  background: var(--tfp-surface);
}

.portal-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--tfp-teal);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.portal-user-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.portal-user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--tfp-ink);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.portal-user-role {
  font-size: 12px;
  font-weight: 500;
  color: var(--tfp-ink-3);
}

.portal-locale-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.portal-locale-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--tfp-ink-3);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0 2px;
}

.portal-locale-form {
  margin: 0;
}

.portal-locale-select-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--tfp-radius-sm);
  border: 1px solid var(--tfp-border);
  background: var(--tfp-surface);
  overflow: hidden;
}

.portal-locale-select-wrap .portal-icon {
  flex-shrink: 0;
  color: var(--tfp-ink-3);
}

.portal-locale-select-wrap .portal-icon:last-of-type {
  pointer-events: none;
}

.portal-locale-select {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  color: var(--tfp-ink);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  padding: 0;
  min-width: 0;
}

.portal-locale-select:focus {
  outline: none;
}

.portal-logout-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  width: 100%;
  border-radius: var(--tfp-radius-sm);
  border: 1px solid var(--tfp-border);
  background: var(--tfp-surface);
  font-size: 13px;
  font-weight: 500;
  color: var(--tfp-ink-2);
  cursor: pointer;
  transition: background 0.15s ease;
  text-decoration: none;
}

.portal-logout-btn .portal-icon {
  flex-shrink: 0;
}

.portal-logout-btn:hover {
  background: var(--tfp-surface-muted);
}

.portal-sidebar-footer .button_to {
  margin: 0;
  width: 100%;
}

.portal-sidebar-footer .button_to button {
  width: 100%;
}

/* ---------- Main Content ---------- */
.portal-main {
  flex: 1;
  min-width: 0;
  padding: 32px 40px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* Page Header */
.portal-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 24px;
}

.portal-page-header-left {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.portal-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
}

.portal-eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--tfp-teal-light);
  flex-shrink: 0;
}

.portal-eyebrow-text {
  font-size: 11px;
  font-weight: 500;
  color: var(--tfp-ink-3);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.portal-page-title {
  font-family: var(--tfp-font-display);
  font-size: 36px;
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--tfp-ink);
  margin: 0;
}

.portal-page-title em {
  font-style: italic;
  color: var(--tfp-teal);
}

.portal-page-subtitle {
  font-size: 14px;
  font-weight: 500;
  color: var(--tfp-ink-3);
  margin: 0;
}

/* View mode toggle */
.portal-view-toggle {
  display: flex;
  align-items: center;
  padding: 2px;
  border-radius: var(--tfp-radius-sm);
  border: 1px solid var(--tfp-border);
  background: var(--tfp-surface);
  flex-shrink: 0;
  margin-top: 8px;
}

.portal-view-toggle-item {
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--tfp-ink-3);
  white-space: nowrap;
  text-decoration: none;
  transition: color 0.15s ease, background 0.15s ease;
}

.portal-view-toggle-item.is-active {
  background: var(--tfp-ink);
  color: #fff;
  font-weight: 600;
}

.portal-view-toggle-item:not(.is-active):hover {
  color: var(--tfp-ink-2);
}

/* Filters */
.portal-filters-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.portal-survey-filter {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.portal-filter-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--tfp-teal);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.portal-survey-select {
  height: 38px;
  padding: 0 32px 0 14px;
  background: var(--tfp-surface);
  border: 1px solid var(--tfp-teal-light);
  border-radius: var(--tfp-radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--tfp-ink);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' viewBox='0 0 256 256'%3E%3Cpolyline points='208 96 128 176 48 96' fill='none' stroke='%236B7480' stroke-linecap='round' stroke-linejoin='round' stroke-width='12'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  max-width: 280px;
}

.portal-survey-select:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(43, 179, 179, 0.2);
}

.portal-secondary-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.portal-filter-pill {
  height: 38px;
  padding: 0 32px 0 14px;
  background: var(--tfp-surface);
  border: 1px solid var(--tfp-border);
  border-radius: var(--tfp-radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--tfp-ink-2);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' viewBox='0 0 256 256'%3E%3Cpolyline points='208 96 128 176 48 96' fill='none' stroke='%236B7480' stroke-linecap='round' stroke-linejoin='round' stroke-width='12'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.portal-filter-pill:focus {
  outline: none;
  border-color: var(--tfp-teal);
  box-shadow: 0 0 0 2px rgba(31, 138, 138, 0.15);
}

.portal-reset-link {
  height: 38px;
  padding: 0 14px;
  background: var(--tfp-surface);
  border: 1px solid var(--tfp-border);
  border-radius: var(--tfp-radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--tfp-ink-3);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s ease;
  flex-shrink: 0;
}

.portal-reset-link .portal-icon {
  flex-shrink: 0;
}

.portal-reset-link:hover {
  background: var(--tfp-surface-muted);
  color: var(--tfp-ink-2);
}

/* Selected Survey Card */
.portal-selected-survey {
  padding: 20px 24px;
  border-radius: var(--tfp-radius-lg);
  border: 1px solid var(--tfp-border);
  background: var(--tfp-surface);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.portal-selected-survey-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--tfp-teal);
}

.portal-selected-survey-name {
  margin: 0;
  font-family: var(--tfp-font-display);
  font-size: 24px;
  font-weight: 400;
  line-height: 1.2;
  color: var(--tfp-ink);
  overflow-wrap: anywhere;
}

.portal-selected-survey-meta {
  font-size: 13px;
  color: var(--tfp-ink-3);
  margin: 0;
}

/* Stats Row */
.portal-stats-row {
  display: flex;
  gap: 20px;
}

.portal-stat-card {
  flex: 1;
  min-width: 0;
  background: var(--tfp-surface);
  border-radius: var(--tfp-radius-lg);
  border: 1px solid var(--tfp-border);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.portal-stat-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--tfp-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.portal-stat-icon .portal-icon {
  flex-shrink: 0;
}

.portal-stat-icon.teal { background: var(--tfp-teal-icon-bg); color: var(--tfp-teal); }
.portal-stat-icon.ink  { background: var(--tfp-ink-icon-bg); color: var(--tfp-ink); }
.portal-stat-icon.coral { background: var(--tfp-coral-icon-bg); color: var(--tfp-coral); }

.portal-stat-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--tfp-ink-3);
}

.portal-stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--tfp-ink);
  line-height: 1.2;
}

/* Section Header */
.portal-section-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.portal-section-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.portal-section-title {
  font-family: var(--tfp-font-display);
  font-size: 20px;
  font-weight: 400;
  line-height: 1.2;
  color: var(--tfp-ink);
  margin: 0;
}

.portal-section-subtitle {
  font-size: 13px;
  line-height: 1.4;
  color: var(--tfp-ink-3);
  margin: 0;
}

.portal-export-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--tfp-radius-sm);
  border: 1px solid var(--tfp-border);
  background: var(--tfp-surface);
  font-size: 13px;
  font-weight: 500;
  color: var(--tfp-ink);
  cursor: not-allowed;
  opacity: 0.85;
  flex-shrink: 0;
  white-space: nowrap;
}

.portal-export-btn .portal-icon {
  flex-shrink: 0;
}

/* Chart Grid — 2 columns */
.portal-chart-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.portal-chart-row {
  display: flex;
  gap: 20px;
}

.portal-chart-row > .portal-chart-card:only-child {
  flex: 0 1 calc(50% - 10px);
}

.portal-chart-card {
  flex: 1;
  min-width: 0;
  background: var(--tfp-surface);
  border-radius: var(--tfp-radius-lg);
  border: 1px solid var(--tfp-border);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.portal-dim-badge {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  height: 26px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--tfp-teal-icon-bg);
  color: var(--tfp-teal);
}

.portal-chart-question {
  font-size: 15px;
  font-weight: 600;
  color: var(--tfp-ink);
  margin: 0;
  line-height: 1.45;
}

.portal-chart-row-inner {
  display: flex;
  align-items: center;
  gap: 24px;
}

.portal-pie-wrap {
  width: 120px;
  height: 120px;
  flex-shrink: 0;
  position: relative;
}

.portal-pie-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

.portal-chart-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.portal-legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.portal-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}

.portal-legend-label {
  flex: 1;
  min-width: 0;
  color: var(--tfp-ink);
  font-weight: 400;
  overflow-wrap: anywhere;
}

.portal-legend-value {
  font-weight: 600;
  color: var(--tfp-ink);
  white-space: nowrap;
  width: 44px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.portal-no-chart-data {
  color: var(--tfp-ink-3);
  font-size: 14px;
  margin: 0;
  padding: 16px 0;
}

/* Icons */
svg.portal-icon {
  display: block;
  flex-shrink: 0;
  overflow: visible;
}

/* Empty State */
.portal-empty-state {
  background: var(--tfp-surface);
  border: 2px dashed var(--tfp-border);
  border-radius: var(--tfp-radius-lg);
  padding: 48px 32px;
  text-align: center;
}

.portal-empty-state p {
  font-size: 15px;
  color: var(--tfp-ink-3);
  margin: 0;
}

/* Survey Empty State */
.portal-survey-empty-state,
.portal-single-empty-state {
  position: relative;
  overflow: hidden;
  background: var(--tfp-surface);
  border: 1px solid var(--tfp-border);
  border-radius: var(--tfp-radius-lg);
  padding: 56px 64px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.portal-survey-empty-main,
.portal-single-empty-main {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
}

.portal-survey-empty-leading,
.portal-single-empty-leading {
  display: flex;
  align-items: flex-start;
  gap: 32px;
  flex: 1;
  min-width: 0;
}

.portal-survey-empty-icon,
.portal-single-empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: var(--tfp-teal-icon-bg);
  flex-shrink: 0;
}

.portal-survey-empty-copy,
.portal-single-empty-copy {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  max-width: 560px;
}

.portal-survey-empty-eyebrow,
.portal-single-empty-eyebrow {
  margin: 0;
  font-family: var(--tfp-font-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--tfp-teal);
}

.portal-survey-empty-title,
.portal-single-empty-title {
  margin: 0;
  font-family: var(--tfp-font-display);
  font-size: 32px;
  font-weight: 400;
  line-height: 1.18;
  letter-spacing: -0.02em;
  color: var(--tfp-ink);
}

.portal-survey-empty-body,
.portal-single-empty-body {
  margin: 0;
  max-width: 480px;
  font-family: var(--tfp-font-ui);
  font-size: 15px;
  line-height: 1.6;
  color: var(--tfp-ink-3);
}

.portal-survey-empty-illustration,
.portal-single-empty-illustration {
  flex-shrink: 0;
  width: 154px;
  height: 162px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.portal-survey-empty-illustration img,
.portal-single-empty-illustration img {
  display: block;
  width: 154px;
  height: auto;
  max-height: 162px;
  object-fit: contain;
  object-position: center bottom;
}

.portal-survey-empty-divider,
.portal-single-empty-divider {
  position: relative;
  z-index: 1;
  height: 1px;
  background: var(--tfp-border);
}

.portal-survey-empty-steps,
.portal-single-empty-steps {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 32px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.portal-survey-empty-step,
.portal-single-empty-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.portal-survey-empty-step-badge,
.portal-single-empty-step-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  flex-shrink: 0;
  font-family: var(--tfp-font-ui);
  font-size: 12px;
  font-weight: 600;
  background: rgba(20, 24, 28, 0.08);
  color: var(--tfp-ink-3);
}

.portal-survey-empty-step--active .portal-survey-empty-step-badge,
.portal-single-empty-step--active .portal-single-empty-step-badge {
  background: var(--tfp-ink);
  color: var(--tfp-surface);
}

.portal-survey-empty-step--complete .portal-survey-empty-step-badge,
.portal-single-empty-step--complete .portal-single-empty-step-badge {
  background: var(--tfp-teal);
  color: var(--tfp-surface);
}

.portal-survey-empty-step-copy,
.portal-single-empty-step-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.portal-survey-empty-step-title,
.portal-single-empty-step-title {
  margin: 0;
  font-family: var(--tfp-font-ui);
  font-size: 14px;
  font-weight: 600;
  color: var(--tfp-ink);
}

.portal-survey-empty-step-action,
.portal-single-empty-step-action {
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
}

.portal-survey-empty-step-action:hover,
.portal-survey-empty-step-action:focus-visible,
.portal-single-empty-step-action:hover,
.portal-single-empty-step-action:focus-visible {
  color: var(--tfp-teal);
  outline: none;
}

.portal-survey-empty-step-action:focus-visible,
.portal-single-empty-step-action:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.portal-survey-empty-step-desc,
.portal-single-empty-step-desc {
  margin: 0;
  font-family: var(--tfp-font-ui);
  font-size: 13px;
  line-height: 1.54;
  color: var(--tfp-ink-3);
}

@media (max-width: 900px) {
  .portal-survey-empty-state,
  .portal-single-empty-state {
    padding: 40px 28px;
  }

  .portal-survey-empty-main,
  .portal-single-empty-main {
    flex-direction: column;
    gap: 24px;
  }

  .portal-survey-empty-leading,
  .portal-single-empty-leading {
    flex-direction: column;
    gap: 20px;
  }

  .portal-survey-empty-title,
  .portal-single-empty-title {
    font-size: 28px;
  }

  .portal-survey-empty-illustration,
  .portal-single-empty-illustration {
    align-self: center;
  }

  .portal-survey-empty-steps,
  .portal-single-empty-steps {
    flex-direction: column;
    gap: 20px;
  }
}

/* Staff extra filters */
.portal-staff-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .portal-chart-row {
    flex-direction: column;
  }
}

@media (max-width: 900px) {
  .portal-shell {
    flex-direction: column;
  }

  .portal-sidebar {
    width: 100%;
    min-width: 100%;
    height: auto;
    position: static;
    flex-direction: column;
  }

  .portal-sidebar-top {
    flex-direction: column;
  }

  .portal-nav {
    flex: none;
    overflow-y: visible;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 8px 12px;
  }

  .portal-nav-section-label {
    width: 100%;
    padding: 8px 14px 4px;
  }

  .portal-nav-link {
    margin: 2px 4px;
  }

  .portal-sidebar-footer {
    flex-direction: column;
  }

  .portal-main {
    padding: 20px 16px;
  }

  .portal-page-title {
    font-size: 28px;
  }

  .portal-stats-row {
    flex-direction: column;
  }

  .portal-chart-row-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 600px) {
  .portal-page-header {
    flex-direction: column;
  }

  .portal-secondary-filters {
    width: 100%;
  }

  .portal-filter-pill,
  .portal-survey-select {
    flex: 1;
    min-width: 0;
    max-width: none;
  }

  .portal-compare-survey-filters {
    flex-direction: column;
    align-items: stretch;
  }

  .portal-compare-arrow {
    justify-content: center;
  }

  .portal-comparison-banner {
    flex-direction: column;
  }

  .portal-comparison-vs {
    padding: 12px 0;
  }

  .portal-compare-pies {
    flex-direction: column;
  }

  .portal-compare-pies-divider {
    width: 100%;
    height: 1px;
  }
}

/* ---------- Compare mode ---------- */
.portal-filter-label-baseline {
  color: var(--tfp-teal);
}

.portal-survey-select-baseline {
  border-color: var(--tfp-teal-light);
}

.portal-compare-survey-filters {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.portal-compare-survey-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.portal-compare-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  flex-shrink: 0;
  color: var(--tfp-ink-3);
}

.portal-comparison-banner {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--tfp-border);
  border-radius: var(--tfp-radius-lg);
  background: var(--tfp-surface);
  overflow: hidden;
}

.portal-comparison-panel {
  flex: 1;
  min-width: 0;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.portal-comparison-panel.baseline {
  background: rgba(43, 179, 179, 0.06);
}

.portal-comparison-panel-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--tfp-teal);
}

.portal-comparison-panel-label.muted {
  color: var(--tfp-ink-3);
}

.portal-comparison-panel-name {
  margin: 0;
  font-family: var(--tfp-font-display);
  font-size: 22px;
  font-weight: 400;
  line-height: 1.2;
  color: var(--tfp-ink);
}

.portal-comparison-panel-meta {
  margin: 0;
  font-size: 13px;
  color: var(--tfp-ink-3);
}

.portal-comparison-vs {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  border-left: 1px solid var(--tfp-border);
  border-right: 1px solid var(--tfp-border);
  flex-shrink: 0;
}

.portal-comparison-vs span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--tfp-border);
  background: var(--tfp-bg-warm);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--tfp-ink-3);
}

.portal-compare-stats-row {
  align-items: stretch;
}

.portal-compare-stat-card {
  flex: 1;
}

.portal-compare-stat-questions {
  flex: 0 0 238px;
  max-width: 238px;
}

.portal-compare-stat-values {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.portal-compare-stat-values .portal-stat-value.teal {
  color: var(--tfp-teal);
}

.portal-compare-stat-arrow {
  font-size: 16px;
  color: var(--tfp-ink-3);
  font-weight: 500;
}

.portal-compare-delta-badge {
  display: inline-flex;
  align-self: flex-start;
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.portal-compare-delta-badge.positive {
  background: rgba(43, 179, 179, 0.1);
  color: var(--tfp-teal);
}

.portal-compare-delta-badge.negative {
  background: rgba(238, 90, 82, 0.1);
  color: #D9433B;
}

.portal-compare-shift-question {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--tfp-ink-3);
}

.portal-compare-section-header .portal-section-header-top {
  align-items: center;
}

.portal-compare-section-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.portal-compare-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.portal-compare-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--tfp-ink-3);
}

.portal-compare-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.portal-compare-legend-dot.baseline {
  background: var(--tfp-teal);
}

.portal-compare-legend-dot.comparison {
  background: var(--tfp-ink);
}

.portal-export-btn-active {
  cursor: pointer;
  opacity: 1;
  text-decoration: none;
}

.portal-export-btn-active:hover {
  background: var(--tfp-surface-muted);
}

.portal-compare-chart-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.portal-compare-question-card {
  background: var(--tfp-surface);
  border: 1px solid var(--tfp-border);
  border-radius: var(--tfp-radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.portal-compare-question-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.portal-compare-agree-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--tfp-border);
  background: var(--tfp-bg-warm);
}

.portal-compare-agree-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--tfp-ink-3);
  flex-shrink: 0;
}

.portal-compare-agree-value {
  font-size: 12px;
  font-weight: 600;
  color: var(--tfp-ink);
}

.portal-compare-agree-value.baseline {
  color: var(--tfp-teal);
}

.portal-compare-agree-arrow {
  color: var(--tfp-ink-3);
  font-size: 12px;
}

.portal-compare-agree-delta {
  font-size: 11px;
  font-weight: 600;
  margin-left: auto;
}

.portal-compare-agree-delta.positive {
  color: var(--tfp-teal);
}

.portal-compare-agree-delta.negative {
  color: #D9433B;
}

.portal-compare-pies {
  display: flex;
  gap: 12px;
  align-items: stretch;
}

.portal-compare-pies-divider {
  width: 1px;
  background: var(--tfp-border);
  flex-shrink: 0;
}

.portal-compare-pie-column {
  flex: 1;
  min-width: 0;
  padding: 14px;
  border-radius: var(--tfp-radius-md);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.portal-compare-pie-column.baseline {
  background: rgba(43, 179, 179, 0.05);
  border: 1px solid rgba(43, 179, 179, 0.12);
}

.portal-compare-pie-column.comparison {
  background: var(--tfp-surface);
  border: 1px solid var(--tfp-border);
}

.portal-compare-pie-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--tfp-teal);
}

.portal-compare-pie-column.comparison .portal-compare-pie-label {
  color: var(--tfp-ink-3);
}

.portal-compare-pie-inner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.portal-compare-pie-wrap {
  width: 96px;
  height: 96px;
}

.portal-compare-pie-legend .portal-legend-label {
  font-size: 11px;
}

.portal-compare-pie-legend .portal-legend-value {
  font-size: 11px;
}

@media (max-width: 1100px) {
  .portal-compare-stat-questions {
    flex: 1;
    max-width: none;
  }

  .portal-compare-pie-inner {
    flex-direction: column;
  }
}
/* ============================================================
   Powered by Blinq — shared attribution
   ============================================================ */

.tfp-powered-by {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  text-decoration: none;
  color: var(--tfp-ink-3);
  opacity: 0.78;
  transition: opacity 0.2s ease, color 0.2s ease;
}

.tfp-powered-by:hover {
  opacity: 1;
  color: var(--tfp-ink-2);
}

.tfp-powered-by:focus-visible {
  opacity: 1;
  color: var(--tfp-ink);
  outline: 2px solid var(--tfp-teal-soft-border);
  outline-offset: 4px;
  border-radius: 6px;
}

.tfp-powered-by-label {
  font-family: var(--tfp-font-ui);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1;
  white-space: nowrap;
}

.tfp-powered-by-logo {
  display: block;
  height: 24px;
  width: auto;
  opacity: 0.92;
  transition: opacity 0.2s ease;
}

.tfp-powered-by:hover .tfp-powered-by-logo,
.tfp-powered-by:focus-visible .tfp-powered-by-logo {
  opacity: 1;
}

.portal-powered-by {
  margin-top: auto;
  padding-top: 40px;
  display: flex;
  justify-content: flex-end;
  width: 100%;
}

.login-powered-by {
  position: absolute;
  right: 32px;
  bottom: 32px;
  z-index: 5;
}

@media (max-width: 900px) {
  .login-powered-by {
    right: 20px;
    bottom: 20px;
  }

  .portal-powered-by {
    padding-top: 28px;
  }
}
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *





 */

/* ============================================================
   Teach for Poland — Brand Design Tokens
   Primary Red:   #EA4745
   Primary Navy:  #0F345D
   Accent Teal:   #4CD2D7
   Text Dark:     #222330
   ============================================================ */

:root {
  /* Brand Palette */
  --tfp-red:          #EA4745;
  --tfp-red-dark:     #D03634;
  --tfp-red-light:    #F07F7D;
  --tfp-navy:         #0F345D;
  --tfp-navy-light:   #1A4A7A;
  --tfp-teal:         #4CD2D7;
  --tfp-teal-dark:    #1D898B;
  --tfp-teal-light:   #7BC9CB;

  /* Neutral Palette */
  --tfp-text:         #222330;
  --tfp-text-secondary: #4b5563;
  --tfp-text-muted:   #6b7280;
  --tfp-border:       #e5e7eb;
  --tfp-border-dark:  #d1d5db;
  --tfp-bg:           #f8f9fb;
  --tfp-bg-card:      #ffffff;
  --tfp-bg-subtle:    #f3f4f6;
}

/* Base Application Styles */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--tfp-bg);
  color: var(--tfp-text);
  line-height: 1.5;
}

/* Login Body — no background so the split layout fills the viewport */
body.login-body {
  background-color: var(--tfp-login-bg);
}

/* Portal Body — survey dashboard and future teacher portal pages */
body.portal-body {
  background-color: var(--tfp-bg-warm);
  font-family: var(--tfp-font-ui);
  color: var(--tfp-ink);
  -webkit-font-smoothing: antialiased;
}

body.portal-body .flash {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  max-width: 600px;
  width: 90%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Flash Messages */
.flash {
  max-width: 1400px;
  margin: 1rem auto;
  padding: 1rem 1.25rem;
  border-radius: 8px;
  font-size: 0.9375rem;
  font-weight: 500;
}

.flash-notice {
  background-color: #ecfdf5;
  color: #065f46;
  border: 1px solid var(--tfp-teal-light);
}

.flash-alert {
  background-color: #fef2f2;
  color: #991b1b;
  border: 1px solid var(--tfp-red-light);
}
