/* Общие страницы: курс, уроки, авторизация, кабинеты */

.fp-page {
  --fp-teal: #0d9488;
  --fp-teal-dark: #0f766e;
  --fp-coral: #f97316;
  --fp-ink: #0f172a;
  --fp-muted: #64748b;
  --fp-cream: #fffbeb;
  --fp-sky: #ecfeff;
  font-family: "Nunito", system-ui, sans-serif;
  color: var(--fp-ink);
}

/* —— Навигация —— */
.fp-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  margin-bottom: 1rem;
}

.fp-back:hover {
  color: #fff;
}

.fp-back--muted {
  color: var(--fp-muted);
  margin-bottom: 1.25rem;
}

.fp-back--muted:hover {
  color: var(--fp-teal);
}

.fp-breadcrumb {
  font-size: 0.85rem;
  color: var(--fp-muted);
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.fp-breadcrumb a {
  color: var(--fp-teal);
  font-weight: 700;
  text-decoration: none;
}

.fp-breadcrumb a:hover {
  color: var(--fp-teal-dark);
}

/* —— Герой —— */
.fp-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, #042f2e 0%, #0f766e 42%, #14b8a6 100%);
  color: #fff;
}

.fp-hero__blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.3;
  pointer-events: none;
}

.fp-hero__blob--1 {
  width: 220px;
  height: 220px;
  background: #fbbf24;
  top: -60px;
  right: 8%;
}

.fp-hero__blob--2 {
  width: 160px;
  height: 160px;
  background: #818cf8;
  bottom: -30px;
  left: 4%;
}

.fp-hero__inner {
  position: relative;
  z-index: 1;
  max-width: 72rem;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 3rem;
  display: grid;
  gap: 2rem;
  align-items: center;
}

@media (min-width: 1024px) {
  .fp-hero__inner {
    grid-template-columns: 1fr auto;
    padding: 3rem 1.5rem 3.5rem;
    gap: 2.5rem;
  }
}

.fp-hero__badge {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.75rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
}

.fp-hero__title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 0.75rem;
}

.fp-hero__lead {
  font-size: 0.95rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.9);
  max-width: 36rem;
}

.fp-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin-top: 1rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.8);
}

