:root {
  --ink: #06435f;
  --muted: rgba(6, 67, 95, 0.72);
  --paper: #f3fbff;
  --surface: #ffffff;
  --sun: #ffca28;
  --orange: #ff8a1f;
  --coral: #ff5f3d;
  --berry: #0062d6;
  --red: #004fb0;
  --line: rgba(0, 98, 214, 0.16);
  --shadow: 0 24px 70px rgba(0, 98, 214, 0.16);
  --font-sans: "Source Sans 3", Arial, sans-serif;
  --font-serif: "Source Serif 4", Georgia, serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 4%, rgba(255, 138, 31, 0.2), transparent 28rem),
    radial-gradient(circle at 88% 12%, rgba(0, 98, 214, 0.16), transparent 24rem),
    linear-gradient(180deg, #ffffff 0%, var(--paper) 48%, #ffffff 100%);
}

button,
input,
select,
textarea {
  font-family: var(--font-sans);
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 76px;
  padding: 0.8rem clamp(1rem, 4vw, 4.5rem);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.login-header {
  position: relative;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.brand-logo {
  display: block;
  width: clamp(150px, 18vw, 218px);
  max-height: 56px;
  object-fit: contain;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: clamp(0.8rem, 2vw, 1.75rem);
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 700;
}

.main-nav a {
  border-bottom: 2px solid transparent;
  padding: 0.4rem 0;
}

.main-nav a:hover,
.main-nav a:focus-visible {
  color: var(--berry);
  border-color: var(--orange);
}

.login-button,
.primary-action,
.secondary-action,
.cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.login-button {
  min-width: 112px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--red), var(--berry));
  box-shadow: 0 12px 28px rgba(0, 98, 214, 0.2);
}

.login-button:hover,
.login-button:focus-visible,
.primary-action:hover,
.primary-action:focus-visible,
.cta-button:hover,
.cta-button:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 18px 38px rgba(0, 98, 214, 0.22);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(340px, 1.1fr);
  gap: clamp(1.6rem, 4vw, 4rem);
  align-items: center;
  min-height: calc(100vh - 76px);
  padding: clamp(2.6rem, 6vw, 5rem) clamp(1rem, 4vw, 4.5rem);
}

.hero-copy {
  max-width: 680px;
}

.eyebrow {
  margin: 0 0 0.9rem;
  color: var(--berry);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-family: var(--font-serif);
  max-width: 17ch;
  margin-bottom: 1.2rem;
  font-size: clamp(2.7rem, 5.4vw, 5rem);
  font-weight: 700;
  line-height: 1.03;
  letter-spacing: 0;
}

.hero-text {
  max-width: 62ch;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 2rem;
}

.primary-action {
  padding: 0.9rem 1.15rem;
  color: #ffffff;
  background: linear-gradient(135deg, var(--red), var(--berry) 54%, var(--orange));
}

.secondary-action {
  padding: 0.9rem 1.15rem;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line);
}

.secondary-action:hover,
.secondary-action:focus-visible {
  background: #eef8ff;
  transform: translateY(-2px);
}

