:root {
  --ink: #241f20;
  --muted: #71676a;
  --line: #e8dfe0;
  --paper: #f8f4f3;
  --white: #ffffff;
  --teal: #9b1c20;
  --teal-dark: #741316;
  --coral: #bd3d35;
  --gold: #c28a39;
  --blue: #285a84;
  --shadow: 0 18px 45px rgba(31, 41, 51, 0.12);
  font-family: "Tajawal", "Segoe UI", Tahoma, Arial, sans-serif;
  color-scheme: light;
}

:root[data-theme="dark"] {
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  position: relative;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.65;
  border-top: 7px solid var(--teal-dark);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.32;
  background:
    linear-gradient(rgba(138, 21, 15, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(40, 90, 132, 0.07) 1px, transparent 1px),
    repeating-linear-gradient(135deg, transparent 0 44px, rgba(31, 41, 51, 0.035) 45px 46px);
  background-size: 48px 48px, 48px 48px, 180px 180px;
  animation: drafting-grid 22s linear infinite;
}

.site-header,
main,
.site-footer,
.page-header,
.admin-page {
  position: relative;
  z-index: 1;
}

img {
  display: block;
  max-width: 100%;
}

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

button,
input,
select {
  font: inherit;
}

.site-header,
.page-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 76px;
  padding: 12px clamp(18px, 4vw, 54px);
  border-bottom: 1px solid rgba(217, 225, 232, 0.9);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
}

.brand-logo {
  display: grid;
  width: 96px;
  height: 42px;
  border-radius: 8px;
  object-fit: contain;
  background: #000000;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.25;
}

.brand small {
  color: var(--muted);
  font-size: 0.78rem;
}

.brand .brand-slogan {
  color: var(--teal-dark);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.main-nav,
.footer-links {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 24px);
  color: var(--muted);
  font-size: 0.95rem;
}