.fp-hero__icon {
  font-size: 3rem;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.fp-hero--compact .fp-hero__inner {
  padding: 2rem 1.25rem 2.25rem;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .fp-hero--compact .fp-hero__inner {
    grid-template-columns: auto 1fr;
    align-items: start;
    gap: 1.5rem;
  }
}

/* —— Основной контейнер —— */
.fp-main {
  max-width: 72rem;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

.fp-main--narrow {
  max-width: 48rem;
}

.fp-main--medium {
  max-width: 56rem;
}

.fp-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.fp-section-head h2 {
  font-size: clamp(1.25rem, 2.5vw, 1.65rem);
  font-weight: 900;
  letter-spacing: -0.02em;
}

.fp-section-head__meta {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--fp-muted);
}

/* —— Карточки —— */
.fp-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 640px) {
  .fp-grid--2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

.fp-card {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1.25rem 1.35rem;
  border-radius: 1.25rem;
  background: #fff;
  border: 2px solid #e2e8f0;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

a.fp-card:hover {
  border-color: var(--fp-teal);
  box-shadow: 0 12px 32px rgba(13, 148, 136, 0.12);
  transform: translateY(-2px);
}

.fp-card--row {
  flex-direction: row;
  align-items: center;
  gap: 1rem;
}

.fp-card__top {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.fp-card__icon {
  font-size: 2rem;
  line-height: 1;
  flex-shrink: 0;
}

.fp-card__num {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  background: #ccfbf1;
  color: var(--fp-teal-dark);
  font-weight: 900;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.fp-card__title {
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.25;
}

.fp-card__desc {
  font-size: 0.9rem;
  color: var(--fp-muted);
  line-height: 1.5;
}

.fp-card__meta {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--fp-muted);
  margin-top: auto;
}

.fp-card__side {
  margin-left: auto;
  text-align: right;
  flex-shrink: 0;
}

.fp-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 800;
  background: #fef3c7;
  color: #b45309;
}

.fp-chip--teal {
  background: #ccfbf1;
  color: var(--fp-teal-dark);
}

/* —— Кнопки —— */
.fp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.75rem 1.35rem;
  border-radius: 1rem;
  font-weight: 800;
  font-size: 0.95rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.fp-btn:hover {
  transform: translateY(-1px);
}

.fp-btn--primary {
  background: var(--fp-teal);
  color: #fff;
  box-shadow: 0 6px 20px rgba(13, 148, 136, 0.35);
}

.fp-btn--primary:hover {
  background: var(--fp-teal-dark);
}

.fp-btn--ghost {
  background: #fff;
  color: var(--fp-teal-dark);
  border: 2px solid #e2e8f0;
}

.fp-btn--ghost:hover {
  border-color: var(--fp-teal);
}

.fp-btn--secondary {
  background: #f1f5f9;
  color: var(--fp-ink);
}

.fp-btn--secondary:hover {
  background: #e2e8f0;
}

.fp-btn--block {
  width: 100%;
}

.fp-btn--sm {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  border-radius: 0.75rem;
}

/* —— Теория урока —— */
.fp-theory {
  background: #fff;
  border: 2px solid #e2e8f0;
  border-radius: 1.25rem;
  padding: 1.5rem 1.75rem;
  margin-bottom: 2rem;
  line-height: 1.65;
}

.fp-theory h2,
.fp-theory h3 {
  font-weight: 800;
  margin: 1.25rem 0 0.5rem;
  color: var(--fp-ink);
}

.fp-theory p {
  margin-bottom: 0.75rem;
  color: #334155;
}

.fp-theory pre,
.fp-theory code {
  font-family: ui-monospace, monospace;
  font-size: 0.9em;
}

.fp-theory pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 1rem 1.25rem;
  border-radius: 0.75rem;
  overflow-x: auto;
  margin: 1rem 0;
}

.fp-cta {
  background: linear-gradient(135deg, #f0fdfa 0%, #ecfeff 100%);
  border: 2px solid #99f6e4;
  border-radius: 1.25rem;
  padding: 2rem 1.5rem;
  text-align: center;
}

.fp-cta__title {
  font-size: 1.2rem;
  font-weight: 900;
  margin-bottom: 0.5rem;
}

.fp-cta__text {
  font-size: 0.9rem;
  color: var(--fp-muted);
  margin-top: 0.75rem;
}

.fp-notice {
  border-radius: 1rem;
  padding: 1.25rem 1.5rem;
  text-align: center;
  font-weight: 700;
}

.fp-notice--warn {
  background: #fffbeb;
  border: 2px solid #fde68a;
  color: #92400e;
}

/* —— Пустое состояние —— */
.fp-empty {
  text-align: center;
  padding: 3rem 1.5rem;
  background: #fff;
  border: 2px dashed #cbd5e1;
  border-radius: 1.25rem;
}

.fp-empty__title {
  font-size: 1.15rem;
  font-weight: 900;
  margin: 1rem 0 0.5rem;
}

.fp-empty__text {
  font-size: 0.9rem;
  color: var(--fp-muted);
  max-width: 24rem;
  margin: 0 auto 1.25rem;
  line-height: 1.5;
}

/* —— Авторизация —— */
.fp-auth {
  min-height: calc(100vh - 8rem);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem 3rem;
}

.fp-auth__card {
  width: 100%;
  max-width: 26rem;
  background: #fff;
  border: 2px solid #e2e8f0;
  border-radius: 1.5rem;
  padding: 2rem 1.75rem;
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.08);
}

.fp-auth__card--wide {
  max-width: 42rem;
}

.fp-auth__head {
  text-align: center;
  margin-bottom: 1.75rem;
}

.fp-auth__title {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.fp-auth__sub {
  font-size: 0.9rem;
  color: var(--fp-muted);
  margin-top: 0.35rem;
}

.fp-form-field {
  margin-bottom: 1rem;
}

.fp-form-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 800;
  color: #334155;
  margin-bottom: 0.35rem;
}

.fp-input {
  width: 100%;
  padding: 0.65rem 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 0.75rem;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.fp-input:focus {
  outline: none;
  border-color: var(--fp-teal);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.2);
}

.fp-form-error {
  font-size: 0.8rem;
  color: #dc2626;
  margin-top: 0.35rem;
}

.fp-alert {
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.fp-alert--error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.fp-alert--success {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.fp-auth__footer {
  text-align: center;
  font-size: 0.9rem;
  color: var(--fp-muted);
  margin-top: 1.5rem;
}

.fp-auth__footer a {
  color: var(--fp-teal);
  font-weight: 800;
  text-decoration: none;
}

.fp-auth__footer a:hover {
  color: var(--fp-teal-dark);
}

.fp-role-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 640px) {
  .fp-role-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.fp-role-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.75rem 1.25rem;
  border-radius: 1.25rem;
  background: #fff;
  border: 2px solid #e2e8f0;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.fp-role-card:hover {
  border-color: var(--fp-teal);
  box-shadow: 0 12px 32px rgba(13, 148, 136, 0.12);
  transform: translateY(-2px);
}

.fp-role-card__title {
  font-size: 1.1rem;
  font-weight: 900;
  margin-top: 0.75rem;
}

.fp-role-card__text {
  font-size: 0.85rem;
  color: var(--fp-muted);
  margin-top: 0.35rem;
  line-height: 1.45;
}

/* —— Кабинеты родителя / преподавателя —— */
.fp-dash {
  max-width: 56rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

.fp-dash-hero {
  background: linear-gradient(145deg, #042f2e 0%, #0f766e 42%, #14b8a6 100%);
  color: #fff;
  border-radius: 1.25rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}

.fp-dash-hero__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
}

.fp-dash-hero__title {
  font-size: 1.5rem;
  font-weight: 900;
}

.fp-dash-hero__sub {
  font-size: 0.9rem;
  opacity: 0.9;
  margin-top: 0.25rem;
}

.fp-dash-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.fp-stats-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 640px) {
  .fp-stats-row {
    grid-template-columns: repeat(4, 1fr);
  }
}

.fp-stat-box {
  background: #fff;
  border: 2px solid #e2e8f0;
  border-radius: 1rem;
  padding: 1rem;
  text-align: center;
}

.fp-stat-box__value {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--fp-teal-dark);
}

.fp-stat-box__label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--fp-muted);
  margin-top: 0.2rem;
}