.learning-preview {
  width: min(100%, 620px);
  justify-self: end;
  padding: clamp(1rem, 2vw, 1.4rem);
  background: linear-gradient(180deg, #ffffff, #edf8ff);
  border: 1px solid rgba(0, 98, 214, 0.14);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.preview-topbar {
  display: flex;
  gap: 0.5rem;
  padding-bottom: 1rem;
}

.preview-topbar span {
  width: 12px;
  height: 12px;
  background: var(--berry);
  border-radius: 50%;
}

.preview-topbar span:nth-child(2) {
  background: var(--sun);
}

.preview-topbar span:nth-child(3) {
  background: var(--orange);
}

.preview-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  background: linear-gradient(135deg, var(--red), var(--berry));
  border-radius: 8px;
  color: #ffffff;
}

.preview-header p {
  margin-bottom: 0.35rem;
  color: #d9f2ff;
  font-size: 0.83rem;
  font-weight: 700;
}

.preview-header strong {
  display: block;
  font-size: clamp(1.1rem, 2vw, 1.45rem);
  line-height: 1.25;
}

.progress-badge {
  flex: 0 0 auto;
  padding: 0.45rem 0.6rem;
  color: var(--ink);
  font-weight: 800;
  background: linear-gradient(135deg, var(--sun), var(--orange));
  border-radius: 8px;
}

.progress-track {
  height: 12px;
  margin: 1rem 0;
  overflow: hidden;
  background: #dcefff;
  border-radius: 999px;
}

.progress-track span {
  display: block;
  width: 72%;
  height: 100%;
  background: linear-gradient(90deg, var(--berry), #12aeea, var(--orange));
  border-radius: inherit;
}

.preview-grid {
  display: grid;
  gap: 0.85rem;
}

.preview-grid article {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 0.7rem 0.85rem;
  align-items: center;
  min-height: 112px;
  padding: 0.95rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.preview-grid p {
  grid-column: 2;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.card-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  color: #ffffff;
  font-weight: 800;
  background: var(--orange);
  border-radius: 8px;
}

.visual-icon {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.visual-icon::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.34), transparent 52%);
  pointer-events: none;
}

.visual-icon svg {
  position: relative;
  z-index: 1;
  width: 58%;
  height: 58%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.visual-icon.visual-icon--berry {
  color: #ffffff;
  background: linear-gradient(135deg, var(--red), var(--berry));
}

.visual-icon.visual-icon--orange {
  color: #ffffff;
  background: linear-gradient(135deg, var(--orange), var(--sun));
}

.visual-icon.visual-icon--coral {
  color: #ffffff;
  background: linear-gradient(135deg, var(--berry), #14b8f0);
}

.visual-icon.visual-icon--red {
  color: #ffffff;
  background: linear-gradient(135deg, var(--coral), var(--orange));
}

.visual-icon.visual-icon--sun {
  color: var(--ink);
  background: linear-gradient(135deg, var(--sun), #fff0b8);
}

.resource-section,
.profile-section,
.objective-section {
  padding: clamp(3rem, 7vw, 6rem) clamp(1rem, 4vw, 4.5rem);
}

.section-heading {
  display: block;
  max-width: 760px;
  margin-bottom: 2rem;
}

.section-heading h2 {
  font-family: var(--font-serif);
  max-width: 20ch;
  font-size: clamp(2rem, 3.4vw, 3.35rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: 0;
}

.section-heading.compact h2 {
  max-width: 24ch;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.feature-card {
  min-height: 260px;
  padding: 1.1rem;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 16px 36px rgba(0, 98, 214, 0.1);
}

.feature-card:nth-child(2) {
  background: #eef8ff;
}

.feature-card:nth-child(3) {
  background: #fff4e8;
}

.feature-card:nth-child(4) {
  background: #edf7ff;
}

.feature-number {
  display: grid;
  width: 42px;
  height: 42px;
  margin-bottom: 1.35rem;
  place-items: center;
  color: #ffffff;
  font-weight: 800;
  background: var(--berry);
  border-radius: 8px;
}

.feature-number.visual-icon svg {
  width: 56%;
  height: 56%;
}

.feature-card h3,
.rectangles-grid h3 {
  margin-bottom: 0.65rem;
  font-size: 1.2rem;
}

.feature-card p,
.profile-intro p,
.profile-cards p,
.rectangles-grid p,
.school-panel p {
  color: var(--muted);
  line-height: 1.65;
}

.profile-section {
  background:
    linear-gradient(180deg, rgba(0, 98, 214, 0.08), rgba(255, 255, 255, 0.94)),
    var(--paper);
}

.profile-shell {
  display: grid;
  gap: 1.25rem;
}

.profile-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(136px, 1fr));
  width: min(100%, 420px);
  padding: 0.35rem;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 16px 36px rgba(0, 98, 214, 0.1);
}

.profile-tab {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  font: inherit;
  font-weight: 800;
  background: transparent;
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.profile-tab:hover,
.profile-tab:focus-visible {
  color: var(--berry);
  background: #eef8ff;
}

.profile-tab.is-active {
  color: #ffffff;
  background: linear-gradient(135deg, var(--red), var(--berry) 56%, var(--orange));
  box-shadow: 0 12px 26px rgba(0, 98, 214, 0.22);
}

.profile-panel {
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1.28fr);
  gap: 1rem;
  align-items: stretch;
  min-height: 380px;
  animation: profileFade 180ms ease;
}

.profile-panel[hidden] {
  display: none;
}

.profile-intro,
.profile-cards article {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 16px 36px rgba(0, 98, 214, 0.1);
}

.profile-intro {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(1.25rem, 3vw, 2rem);
  border-top: 8px solid var(--sun);
}

.profile-intro h3 {
  font-family: var(--font-serif);
  margin-bottom: 1rem;
  font-size: clamp(1.75rem, 2.6vw, 2.55rem);
  font-weight: 700;
  line-height: 1.08;
}

.profile-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.profile-cards article {
  min-height: 182px;
  padding: 1.1rem;
}

.profile-cards article:nth-child(2) {
  background: #eef8ff;
}

.profile-cards article:nth-child(3) {
  background: #fff4e8;
}

.profile-cards article:nth-child(4) {
  background: #edf7ff;
}

.profile-cards span {
  display: grid;
  width: 38px;
  height: 38px;
  margin-bottom: 1rem;
  place-items: center;
  color: #ffffff;
  font-weight: 800;
  background: var(--red);
  border-radius: 8px;
}

.profile-cards h4 {
  margin: 0 0 0.55rem;
  font-size: 1.12rem;
}

@keyframes profileFade {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.info-band {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 1rem;
  align-items: stretch;
  padding: clamp(3rem, 7vw, 6rem) clamp(1rem, 4vw, 4.5rem);
  background: linear-gradient(135deg, var(--red), var(--berry) 54%, var(--orange));
  color: #ffffff;
}

.info-band .eyebrow,
.info-band p {
  color: #e5f7ff;
}

.info-panel,
.stats-panel {
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
}

.info-panel {
  padding: clamp(1.4rem, 4vw, 3rem);
}

.section-icon {
  display: grid;
  width: 56px;
  height: 56px;
  margin-bottom: 1rem;
  place-items: center;
  border-radius: 8px;
  box-shadow: 0 16px 36px rgba(0, 63, 142, 0.22);
}

.info-panel h2 {
  font-family: var(--font-serif);
  max-width: 22ch;
  margin-bottom: 1rem;
  font-size: clamp(2rem, 3.7vw, 3.65rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: 0;
}

.stats-panel {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
}

.stats-panel div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 108px;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 8px;
}

.stats-panel strong {
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1;
}

.stats-panel span {
  max-width: 12ch;
  color: #e5f7ff;
  font-weight: 700;
  text-align: right;
}

.rectangles-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.rectangles-grid article {
  min-height: 170px;
  padding: clamp(1.1rem, 2vw, 1.5rem);
  background: var(--surface);
  border-left: 8px solid var(--orange);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(0, 98, 214, 0.08);
}

.rectangle-icon {
  display: grid;
  width: 44px;
  height: 44px;
  margin-bottom: 1rem;
  place-items: center;
  border-radius: 8px;
}

.rectangles-grid article:nth-child(2) {
  border-color: var(--coral);
}

.rectangles-grid article:nth-child(3) {
  border-color: var(--sun);
}

.rectangles-grid article:nth-child(4) {
  border-color: var(--red);
}

.cta-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin: 0 clamp(1rem, 4vw, 4.5rem) clamp(3rem, 6vw, 5rem);
  padding: clamp(1.4rem, 4vw, 3rem);
  color: #ffffff;
  background: linear-gradient(135deg, var(--orange), var(--berry) 48%, var(--red));
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.cta-section h2 {
  font-family: var(--font-serif);
  max-width: 22ch;
  margin-bottom: 0;
  font-size: clamp(1.9rem, 3.3vw, 3rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: 0;
}

.cta-section .eyebrow {
  color: #e5f7ff;
}

.cta-button {
  flex: 0 0 auto;
  padding: 0.95rem 1.2rem;
  color: var(--ink);
  background: #ffffff;
}

.login-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 10%, rgba(255, 138, 31, 0.18), transparent 24rem),
    radial-gradient(circle at 88% 18%, rgba(0, 98, 214, 0.18), transparent 28rem),
    linear-gradient(180deg, #ffffff 0%, var(--paper) 100%);
}

.login-main {
  padding: clamp(2rem, 5vw, 4.5rem) clamp(1rem, 4vw, 4.5rem) clamp(3rem, 6vw, 5rem);
}

.login-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 520px);
  gap: clamp(1.5rem, 5vw, 4rem);
  align-items: center;
  min-height: calc(100vh - 250px);
}

.login-copy {
  max-width: 640px;
}

.login-copy p:not(.eyebrow) {
  max-width: 58ch;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.75;
}

.login-card {
  padding: clamp(1.15rem, 3vw, 2rem);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.login-card-heading {
  margin-bottom: 0.75rem;
}

.login-card h2,
.login-support h2 {
  font-family: var(--font-serif);
  margin-bottom: 0;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.login-card-description {
  margin-bottom: 1.25rem;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.55;
}

.login-form {
  display: grid;
  gap: 1rem;
}

.login-form label,
.login-form label span {
  display: grid;
  gap: 0.45rem;
}

.login-form label {
  color: var(--ink);
  font-weight: 800;
}

.login-form input {
  width: 100%;
  min-height: 50px;
  padding: 0.85rem 0.95rem;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-weight: 600;
  background: #ffffff;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.login-form input::placeholder {
  color: rgba(6, 67, 95, 0.42);
}

.login-form input:focus {
  border-color: var(--berry);
  box-shadow: 0 0 0 4px rgba(0, 98, 214, 0.12);
}

.login-error,
.login-success-message {
  margin: 0;
  padding: 0.8rem 0.95rem;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-weight: 800;
  line-height: 1.45;
}

.login-error {
  color: #8a1f11;
  background: #fff0ec;
  border: 1px solid rgba(255, 95, 61, 0.32);
}

.login-success-message {
  color: #06435f;
  background: #e8f8ef;
  border: 1px solid rgba(24, 156, 91, 0.28);
}

.login-submit {
  width: 100%;
  margin-top: 0.25rem;
}

.login-submit:disabled {
  cursor: wait;
  opacity: 0.82;
  transform: none;
}

.login-links {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1rem;
  color: var(--berry);
  font-weight: 800;
}

.login-links button {
  padding: 0;
  border: 0;
  color: inherit;
  font: inherit;
  font-weight: 800;
  background: transparent;
  cursor: pointer;
}

.login-links a,
.login-links button {
  border-bottom: 2px solid transparent;
}

.login-links a:hover,
.login-links a:focus-visible,
.login-links button:hover,
.login-links button:focus-visible {
  border-color: var(--orange);
}

.login-support {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: clamp(2rem, 5vw, 4rem);
  padding: clamp(1.25rem, 3vw, 2rem);
  color: #ffffff;
  background: linear-gradient(135deg, var(--red), var(--berry) 58%, var(--orange));
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-support .eyebrow,
.login-support p {
  color: #e5f7ff;
}

.login-support p {
  max-width: 52ch;
  margin-bottom: 0;
  line-height: 1.65;
}

.login-notice {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 40;
  max-width: min(360px, calc(100vw - 2rem));
  padding: 0.9rem 1rem;
  color: #ffffff;
  font-family: var(--font-sans);
  font-weight: 800;
  background: linear-gradient(135deg, var(--red), var(--berry));
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(0, 98, 214, 0.24);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.login-notice.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.login-success-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  color: #ffffff;
  font-family: var(--font-sans);
  font-weight: 800;
  background:
    radial-gradient(circle at 50% 46%, rgba(255, 202, 40, 0.32), transparent 12rem),
    linear-gradient(135deg, var(--red), var(--berry) 55%, var(--orange));
  opacity: 0;
  pointer-events: none;
  transform: scale(0.96);
}

.login-success-overlay span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0.9rem 1.2rem;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: 0 24px 70px rgba(0, 63, 142, 0.28);
  backdrop-filter: blur(18px);
}

.ava-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 16% 18%, rgba(255, 138, 31, 0.18), transparent 24rem),
    radial-gradient(circle at 84% 12%, rgba(0, 98, 214, 0.2), transparent 28rem),
    linear-gradient(180deg, #ffffff 0%, var(--paper) 100%);
}

.ava-placeholder {
  display: grid;
  min-height: calc(100vh - 76px);
  padding: clamp(2rem, 5vw, 4.5rem) clamp(1rem, 4vw, 4.5rem);
  place-items: center;
}

.ava-placeholder section {
  width: min(100%, 760px);
  padding: clamp(1.4rem, 4vw, 3rem);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.ava-placeholder p:not(.eyebrow) {
  max-width: 58ch;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.75;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 2rem clamp(1rem, 4vw, 4.5rem);
  color: #dff5ff;
  background: var(--red);
}

.site-footer p {
  margin-bottom: 0;
  line-height: 1.55;
}

.site-contact {
  max-width: 72ch;
  color: #ffffff;
  font-weight: 700;
}

.ava-contact-footer {
  margin-top: clamp(1.25rem, 3vw, 2rem);
  padding: 1rem 1.25rem;
  border: 1px solid rgba(0, 98, 214, 0.16);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(0, 98, 214, 0.08);
}

.ava-contact-footer p {
  max-width: 82ch;
  margin: 0;
  color: var(--ink);
  font-weight: 700;
  line-height: 1.55;
}

.login-password-field {
  display: grid;
  gap: 0.45rem;
}

.login-password-control {
  position: relative;
  min-width: 0;
}

.login-password-control input {
  padding-right: 6rem;
}

.login-password-toggle {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  min-height: 40px;
  padding: 0.45rem 0.7rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.login-password-toggle:hover {
  background: #eef8ff;
}

.login-password-toggle:focus-visible {
  outline: 2px solid var(--berry);
  outline-offset: 1px;
}

.admin-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 12%, rgba(255, 138, 31, 0.14), transparent 24rem),
    radial-gradient(circle at 88% 8%, rgba(0, 98, 214, 0.16), transparent 28rem),
    linear-gradient(180deg, #ffffff 0%, var(--paper) 100%);
}

.admin-top-nav {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--muted);
  font-weight: 800;
}

.admin-top-nav a,
.admin-top-nav button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0.65rem 0.8rem;
  color: inherit;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.82);
  cursor: pointer;
}

.admin-top-nav form {
  margin: 0;
}

.admin-main {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3.5rem) clamp(1rem, 4vw, 2rem);
}

.admin-hero {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: end;
  margin-bottom: clamp(1.25rem, 4vw, 2.5rem);
}

.admin-hero h1 {
  max-width: 16ch;
  margin-bottom: 0.8rem;
  font-size: clamp(2.3rem, 4.6vw, 4.3rem);
}

.admin-hero p:not(.eyebrow) {
  max-width: 60ch;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.65;
}

.admin-summary {
  display: grid;
  min-width: min(100%, 220px);
  padding: 1rem 1.1rem;
  color: #ffffff;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--red), var(--berry) 58%, var(--orange));
  box-shadow: 0 18px 42px rgba(0, 98, 214, 0.18);
}

.admin-summary strong {
  font-size: 2.4rem;
  line-height: 1;
}

.admin-summary span {
  font-weight: 800;
}

.admin-messages {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.admin-panel {
  margin-bottom: 1.25rem;
  padding: clamp(1rem, 3vw, 1.5rem);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 48px rgba(0, 98, 214, 0.1);
}

.admin-section-heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.admin-section-heading h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(1.55rem, 3vw, 2.2rem);
  line-height: 1.1;
}

.admin-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto auto;
  gap: 0.9rem;
  align-items: end;
}