.main-nav a:hover,
.footer-links a:hover {
  color: var(--teal);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.utility-button {
  display: inline-grid;
  place-items: center;
  min-width: 42px;
  min-height: 38px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 850;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.utility-button:hover {
  transform: translateY(-1px);
  border-color: rgba(138, 21, 15, 0.48);
  background: var(--white);
}

.theme-toggle {
  font-size: 1.05rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 750;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

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

.btn-primary {
  background: var(--teal);
  color: var(--white);
  box-shadow: 0 10px 22px rgba(15, 118, 110, 0.2);
}

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

.btn-header-register {
  min-height: 38px;
  padding: 7px 14px;
  border-color: rgba(15, 118, 110, 0.24);
  background: rgba(255, 255, 255, 0.86);
  color: var(--teal-dark);
  box-shadow: none;
}

.btn-header-register:hover {
  background: rgba(15, 118, 110, 0.08);
}

.btn-outline {
  border-color: var(--line);
  background: var(--white);
  color: var(--ink);
}

.btn-danger {
  border-color: rgba(162, 58, 46, 0.22);
  background: #fdecea;
  color: #8a150f;
}

.btn-light {
  background: var(--white);
  color: var(--teal-dark);
}

.btn-wide {
  margin-top: 28px;
  min-width: 190px;
}

.btn-block {
  width: 100%;
}

.hero-section {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(360px, 1.08fr);
  align-items: center;
  gap: clamp(28px, 5vw, 72px);
  min-height: calc(100vh - 76px);
  padding: clamp(34px, 5vw, 72px) clamp(18px, 5vw, 72px);
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(247, 249, 251, 0.74)),
    radial-gradient(circle at 16% 28%, rgba(138, 21, 15, 0.12), transparent 28%),
    var(--paper);
}

.hero-section::before,
.hero-section::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.hero-section::before {
  inset: 0;
  opacity: 0.2;
  background:
    linear-gradient(30deg, transparent 0 48%, rgba(138, 21, 15, 0.32) 49%, transparent 50%),
    linear-gradient(150deg, transparent 0 52%, rgba(40, 90, 132, 0.24) 53%, transparent 54%);
  background-size: 260px 260px;
  animation: blueprint-sweep 18s ease-in-out infinite alternate;
}

.hero-section::after {
  left: -8%;
  bottom: 8%;
  width: 56%;
  height: 34%;
  opacity: 0.16;
  border: 1px solid rgba(138, 21, 15, 0.65);
  border-right-color: transparent;
  border-bottom-color: transparent;
  border-radius: 50%;
  transform: rotate(-10deg);
  animation: studio-arc 12s ease-in-out infinite alternate;
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 660px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--coral);
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0;
}

.hero-slogan {
  font-size: clamp(0.95rem, 1.5vw, 1.22rem);
  letter-spacing: 0.08em;
}

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

.hero-copy h1 {
  margin-bottom: 20px;
  font-size: clamp(1.36rem, 4vw, 3.4rem);
  line-height: 1.05;
}

.hero-copy p:not(.eyebrow) {
  max-width: 580px;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.28rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.hero-media {
  position: relative;
  z-index: 1;
  min-height: 420px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

@keyframes drafting-grid {
  from {
    background-position: 0 0, 0 0, 0 0;
  }

  to {
    background-position: 48px 48px, -48px 48px, 180px 0;
  }
}

@keyframes blueprint-sweep {
  from {
    background-position: 0 0;
  }

  to {
    background-position: 130px 90px;
  }
}

@keyframes studio-arc {
  from {
    transform: translateX(0) rotate(-10deg);
  }

  to {
    transform: translateX(34px) rotate(-2deg);
  }
}

@keyframes section-blueprint {
  from {
    background-position: 0 0;
  }

  to {
    background-position: 150px 75px;
  }
}

@keyframes compass-arc {
  from {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }

  to {
    transform: translate3d(22px, -12px, 0) rotate(10deg);
  }
}

@keyframes drafting-tick {
  from {
    opacity: 0.18;
    transform: scaleX(0.45);
  }

  to {
    opacity: 0.42;
    transform: scaleX(1);
  }
}

@keyframes frame-drift {
  from {
    transform: translate3d(0, 0, 0);
  }

  to {
    transform: translate3d(6px, -6px, 0);
  }
}

.hero-media img {
  width: 100%;
  height: 100%;
  min-height: 420px;
  object-fit: cover;
}

.section {
  position: relative;
  overflow: hidden;
  padding: clamp(60px, 8vw, 104px) clamp(18px, 5vw, 72px);
}

.about-section::before,
.programs-section::before,
.team-section::before,
.contact-section::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.18;
  background:
    linear-gradient(90deg, transparent 0 49%, rgba(138, 21, 15, 0.22) 50%, transparent 51%),
    linear-gradient(0deg, transparent 0 49%, rgba(40, 90, 132, 0.16) 50%, transparent 51%);
  background-size: 150px 150px;
  animation: section-blueprint 26s linear infinite;
}

.programs-section::after,
.team-section::after,
.contact-section::after {
  content: "";
  position: absolute;
  z-index: 0;
  pointer-events: none;
  width: 220px;
  height: 220px;
  border: 1px solid rgba(138, 21, 15, 0.28);
  border-left-color: transparent;
  border-bottom-color: transparent;
  border-radius: 50%;
  animation: compass-arc 16s ease-in-out infinite alternate;
}

.programs-section::after {
  top: 34px;
  right: 7%;
}

.team-section::after {
  bottom: 34px;
  left: 8%;
}

.contact-section::after {
  top: 24px;
  left: 10%;
}

.section > * {
  position: relative;
  z-index: 1;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 32px;
}

.section-heading h2,
.cta-band h2,
.topbar h1 {
  margin-bottom: 12px;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.16;
}

.section-heading p:not(.eyebrow),
.cta-band p {
  color: var(--muted);
}

.feature-grid,
.program-grid,
.team-grid,
.contact-grid,
.stats-grid {
  display: grid;
  gap: 18px;
}

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

.info-card,
.program-card,
.metric-card,
.contact-item,
.stat-card,
.registration-card,
.telegram-panel,
.form-panel,
.ticket-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 8px 22px rgba(31, 41, 51, 0.05);
}

.info-card {
  position: relative;
  padding: 24px;
}

.info-card::after,
.metric-card::after,
.contact-item::after {
  content: "";
  position: absolute;
  inset-inline-end: 16px;
  bottom: 12px;
  width: 58px;
  height: 1px;
  background: rgba(138, 21, 15, 0.22);
  transform-origin: right center;
  animation: drafting-tick 9s ease-in-out infinite alternate;
}

.icon-badge {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 18px;
  border-radius: 8px;
  background: #faeeee;
  color: var(--teal);
  font-weight: 900;
}

.info-card p,
.program-card p {
  color: var(--muted);
}

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

.program-card {
  position: relative;
  overflow: hidden;
}

.program-card::after,
.team-card::after {
  content: "";
  position: absolute;
  inset: 12px;
  z-index: 1;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-bottom-color: rgba(138, 21, 15, 0.26);
  border-left-color: transparent;
  pointer-events: none;
  opacity: 0.75;
  animation: frame-drift 12s ease-in-out infinite alternate;
}

.program-card-media {
  margin: 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #eef2f5;
}

.program-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.program-card--interior img {
  object-position: center 54%;
}

.program-card div {
  padding: 24px;
}

.public-course-card {
  width: 100%;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  color: var(--ink);
  text-align: right;
  cursor: pointer;
  box-shadow: 0 14px 34px rgba(43, 30, 31, 0.09);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.public-course-card:hover,
.public-course-card:focus-visible {
  transform: translateY(-5px);
  border-color: rgba(155, 28, 32, 0.48);
  box-shadow: 0 20px 44px rgba(43, 30, 31, 0.15);
  outline: none;
}

.public-course-content { position: relative; }
.public-course-content h3 { margin: 8px 0; font-size: 1.32rem; }
.public-course-content p { min-height: 52px; margin-bottom: 18px; }
.public-course-price { display: inline-flex; padding: 5px 10px; border-radius: 999px; background: #f8e8e7; color: var(--teal-dark); font-weight: 900; }
.course-details-link { display: inline-flex; align-items: center; gap: 8px; color: var(--teal); font-weight: 900; }
.courses-loading { grid-column: 1 / -1; padding: 36px; border: 1px dashed var(--line); border-radius: 14px; background: var(--white); color: var(--muted); text-align: center; }
.course-modal-open { overflow: hidden; }
.course-detail-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 18px; background: rgba(12, 9, 10, .76); backdrop-filter: blur(7px); }
.course-detail-modal { position: relative; width: min(720px, 100%); max-height: calc(100vh - 36px); overflow-y: auto; padding: clamp(24px, 5vw, 40px); border: 1px solid var(--line); border-radius: 20px; background: var(--white); color: var(--ink); box-shadow: 0 28px 80px rgba(0, 0, 0, .35); }
.course-detail-modal h2 { margin-bottom: 10px; font-size: clamp(1.5rem, 5vw, 2.25rem); }
.course-detail-description { color: var(--muted); }
.course-detail-close { position: absolute; top: 16px; left: 16px; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; background: var(--paper); color: var(--ink); font-size: 1.5rem; cursor: pointer; }
.public-course-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 24px 0; }
.public-course-details div { padding: 13px 15px; border-radius: 10px; background: var(--paper); }
.public-course-details dt { color: var(--muted); font-size: .8rem; font-weight: 700; }
.public-course-details dd { margin: 2px 0 0; font-weight: 900; }
.course-bot-info { margin: 0 0 24px; padding: 18px; border-right: 4px solid var(--teal); border-radius: 10px; background: var(--paper); }
.course-bot-info h3 { margin-bottom: 12px; }.course-bot-info p { white-space: pre-line; }.course-bot-info p:last-child { margin-bottom: 0; }
.course-info-notice { margin: 20px 0; padding: 14px 16px; border: 1px solid #e7c98e; border-radius: 10px; background: #fff8e8; color: #694a12; font-weight: 700; }

:root[data-theme="dark"] .landing-page .public-course-price { background: rgba(212, 57, 62, .17); color: #ff8a84; }
:root[data-theme="dark"] .landing-page .public-course-card,
:root[data-theme="dark"] .landing-page .public-course-card h3 { color: #ffffff; }
:root[data-theme="dark"] .landing-page .course-details-link { color: #ff7a74; }
:root[data-theme="dark"] .landing-page .courses-loading { border-color: #34383e; background: #17191d; color: #d1d5db; }
:root[data-theme="dark"] .course-detail-modal { border-color: #34383e; background: #17191d; color: #fff; }
:root[data-theme="dark"] .course-detail-description { color: #d1d5db; }
:root[data-theme="dark"] .course-detail-close,
:root[data-theme="dark"] .public-course-details div,
:root[data-theme="dark"] .course-bot-info { border-color: #41464e; background: #24272c; color: #fff; }
:root[data-theme="dark"] .public-course-details dt { color: #bfc5cd; }
:root[data-theme="dark"] .course-info-notice { border-color: #806326; background: #302711; color: #ffe09a; }

.team-section {
  background: #0b0b0c;
  color: var(--white);
}

.team-section .section-heading p:not(.eyebrow) {
  color: rgba(255, 255, 255, 0.68);
}

.team-section .eyebrow {
  color: #e34840;
}

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

.team-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  background: linear-gradient(160deg, #171719, #09090a 72%);
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.28);
}

.team-card::before {
  content: "";
  position: absolute;
  top: -78px;
  left: -60px;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: rgba(181, 28, 21, 0.66);
  filter: saturate(0.9);
}

.team-card::after {
  inset: 10px;
  border-color: rgba(255, 255, 255, 0.18);
  border-bottom-color: rgba(220, 40, 32, 0.8);
}

.team-card-media {
  position: relative;
  z-index: 2;
  margin: 14px 14px 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 9px;
  aspect-ratio: 4 / 4.35;
  background: #101011;
}

.team-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  filter: grayscale(1) contrast(1.06);
  transition: filter 220ms ease, transform 220ms ease;
}

.team-card:hover .team-card-media img {
  filter: grayscale(0.2) contrast(1.03);
  transform: scale(1.025);
}

.team-card-number {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.team-card-content {
  position: relative;
  z-index: 2;
  padding: 22px 20px 24px;
}

.team-card-kicker {
  margin: 0 0 4px;
  color: #e34840;
  font-size: 0.78rem;
  font-weight: 800;
}

.team-card h3 {
  margin: 0;
  color: var(--white);
  font-size: clamp(1.35rem, 2vw, 1.8rem);
  line-height: 1.25;
}

.team-card-name {
  display: block;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.team-card-content > p:not(.team-card-kicker) {
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.9rem;
}

.team-card-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.team-card-skills li {
  padding: 5px 10px;
  border: 1px solid rgba(227, 72, 64, 0.4);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.72rem;
}

.cta-section {
  padding-block: clamp(34px, 5vw, 56px);
  background: var(--ink);
}

.metric-card,
.contact-item,
.stat-card {
  position: relative;
  padding: 22px;
}

.metric-card span,
.contact-item span,
.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

.metric-card strong,
.contact-item strong,
.contact-item a,
.stat-card strong {
  display: block;
  margin-top: 6px;
  font-size: 1.12rem;
}

.cta-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 auto;
  width: min(1040px, calc(100% - clamp(36px, 10vw, 144px)));
  padding: clamp(20px, 4vw, 34px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.06);
}

.cta-band h2 {
  font-size: clamp(1.35rem, 2.4vw, 2rem);
}

.cta-band p {
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.74);
}

.cta-band .eyebrow {
  color: #f4d2cd;
}

.cta-band .btn {
  flex: 0 0 auto;
}

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

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 26px clamp(18px, 4vw, 54px);
  border-top: 1px solid var(--line);
  background: var(--white);
  color: var(--muted);
}

/* The landing page follows the operating-system theme until a visitor chooses manually. */
:root[data-theme="dark"] .landing-page {
  background: #0d0e10;
  color: #f2f3f5;
}

:root[data-theme="dark"] .landing-page::before {
  opacity: 0.2;
  background:
    linear-gradient(rgba(227, 72, 64, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(130, 158, 181, 0.08) 1px, transparent 1px),
    repeating-linear-gradient(135deg, transparent 0 44px, rgba(255, 255, 255, 0.025) 45px 46px);
  background-size: 48px 48px, 48px 48px, 180px 180px;
}

:root[data-theme="dark"] .landing-page .site-header {
  border-bottom-color: rgba(255, 255, 255, 0.12);
  background: rgba(12, 13, 15, 0.9);
}

:root[data-theme="dark"] .landing-page .brand small,
:root[data-theme="dark"] .landing-page .main-nav,
:root[data-theme="dark"] .landing-page .footer-links,
:root[data-theme="dark"] .landing-page .section-heading p:not(.eyebrow),
:root[data-theme="dark"] .landing-page .info-card p,
:root[data-theme="dark"] .landing-page .program-card p,
:root[data-theme="dark"] .landing-page .contact-item span {
  color: #aab2bd;
}

:root[data-theme="dark"] .landing-page .brand .brand-slogan,
:root[data-theme="dark"] .landing-page .eyebrow {
  color: #e45a53;
}

:root[data-theme="dark"] .landing-page .utility-button,
:root[data-theme="dark"] .landing-page .btn-header-register,
:root[data-theme="dark"] .landing-page .btn-outline {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.07);
  color: #f2f3f5;
}

:root[data-theme="dark"] .landing-page .hero-section {
  background:
    radial-gradient(circle at 18% 22%, rgba(155, 28, 32, 0.2), transparent 34%),
    linear-gradient(145deg, #17191d 0%, #0b0c0f 72%);
}

:root[data-theme="dark"] .landing-page .hero-copy h1 {
  color: #ffffff;
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.7);
}

:root[data-theme="dark"] .landing-page .hero-copy p:not(.eyebrow) {
  color: #e1e4e8;
}

:root[data-theme="dark"] .landing-page .hero-slogan {
  color: #ff7069;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.55);
}

:root[data-theme="dark"] .landing-page .hero-actions .btn-primary {
  border-color: #d4393e;
  background: #b51f25;
  color: #ffffff;
  box-shadow: 0 10px 26px rgba(181, 31, 37, 0.3);
}

:root[data-theme="dark"] .landing-page .hero-actions .btn-outline {
  border-color: rgba(255, 255, 255, 0.62);
  background: rgba(255, 255, 255, 0.09);
  color: #ffffff;
}

:root[data-theme="dark"] .landing-page .about-section,
:root[data-theme="dark"] .landing-page .programs-section,
:root[data-theme="dark"] .landing-page .contact-section {
  background-color: #0d0e10;
}

:root[data-theme="dark"] .landing-page .info-card,
:root[data-theme="dark"] .landing-page .program-card,
:root[data-theme="dark"] .landing-page .contact-item {
  border-color: #34383e;
  background: #17191d;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.24);
}

:root[data-theme="dark"] .landing-page .program-card-media {
  background: #111215;
}

:root[data-theme="dark"] .landing-page .icon-badge {
  background: rgba(138, 21, 15, 0.2);
  color: #ef716a;
}

:root[data-theme="dark"] .landing-page .cta-section {
  background: #070708;
}

:root[data-theme="dark"] .landing-page .site-footer {
  border-top-color: #2c3035;
  background: #101114;
  color: #aab2bd;
}

:root[data-theme="dark"] .landing-page .main-nav a:hover,
:root[data-theme="dark"] .landing-page .footer-links a:hover {
  color: #ef716a;
}

.simple-page {
  min-height: 100vh;
}

.page-header h1 {
  margin: 0;
  font-size: clamp(1.1rem, 3vw, 1.5rem);
}

.registration-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 22px;
  align-items: start;
  width: min(1080px, calc(100% - 36px));
  margin: 46px auto;
}

.registration-card {
  padding: clamp(18px, 3vw, 28px);
}

.form-panel {
  display: grid;
  gap: 18px;
  padding: 0;
  border: 0;
  box-shadow: none;
}

.form-heading h2 {
  margin-bottom: 0;
  font-size: clamp(1.6rem, 4vw, 2.35rem);
}

label {
  display: grid;
  gap: 7px;
  font-weight: 750;
}

input,
select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  padding: 10px 12px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.checkbox-row {
  grid-template-columns: 20px 1fr;
  align-items: center;
  color: var(--muted);
  font-weight: 650;
}

.checkbox-row input {
  width: 18px;
  min-height: 18px;
}

.telegram-panel {
  padding: 24px;
}

.telegram-panel p {
  margin-bottom: 0;
  color: var(--muted);
}

.success-card,
.ticket-card {
  display: grid;
  gap: 16px;
  text-align: center;
}

.success-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: 0 auto;
  border-radius: 50%;
  background: #e7f6ef;
  color: #127c45;
  font-size: 1.9rem;
  font-weight: 900;
}

.registration-number {
  display: inline-flex;
  justify-content: center;
  min-width: 170px;
  margin: 0 auto;
  padding: 9px 14px;
  border-radius: 8px;
  background: #faeeee;
  color: var(--teal-dark);
  font-weight: 900;
}

.qr-code {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 172px;
  height: 172px;
  margin: 6px auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.qr-code span {
  border-radius: 2px;
  background: #e7edf2;
}

.qr-code span.on {
  background: var(--ink);
}

.qr-code img,
.qr-code canvas {
  width: 100%;
  height: 100%;
}

.admin-page {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px;
  border-left: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #fbf6f5 100%);
  box-shadow: -12px 0 34px rgba(80, 24, 26, 0.05);
}

.sidebar nav {
  display: grid;
  gap: 8px;
  margin-top: 34px;
}

.sidebar nav a {
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 750;
}

.sidebar nav a:hover,
.sidebar nav a.active {
  background: linear-gradient(90deg, #f9e9e8, #fff6f3);
  color: var(--teal-dark);
}

.section-note { margin: 4px 0 0; color: var(--muted); }
.admin-course-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.admin-course-card { position: relative; overflow: hidden; padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(145deg, #fff 55%, #fdf3f0); box-shadow: 0 12px 32px rgba(71, 32, 34, .07); }
.admin-course-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: linear-gradient(90deg, var(--teal), var(--gold)); }
.course-card-top, .course-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.course-pill { padding: 5px 10px; border-radius: 999px; background: #f7e8e7; color: var(--teal-dark); font-size: .8rem; font-weight: 800; }
.course-price { color: var(--teal-dark); font-weight: 900; }
.admin-course-card h3 { margin: 20px 0 7px; font-size: 1.25rem; }
.admin-course-card > p { min-height: 52px; margin: 0 0 14px; color: var(--muted); }
.course-meta { display: grid; gap: 8px; margin: 0 0 20px; padding: 14px; border-radius: 10px; background: rgba(248, 244, 243, .9); }
.course-meta div { display: grid; grid-template-columns: 70px 1fr; gap: 10px; }
.course-meta dt { color: var(--muted); font-size: .82rem; }
.course-meta dd { margin: 0; font-weight: 700; }
.course-actions { justify-content: flex-start; }
.course-actions .btn { min-height: 40px; padding: 8px 14px; }
.course-empty { grid-column: 1/-1; display: grid; gap: 5px; border: 1px dashed var(--line); border-radius: 14px; background: #fff; }
.course-modal { width: min(780px, 100%); border-radius: 18px; }
.course-modal textarea { resize: vertical; }
.course-modal small { color: var(--muted); }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }

@media (max-width: 900px) {
  .admin-course-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .form-row { grid-template-columns: 1fr; }
  .course-card-top, .course-actions { align-items: stretch; flex-direction: column; }
  .course-actions .btn { width: 100%; }
  .public-course-details { grid-template-columns: 1fr; }
  .course-detail-modal { padding: 28px 20px 22px; border-radius: 16px; }
}

.admin-main {
  min-width: 0;
  padding: 28px clamp(18px, 4vw, 44px);
}

.topbar,
.table-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.table-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.search-input,
.filter-select {
  width: auto;
  min-width: 170px;
  min-height: 44px;
}

.topbar h1,
.table-heading h2 {
  margin: 0;
}

.admin-section {
  margin-bottom: 32px;
}

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

.stat-card strong {
  font-size: 2rem;
  line-height: 1.2;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  vertical-align: middle;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 0.82rem;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eef2f7;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.badge.confirmed,
.badge.attended {
  background: #e7f6ef;
  color: #127c45;
}

.badge.cancelled {
  background: #fdecea;
  color: #a23a2e;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
}

.text-btn {
  width: auto;
  min-width: 48px;
  padding: 0 10px;
  font-size: 0.78rem;
  font-weight: 800;
}

.danger-btn {
  border-color: rgba(162, 58, 46, 0.22);
  color: #8a150f;
}

.empty-state {
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(12, 18, 24, 0.56);
}

.student-modal {
  position: relative;
  width: min(680px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  border-radius: 8px;
  background: var(--white);
  padding: 26px;
  box-shadow: var(--shadow);
}

.student-modal form,
.settings-form {
  display: grid;
  gap: 16px;
}

.modal-close {
  position: absolute;
  top: 14px;
  left: 14px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  cursor: pointer;
  font-size: 1.2rem;
}

.details-grid,
.attendance-card-grid {
  display: grid;
  grid-template-columns: minmax(110px, auto) 1fr;
  gap: 10px 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.details-grid span,
.attendance-card-grid span {
  color: var(--muted);
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pdf-stage {
  position: fixed;
  top: 0;
  left: 0;
  z-index: -1;
  width: 420px;
  background: var(--white);
}

.is-capturing-pdf [data-download-ticket] {
  display: none;
}

.form-note,
.settings-status {
  margin: 0;
  color: var(--teal-dark);
  font-weight: 800;
}

.telegram-command {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  direction: ltr;
  font-weight: 800;
}

.scanner-section {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 22px;
}

.scanner-panel,
.attendance-result,
.settings-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  padding: 24px;
  box-shadow: 0 8px 22px rgba(31, 41, 51, 0.05);
}

.scanner-video {
  width: 100%;
  min-height: 320px;
  border-radius: 8px;
  background: #000000;
  object-fit: cover;
}

.scanner-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.scanner-controls .filter-select {
  min-width: min(260px, 100%);
  flex: 1;
}

.manual-scan {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.attendance-result h2 {
  margin-bottom: 12px;
}

.settings-card {
  max-width: 880px;
}

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

.settings-form .btn,
.settings-form .settings-status {
  grid-column: 1 / -1;
}

.login-page {
  min-height: 100vh;
}

.login-shell {
  display: grid;
  min-height: calc(100vh - 7px);
  place-items: center;
  padding: clamp(22px, 6vw, 72px);
}

.login-card {
  display: grid;
  gap: 18px;
  width: min(430px, 100%);
  padding: clamp(24px, 5vw, 38px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.login-card .brand-logo {
  width: 112px;
}

.login-card h1 {
  margin: 0;
  font-size: clamp(1.7rem, 4vw, 2.35rem);
}

.login-card label {
  display: grid;
  gap: 8px;
  font-weight: 800;
}

.login-card input,
.login-card select {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}

.login-error {
  display: none;
  margin: 0;
  color: var(--teal-dark);
  font-weight: 800;
}

.login-failed .login-error {
  display: block;
}

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

  .hero-section,
  .registration-shell {
    grid-template-columns: 1fr;
  }

  .hero-section {
    min-height: auto;
  }

  .hero-media {
    min-height: 320px;
  }

  .feature-grid,
  .team-grid,
  .contact-grid,
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .site-header,
  .page-header,
  .site-footer,
  .cta-band,
  .topbar,
  .table-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-copy h1 {
    font-size: clamp(1.95rem, 11vw, 3.4rem);
  }

  :root[data-theme="dark"] .landing-page .hero-copy h1 {
    color: #ffffff;
  }

  :root[data-theme="dark"] .landing-page .hero-section::before {
    opacity: 0.11;
  }

  :root[data-theme="dark"] .landing-page .hero-copy p:not(.eyebrow) {
    color: #eef0f3;
  }

  .header-actions {
    width: 100%;
  }

  .header-actions .btn-header-register {
    flex: 1;
  }

  .hero-media,
  .hero-media img {
    min-height: 260px;
  }

  .feature-grid,
  .program-grid,
  .team-grid,
  .contact-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .admin-page {
    grid-template-columns: 1fr;
  }

  .program-card-media {
    aspect-ratio: 4 / 3;
  }

  .program-card div {
    padding: 20px;
  }

  .sidebar {
    position: static;
    height: auto;
    border-left: 0;
    border-bottom: 1px solid var(--line);
  }

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

  .scanner-section,
  .settings-form {
    grid-template-columns: 1fr;
  }

  .manual-scan,
  .table-tools {
    flex-direction: column;
  }

  .search-input,
  .filter-select {
    width: 100%;
  }
}

@media print {
  body {
    background: var(--white);
  }

  .page-header,
  .telegram-panel,
  .site-footer,
  .ticket-card .btn {
    display: none;
  }

  .registration-shell {
    display: block;
    width: 100%;
    margin: 0;
  }

  .registration-card,
  .ticket-card {
    border: 0;
    box-shadow: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}