.fp-person {
  display: block;
  background: #fff;
  border: 2px solid #e2e8f0;
  border-radius: 1.25rem;
  padding: 1.25rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.fp-person:hover {
  border-color: var(--fp-teal);
  box-shadow: 0 8px 24px rgba(13, 148, 136, 0.1);
}

.fp-person__row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.fp-person__avatar {
  width: 3rem;
  height: 3rem;
  border-radius: 9999px;
  background: #ccfbf1;
  color: var(--fp-teal-dark);
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.fp-person__name {
  font-size: 1.1rem;
  font-weight: 900;
}

.fp-person__meta {
  font-size: 0.8rem;
  color: var(--fp-muted);
}

.fp-person__xp {
  margin-left: auto;
  text-align: right;
}

.fp-person__xp strong {
  display: block;
  font-size: 1.35rem;
  color: var(--fp-teal);
}

.fp-person__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #f1f5f9;
}

.fp-table-wrap {
  overflow-x: auto;
  border: 2px solid #e2e8f0;
  border-radius: 1rem;
  background: #fff;
}

.fp-table {
  width: 100%;
  font-size: 0.875rem;
  border-collapse: collapse;
}

.fp-table th {
  text-align: left;
  padding: 0.65rem 0.85rem;
  background: #f8fafc;
  color: var(--fp-muted);
  font-weight: 800;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.fp-table td {
  padding: 0.65rem 0.85rem;
  border-top: 1px solid #f1f5f9;
}

.fp-table tbody tr {
  cursor: pointer;
  transition: background 0.1s ease;
}

.fp-table tbody tr:hover {
  background: #f0fdfa;
}

.fp-table a {
  color: var(--fp-teal);
  font-weight: 800;
  text-decoration: none;
}

/* Номер урока над заголовком (1.1 = раздел 1, урок 1) */
.fp-lesson-code {
  margin: 0 0 0.35rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #4a90d9;
}

.fp-lesson-code--compact {
  font-size: 0.75rem;
  margin-bottom: 0.15rem;
}

/* —— Поток заданий —— */
.fp-lesson-flow {
  min-height: 100vh;
  background: #f8fafc;
}

.fp-lesson-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 2px solid #e2e8f0;
  box-shadow: 0 1px 0 rgba(13, 148, 136, 0.06);
}

.fp-lesson-bar__inner {
  max-width: 48rem;
  margin: 0 auto;
  padding: 1rem 1.25rem;
}

.fp-lesson-bar__link {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--fp-teal);
  text-decoration: none;
}

.fp-lesson-bar__link:hover {
  color: var(--fp-teal-dark);
}

.fp-task-card {
  background: #fff;
  border: 2px solid #e2e8f0;
  border-radius: 1.25rem;
  overflow: hidden;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.06);
}

.fp-task-card__head {
  padding: 1rem 1.25rem;
  background: #f8fafc;
  border-bottom: 1px solid #f1f5f9;
}

.fp-task-card__body {
  padding: 1.25rem;
}

/* —— 404 —— */
.fp-error-page {
  max-width: 28rem;
  margin: 0 auto;
  padding: 4rem 1.25rem;
  text-align: center;
}

.fp-error-page__title {
  font-size: 1.75rem;
  font-weight: 900;
  margin: 1rem 0 0.5rem;
}

.fp-error-page__text {
  color: var(--fp-muted);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

/* Кнопки внутри заданий */
.fp-btn-task {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.35rem;
  border-radius: 0.85rem;
  font-weight: 800;
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--fp-teal);
  color: #fff;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.fp-btn-task:hover {
  background: var(--fp-teal-dark);
  transform: translateY(-1px);
}

.fp-btn-task:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.fp-btn-task--block {
  width: 100%;
}

@media (min-width: 640px) {
  .fp-btn-task--block-sm {
    width: auto;
  }
}
