/* InsertIT Firmas · motion continuity and private workspace refinement */

@property --score {
  syntax: '<number>';
  inherits: false;
  initial-value: 0;
}

.score-ring {
  --score-track: rgba(115, 87, 255, .09);
  isolation: isolate;
  background: conic-gradient(var(--score-color) calc(var(--score) * 1%), var(--score-track) 0);
  transform: translateZ(0);
}

.score-ring::after {
  content: '';
  grid-area: 1 / 1;
  width: calc(100% + 18px);
  height: calc(100% + 18px);
  border: 1px solid transparent;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}

.score-ring.is-critical {
  --score-track: rgba(202, 50, 76, .12);
  box-shadow: 0 24px 58px rgba(202, 50, 76, .18);
}

.score-ring.is-alerting::after {
  border-color: rgba(202, 50, 76, .58);
  animation: critical-result-alert 1.15s cubic-bezier(.23, 1, .32, 1) 1;
}

.score-ring[data-level='critical'] + .result-label { color: #a72e44; }
.score-ring[data-level='attention'] + .result-label { color: #99610d; }
.score-ring[data-level='progress'] + .result-label { color: #345db8; }
.score-ring[data-level='ready'] + .result-label { color: #147455; }

.quiz-step:not([hidden]) { will-change: transform, opacity; }

.calendar-page {
  animation: none !important;
  backface-visibility: hidden;
  will-change: auto;
}

.calendar-page.is-flipping {
  will-change: transform, opacity;
  animation: calendar-real-page-turn .78s cubic-bezier(.32, .72, .2, 1) 1 !important;
}

@keyframes critical-result-alert {
  0% { opacity: 0; transform: scale(.94); }
  22% { opacity: .8; }
  100% { opacity: 0; transform: scale(1.16); }
}

@keyframes calendar-real-page-turn {
  0% { opacity: 0; transform: perspective(520px) rotateX(0deg); }
  12% { opacity: .96; }
  72% { opacity: .28; transform: perspective(520px) rotateX(-112deg); }
  100% { opacity: 0; transform: perspective(520px) rotateX(-154deg); }
}

.portal-entry { background: #f7f7fb; }
.portal-entry .portal-main { padding-block: 28px 54px; }
.portal-entry-grid { grid-template-columns: minmax(0, .93fr) minmax(0, 1.07fr); gap: 16px; }

.portal-entry .portal-intro {
  display: flex;
  min-height: 590px;
  flex-direction: column;
  padding: 30px;
  border: 1px solid #ddd7ed;
  border-radius: 20px;
  background:
    radial-gradient(circle at 88% 6%, rgba(128, 91, 232, .18), transparent 30%),
    linear-gradient(150deg, #f6f1ff 0%, #fff 58%, #f3f1fb 100%);
  color: var(--text);
  box-shadow: 0 20px 55px rgba(44, 30, 79, .07);
}

.portal-entry .portal-intro::before {
  right: -120px;
  top: -140px;
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, rgba(126, 89, 230, .12), transparent 68%);
}

.portal-intro-copy { position: relative; z-index: 2; }
.portal-entry .portal-intro .status {
  border-color: #ddd4f2;
  background: rgba(255, 255, 255, .72);
  color: #554778;
}

.portal-entry .portal-intro h1 {
  max-width: 12ch;
  margin: 22px 0 15px;
  color: #17131f;
  font-size: clamp(2.45rem, 3.1vw, 3.25rem);
  line-height: .99;
  letter-spacing: -.04em;
  text-wrap: balance;
}

.portal-entry .portal-intro p {
  max-width: 57ch;
  margin: 0;
  color: #625d70;
  font-size: .76rem;
  line-height: 1.7;
}

.portal-flow {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 31px;
}

.portal-flow-line {
  position: absolute;
  z-index: -1;
  top: 22px;
  left: 12%;
  right: 12%;
  height: 1px;
  background: linear-gradient(90deg, #c8b4ec, #8664d6, #c8b4ec);
}

.portal-flow-step { display: grid; justify-items: center; gap: 9px; min-width: 0; text-align: center; }
.portal-flow-step > i {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid #d9ccee;
  border-radius: 13px;
  background: #fff;
  color: #704bc7;
  box-shadow: 0 9px 22px rgba(78, 48, 133, .08);
}
.portal-flow-step span { display: grid; gap: 2px; min-width: 0; }
.portal-flow-step strong { font-size: .66rem; line-height: 1.25; }
.portal-flow-step small { color: #777181; font-size: .55rem; }

.portal-insy-dock {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 156px;
  align-items: center;
  gap: 12px;
  overflow: hidden;
  min-height: 168px;
  margin-top: auto;
  padding: 22px 12px 14px 22px;
  border: 1px solid rgba(108, 76, 175, .14);
  border-radius: 16px;
  background: rgba(255, 255, 255, .7);
}
.portal-insy-dock::after {
  content: '';
  position: absolute;
  right: -25px;
  bottom: -55px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(126, 89, 230, .08);
}
.portal-insy-dock > div { position: relative; z-index: 2; display: grid; gap: 7px; }
.portal-insy-dock strong { font-family: Sora, sans-serif; font-size: .82rem; letter-spacing: -.02em; }
.portal-insy-dock span { max-width: 34ch; color: #676170; font-size: .64rem; line-height: 1.55; }
.portal-insy-dock img {
  position: relative;
  z-index: 2;
  align-self: end;
  width: 150px;
  max-height: 156px;
  object-fit: contain;
  filter: drop-shadow(0 16px 20px rgba(48, 31, 72, .18));
}

.portal-entry .portal-actions-grid { gap: 12px; }
.portal-entry .portal-action-card {
  min-height: 228px;
  padding: 23px;
  border-radius: 16px;
  box-shadow: 0 14px 40px rgba(38, 29, 63, .055);
}
.portal-entry .portal-action-card h2 { margin: 17px 0 8px; font-size: 1.42rem; letter-spacing: -.03em; }
.portal-entry .portal-action-card p { max-width: 44ch; color: #65606e; font-size: .7rem; line-height: 1.62; }
.portal-entry .portal-action-card .feature-icon { border-radius: 12px; }

.portal-operations {
  grid-column: 1 / -1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #fff;
  box-shadow: 0 14px 40px rgba(38, 29, 63, .05);
}
.portal-operations-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--line);
}
.portal-operations-head h2 { margin: 0 0 4px; font-size: 1.25rem; letter-spacing: -.025em; }
.portal-operations-head p { margin: 0; color: #77717f; font-size: .65rem; }
.portal-operations-head .status { flex: none; }

.portal-stat-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.portal-stat-list article { min-width: 0; padding: 20px 22px; border-right: 1px solid var(--line); }
.portal-stat-list article:last-child { border-right: 0; }
.portal-stat-list span { display: flex; align-items: center; gap: 7px; color: #665f70; font-size: .61rem; font-weight: 760; }
.portal-stat-list span svg { color: #7653cf; }
.portal-stat-list strong {
  display: block;
  margin-top: 15px;
  font-family: Sora, sans-serif;
  font-size: 2rem;
  line-height: 1;
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
}
.portal-stat-list small { display: block; margin-top: 7px; color: #8b8592; font-size: .56rem; }

.portal-latest {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 16px 22px;
  border-top: 1px solid var(--line);
  background: #faf9fd;
  color: #6d4fc1;
}
.portal-latest > div { display: grid; gap: 3px; min-width: 0; color: var(--text); }
.portal-latest strong { font-size: .65rem; }
.portal-latest span { overflow: hidden; color: #77717f; font-size: .59rem; text-overflow: ellipsis; white-space: nowrap; }
.portal-latest a { display: flex; align-items: center; gap: 6px; color: #6241bd; font-size: .62rem; font-weight: 800; }

@media (hover: hover) and (pointer: fine) {
  .portal-entry .portal-action-card:hover { transform: translateY(-2px); }
  .portal-latest a:hover { color: #43248f; }
}

@media (max-width: 980px) {
  .portal-entry-grid { grid-template-columns: 1fr; }
  .portal-entry .portal-intro { min-height: 520px; }
}

@media (max-width: 640px) {
  .portal-entry .portal-main { padding-block: 18px 38px; }
  .portal-entry .portal-intro { min-height: auto; padding: 22px; border-radius: 17px; }
  .portal-entry .portal-intro h1 { max-width: 13ch; margin-top: 18px; font-size: 2.25rem; }
  .portal-entry .portal-intro p { font-size: .7rem; }
  .portal-flow { grid-template-columns: 1fr; gap: 9px; margin-top: 24px; }
  .portal-flow-line { top: 22px; bottom: 22px; left: 21px; right: auto; width: 1px; height: auto; }
  .portal-flow-step { grid-template-columns: 44px minmax(0, 1fr); align-items: center; justify-items: start; text-align: left; }
  .portal-flow-step span { padding-left: 3px; }
  .portal-insy-dock { grid-template-columns: minmax(0, 1fr) 112px; min-height: 135px; margin-top: 22px; padding: 18px 8px 10px 18px; }
  .portal-insy-dock img { width: 108px; max-height: 125px; }
  .portal-insy-dock span { font-size: .59rem; }
  .portal-entry .portal-actions-grid { grid-template-columns: 1fr; }
  .portal-entry .portal-action-card { min-height: 205px; }
  .portal-operations-head { align-items: flex-start; flex-direction: column; padding: 19px; }
  .portal-stat-list { grid-template-columns: 1fr; }
  .portal-stat-list article { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 12px; padding: 15px 19px; border-right: 0; border-bottom: 1px solid var(--line); }
  .portal-stat-list article:last-child { border-bottom: 0; }
  .portal-stat-list strong { grid-column: 2; grid-row: 1 / 3; margin: 0; font-size: 1.65rem; }
  .portal-stat-list small { margin-top: 4px; }
  .portal-latest { grid-template-columns: auto minmax(0, 1fr); padding: 15px 19px; }
  .portal-latest a { grid-column: 2; justify-self: start; margin-top: 3px; }
}

@media (prefers-reduced-motion: reduce) {
  .score-ring.is-alerting::after,
  .calendar-page.is-flipping { animation: none !important; }
  .quiz-step:not([hidden]) { will-change: auto; }
}