.admin-form label {
  display: grid;
  gap: 0.42rem;
  color: var(--ink);
  font-weight: 800;
}

.admin-form input,
.admin-form select {
  width: 100%;
  min-height: 46px;
  padding: 0.75rem 0.85rem;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-family: var(--font-sans);
  font-weight: 700;
  background: #ffffff;
  outline: none;
}

.admin-form input:focus,
.admin-form select:focus {
  border-color: var(--berry);
  box-shadow: 0 0 0 4px rgba(0, 98, 214, 0.12);
}

.admin-checkbox {
  grid-template-columns: 18px auto;
  align-items: center;
  align-content: center;
  min-height: 46px;
}

.admin-checkbox input {
  width: 18px;
  min-height: 18px;
  padding: 0;
  accent-color: var(--berry);
}

.admin-user-grid {
  display: grid;
  gap: 1rem;
}

.admin-user-card {
  --user-card-accent: var(--line);
  --user-card-border: var(--line);
  --user-card-background: var(--surface);
  --user-card-meta: #f7fbff;
  display: grid;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--user-card-border);
  border-left: 4px solid var(--user-card-accent);
  border-radius: 8px;
  background: var(--user-card-background);
}

.admin-user-card[data-role="ALUNO"] {
  --user-card-accent: var(--berry);
  --user-card-border: #bfdcff;
  --user-card-background: #f0f7ff;
  --user-card-meta: #e3efff;
}

