.lp-portal {
  --accent: #c3adff;
  --lp-ink: #f7f5ff;
  --lp-muted: #c4cde4;
  --lp-line: #535e85;
  --lp-frame: #161d38;
  --lp-field: #10172c;
  display: grid;
  gap: clamp(.85rem, 2.2vw, 1.35rem);
  min-width: 0;
  color: var(--lp-ink);
}

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

.lp-card {
  min-width: 0;
  padding: clamp(1rem, 3vw, 1.65rem);
  border: 1px solid var(--lp-line);
  border-radius: 16px;
  background: linear-gradient(135deg, #23294b, var(--lp-frame) 55%);
  box-shadow: 0 12px 32px #0809155e;
}

.lp-card :is(h2,h3) { margin: 0 0 .45rem; color: var(--lp-ink); line-height: 1.2; }
.lp-card p { margin: 0 0 .75rem; line-height: 1.5; }
.lp-card .lp-muted,
.lp-card .lp-form > p { color: var(--lp-muted); font-size: .92rem; }
.lp-card .lp-muted:last-child { margin-bottom: 0; }
.lp-portal :is(button,input,select,a):focus-visible { outline: 3px solid #d5c7ff; outline-offset: 3px; }

.lp-form { display: grid; gap: .55rem; margin-top: .8rem; }
.lp-form label { display: block; font-size: .93rem; font-weight: 720; }
.lp-form label + :is(input,select) { margin: 0; }
.lp-form > p { margin: 0; }

.lp-form :is(input,select) {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: .55rem .65rem;
  border: 1px solid #68749a;
  border-radius: 8px;
  background: var(--lp-field);
  color: var(--lp-ink);
  color-scheme: dark;
  font: inherit;
}

.lp-form > .year-control { justify-self: start; margin-top: .3rem; }
.lp-portal .year-control { min-height: 44px; margin-bottom: 0; white-space: normal; }
.lp-portal .year-control:disabled { opacity: .63; cursor: not-allowed; }
.lp-portal .lp-primary {
  border-color: #b6a4ef;
  background: radial-gradient(ellipse at 12% 0, #9e85ff68, transparent 80%), #3d326e;
}

.lp-form-grid, .lp-filters { display: grid; align-items: end; gap: .75rem; }
.lp-form-grid { grid-template-columns: minmax(0, 1fr) minmax(5.5rem, .45fr); }
.lp-filters { grid-template-columns: repeat(3, minmax(0, 1fr)) max-content; }
.lp-filters > .year-control { justify-self: start; margin: 0; }
.lp-form-grid label, .lp-filters label { margin-bottom: .28rem; }

.lp-classes {
  display: flex;
  flex-wrap: wrap;
  gap: .38rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.lp-classes li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .35rem;
  padding: .3rem .48rem;
  border: 1px solid var(--lp-line);
  border-radius: 7px;
  background: var(--lp-field);
  font-size: .85rem;
}
.lp-classes li > span { color: var(--lp-muted); }

.lp-section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: start;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .55rem;
}
.lp-section-header > div { min-width: 0; overflow-wrap: anywhere; }
.lp-section-header p { margin-bottom: 0; }
.lp-actions { display: flex; flex-wrap: wrap; gap: .45rem; }

.lp-auth {
  --accent: #a7f4dc;
  --lp-line: #527282;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  grid-template-areas: "form coach";
  align-items: center;
  min-height: 570px;
  padding: clamp(12px, 3vw, 36px);
  border: 1px solid #3b5068;
  border-radius: 20px;
  background: radial-gradient(ellipse at 74% 44%, #174757 0%, #14253f 32%, #13152a 69%);
}

.lp-auth-card {
  grid-area: form;
  background: linear-gradient(148deg, #1d3448, #151b35 78%);
  box-shadow: 0 20px 55px #030517a3;
}

.lp-auth-coach {
  grid-area: coach;
  display: grid;
  align-self: stretch;
  align-content: space-between;
  justify-items: center;
  gap: clamp(.55rem, 2vw, 1.25rem);
  min-width: 0;
  padding: 1rem .75rem;
  text-align: center;
}

.lp-auth-coach h1 {
  margin: 0;
  color: var(--lp-ink);
  font-size: clamp(2.4rem, 5.2vw, 4.65rem);
  font-weight: 850;
  line-height: .96;
  letter-spacing: -.075em;
}

.lp-auth-orbit {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  width: min(100%, 340px);
  aspect-ratio: 1.14;
}

.lp-auth-orbit::before {
  position: absolute;
  inset: 12% 10%;
  z-index: -1;
  border: 1px solid #91eddf58;
  border-radius: 50%;
  box-shadow: inset 0 0 35px #6ddacc21, 0 0 24px #70e7c930;
  transform: rotate(-17deg) scaleX(1.13);
  content: "";
}

.lp-auth-orbit img {
  display: block;
  width: 82%;
  height: auto;
  filter: drop-shadow(0 10px 24px #060e29) drop-shadow(0 0 32px #4cdac359);
}

.lp-auth-tip {
  max-width: 29ch;
  margin: 0;
  padding: .5rem .75rem;
  border: 1px solid #558492;
  border-radius: 12px;
  color: #e3fff8;
  background: #102838;
  font-size: .88rem;
  line-height: 1.4;
}

.lp-auth-mode {
  display: flex;
  gap: .25rem;
  margin-bottom: 1.05rem;
  padding: 3px;
  border: 1px solid #557483;
  border-radius: 10px;
  background: #111f31;
}

.lp-auth-mode button {
  flex: 1 1 0;
  min-height: 44px;
  padding: .25rem .4rem;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #deeaf5;
  font: inherit;
  font-size: .88rem;
  font-weight: 700;
  cursor: pointer;
}

.lp-auth-mode button:is(:hover, [aria-pressed="true"]) {
  border-color: #709b9b;
  background: #2a455a;
  color: #e3fff4;
}

.lp-auth-mode button:disabled { opacity: .7; cursor: not-allowed; }
.lp-auth .lp-primary {
  border-color: #79b4ac;
  background: radial-gradient(ellipse at 25% 0%, #7decc568, transparent 82%), #234753;
}
.lp-auth-card .lp-muted { margin-top: .9rem; }
.lp-auth-card .lp-form input::placeholder { color: #a0accd; }

.lp-notice {
  margin: 0;
  padding: .7rem .85rem;
  border: 1px solid #9a8fcb;
  border-radius: 9px;
  background: #e8e2ff;
  color: #302553;
  font-weight: 660;
}
.lp-notice--error { border-color: #e8a9b5; background: #ffe8ed; color: #681d32; }

.lp-progress-card > h3, .lp-learner-detail { margin-top: 1.25rem; }
.lp-reissue {
  margin-block: .7rem;
  padding: .5rem .7rem;
  border: 1px solid var(--lp-line);
  border-radius: 8px;
  background: var(--lp-field);
}
.lp-reissue summary { min-height: 34px; padding-block: .28rem; cursor: pointer; font-weight: 720; }
.lp-reissue summary:focus-visible { outline: 3px solid #d5c7ff; outline-offset: 3px; }
.lp-reissue p { margin-block: .3rem .6rem; }
.lp-totals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .4rem;
  margin: .55rem 0 .8rem;
}

.lp-totals > div {
  display: grid;
  gap: .18rem;
  padding: .5rem .65rem;
  border: 1px solid transparent;
  border-radius: 9px;
  min-width: 0;
}
.lp-totals dt { font-size: .84rem; font-weight: 650; line-height: 1.25; }
.lp-totals dd { margin: 0; font-size: 1.25rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.lp-totals--compact { width: min(100%, 22rem); margin-block: 0; }
.lp-totals--compact dd { font-size: 1rem; }
.lp-totals--compact > div { padding: .38rem .48rem; }

.lp-portal [data-progress="pending"] { background: #e7ebf7; border-color: #a7b3d2; color: #293851; }
.lp-portal [data-progress="started"] { background: #eee2ff; border-color: #cbb4ed; color: #523079; }
.lp-portal [data-progress="completed"] { background: #d3f2e8; border-color: #9acabd; color: #12493f; }

.lp-learners, .lp-lesson-list { display: grid; gap: .4rem; margin: .75rem 0 0; padding: 0; list-style: none; }
.lp-learners li, .lp-lesson-list li {
  display: grid;
  align-items: center;
  gap: .55rem;
  min-width: 0;
  padding: .58rem .7rem;
  border: 1px solid #596388;
  border-radius: 9px;
  background: #141b32;
  overflow-wrap: anywhere;
}
.lp-learners li { grid-template-columns: minmax(0, .8fr) minmax(0, 1.35fr) max-content; }
.lp-learners li .year-control { justify-self: end; }
.lp-lesson-list li { grid-template-columns: minmax(0, 1fr) max-content; }
.lp-lesson-list a { display: flex; align-items: center; min-height: 44px; color: #e1d6ff; text-underline-offset: .18em; }
.lp-progress-label, .lp-activation-label {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  padding: .16rem .45rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 730;
}
.lp-activation-label { background: #ffe9be; border-color: #ddbd7a; color: #563712; }

.lp-receipts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: .65rem; }
.lp-receipt {
  min-width: 0;
  padding: .8rem;
  border: 1px solid #b2a1e5;
  border-radius: 10px;
  background: #f2ecff;
  color: #252242;
  overflow-wrap: anywhere;
}
.lp-receipt h3 { color: #33265f; }
.lp-receipt dl { margin: .45rem 0 .65rem; }
.lp-receipt dl > div + div { margin-top: .35rem; }
.lp-receipt dt { font-size: .8rem; font-weight: 720; }
.lp-receipt dd { margin: 0; }
.lp-receipt code { color: #251747; font-weight: 780; }
.lp-receipt p { margin: 0; font-size: .86rem; }

@media (max-width: 720px) {
  .lp-admin-grid, .lp-learners li { grid-template-columns: minmax(0, 1fr); }
  .lp-learners li .year-control { justify-self: start; }
  .lp-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lp-auth {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "coach" "form";
    align-content: start;
  }
  .lp-auth-coach {
    grid-template: auto auto / minmax(0, 1.12fr) minmax(0, 1fr);
    align-items: center;
    gap: .5rem;
    padding: .25rem .125rem;
    justify-items: start;
    text-align: left;
  }
  .lp-auth-coach h1 { grid-area: 1 / 1; align-self: end; font-size: clamp(2.2rem, 7vw, 3.4rem); }
  .lp-auth-tip { grid-area: 2 / 1; align-self: start; padding: .32rem .48rem; font-size: .76rem; }
  .lp-auth-orbit { grid-area: 1 / 2 / 3; width: min(100%, 175px); justify-self: center; }
}

@media (max-width: 460px) {
  .lp-filters { grid-template-columns: minmax(0, 1fr); }
  .lp-totals > div { padding-inline: .35rem; }
  .lp-lesson-list li { grid-template-columns: minmax(0, 1fr); justify-items: start; }
}

@media print {
  body:has(.lp-credentials) { background: #fff; color: #000; }
  body:has(.lp-credentials) > :not(main),
  body:has(.lp-credentials) main .page > :not(.lp-teacher),
  .lp-teacher:has(.lp-credentials) > :not(.lp-credentials),
  .lp-credentials .lp-actions { display: none !important; }
  body:has(.lp-credentials) :is(main,.page,.lp-teacher,.lp-credentials) {
    display: block;
    width: auto;
    min-height: 0;
    margin: 0;
    padding: 0;
    background: #fff;
    border: 0;
    box-shadow: none;
    color: #000;
  }
  .lp-credentials :is(h2,h3) { color: #000; }
  .lp-receipts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lp-receipts .lp-receipt {
    break-inside: avoid;
    border: 1px solid #333;
    background: #fff;
    color: #000;
  }
  .lp-receipt code { color: #000; }
}