.admin-user-card[data-role="PROFESSOR"] {
  --user-card-accent: var(--sun);
  --user-card-border: #efdfa4;
  --user-card-background: #fffbed;
  --user-card-meta: #fff3cd;
}

.admin-user-card[data-role="ADMIN"] {
  --user-card-accent: var(--orange);
  --user-card-border: #f5d0b0;
  --user-card-background: #fff5ec;
  --user-card-meta: #ffe8d5;
}

.admin-user-card-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
}

.admin-user-card-header div {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.admin-user-card-header strong {
  font-size: 1.08rem;
}

.admin-user-card-header span:not(.admin-status) {
  color: var(--muted);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.admin-status {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 800;
}

.admin-status.is-active {
  color: #0a6f3a;
  background: #e8f8ef;
}

.admin-status.is-inactive {
  color: #8a1f11;
  background: #fff0ec;
}

.admin-user-meta {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr 0.8fr 0.8fr;
  gap: 0.75rem;
  margin: 0;
}

.admin-user-meta div {
  min-width: 0;
  padding: 0.7rem;
  border-radius: 8px;
  background: var(--user-card-meta);
}

.admin-user-meta dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-user-meta dd {
  margin: 0.25rem 0 0;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.admin-edit-form {
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto auto;
  padding-top: 0.25rem;
}

.admin-danger-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.admin-danger-actions form {
  margin: 0;
}

.admin-danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.9rem 1.15rem;
  color: #8a1f11;
  border: 1px solid rgba(255, 95, 61, 0.32);
  border-radius: 8px;
  font: inherit;
  font-weight: 800;
  background: #fff0ec;
  cursor: pointer;
}

.admin-empty-state {
  padding: 1rem;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #f7fbff;
}

.admin-empty-state p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-weight: 700;
}

@media (prefers-reduced-motion: no-preference) {
  body {
    animation: pageEnter 420ms ease both;
  }

  body > .site-header,
  body > main,
  body > .site-footer {
    transition: opacity 260ms ease, transform 260ms ease, filter 260ms ease;
  }

  body.is-page-leaving > .site-header,
  body.is-page-leaving > main,
  body.is-page-leaving > .site-footer {
    opacity: 0;
    filter: blur(4px);
    transform: translateY(10px) scale(0.985);
  }

  body.is-login-opening > .site-header,
  body.is-login-opening > main,
  body.is-login-opening > .site-footer {
    transform: translateY(-6px) scale(1.015);
  }

  .hero-copy,
  .learning-preview,
  .section-heading,
  .feature-card,
  .profile-shell,
  .info-panel,
  .stats-panel,
  .rectangles-grid article,
  .cta-section,
  .login-copy,
  .login-card,
  .login-support,
  .ava-placeholder section {
    animation: contentRise 560ms ease both;
  }

  .learning-preview,
  .login-card {
    animation-delay: 90ms;
  }

  .feature-card:nth-child(2),
  .profile-cards article:nth-child(2),
  .rectangles-grid article:nth-child(2) {
    animation-delay: 70ms;
  }

  .feature-card:nth-child(3),
  .profile-cards article:nth-child(3),
  .rectangles-grid article:nth-child(3) {
    animation-delay: 120ms;
  }

  .feature-card:nth-child(4),
  .profile-cards article:nth-child(4),
  .rectangles-grid article:nth-child(4) {
    animation-delay: 170ms;
  }

  .profile-panel.is-switching,
  .login-card.is-switching {
    animation: softSwitch 240ms ease both;
  }

  .login-page.is-login-success {
    overflow: hidden;
  }

  .login-page.is-login-success .login-card {
    animation: loginCardSuccess 760ms cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  .login-page.is-login-success .login-copy,
  .login-page.is-login-success .login-support,
  .login-page.is-login-success .login-header,
  .login-page.is-login-success .site-footer {
    opacity: 0;
    filter: blur(6px);
    transform: scale(0.96);
    transition: opacity 360ms ease, transform 360ms ease, filter 360ms ease;
  }

  .login-page.is-login-success .login-success-overlay {
    animation: successOverlay 820ms ease both;
  }

  @keyframes pageEnter {
    from {
      opacity: 0;
      transform: translateY(8px);
    }

    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  @keyframes contentRise {
    from {
      opacity: 0;
      transform: translateY(16px);
    }

    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  @keyframes softSwitch {
    from {
      opacity: 0.68;
      transform: translateY(6px) scale(0.99);
    }

    to {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
  }

  @keyframes loginCardSuccess {
    0% {
      opacity: 1;
      transform: translateY(0) scale(1);
    }

    42% {
      opacity: 1;
      transform: translateY(-8px) scale(1.04);
    }

    100% {
      opacity: 0;
      transform: translateY(-18px) scale(1.42);
    }
  }

  @keyframes successOverlay {
    0% {
      opacity: 0;
      transform: scale(0.96);
    }

    42% {
      opacity: 0.92;
      transform: scale(1);
    }

    100% {
      opacity: 1;
      transform: scale(1.04);
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}

@media (max-width: 980px) {
  .main-nav {
    display: none;
  }

  .hero,
  .login-hero,
  .info-band,
  .profile-panel,
  .admin-form,
  .admin-edit-form,
  .admin-user-meta {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .admin-hero,
  .admin-user-card-header {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-summary {
    width: min(100%, 320px);
  }

  h1 {
    max-width: 17ch;
  }

  .learning-preview {
    justify-self: stretch;
  }

  .cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-panel {
    min-height: auto;
  }
}

@media (max-width: 660px) {
  .site-header {
    min-height: 68px;
    padding: 0.7rem 1rem;
  }

  .brand-logo {
    width: clamp(132px, 42vw, 164px);
    max-height: 48px;
  }

  .login-button {
    min-width: 92px;
  }

  .hero {
    padding-top: 2.4rem;
  }

  h1 {
    max-width: 14ch;
    font-size: 2.85rem;
  }

  .hero-actions,
  .login-support,
  .cta-section,
  .site-footer,
  .admin-top-nav,
  .admin-danger-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-top-nav {
    width: 100%;
    gap: 0.45rem;
  }

  .admin-top-nav a,
  .admin-top-nav button {
    width: 100%;
  }

  .admin-header {
    align-items: stretch;
    flex-direction: column;
  }

  .back-home-link {
    min-height: 40px;
    padding: 0.75rem 0.8rem;
  }

  .login-links {
    align-items: flex-start;
    flex-direction: column;
  }

  .cards-grid,
  .profile-cards,
  .rectangles-grid {
    grid-template-columns: 1fr;
  }

  .profile-switch {
    width: 100%;
  }

  .feature-card {
    min-height: 220px;
  }

  .preview-grid article {
    grid-template-columns: 1fr;
  }

  .preview-grid p {
    grid-column: 1;
  }

  .stats-panel div {
    min-height: 92px;
  }
}

/* Scale independente preserva os transforms usados por menus e outros componentes. */
@media (prefers-reduced-motion: no-preference) {
  :is(button, input[type="submit"], input[type="button"], input[type="reset"], a.button, a.btn, a.student-live-link, a.trail-stop, a[role="button"]):not(:disabled):not([aria-disabled="true"]) {
    transition: scale 160ms cubic-bezier(.2,.8,.2,1), background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, color 160ms ease;
  }
  :is(button, input[type="submit"], input[type="button"], input[type="reset"], a.button, a.btn, a.student-live-link, a.trail-stop, a[role="button"]):not(:disabled):not([aria-disabled="true"]):active {
    scale: .97;
    transition-duration: 70ms;
  }
}
