.demo-page {
  min-height: 100vh;
  margin: 0;
  color: #132238;
  background:
    linear-gradient(90deg, rgba(12, 21, 42, 0.88), rgba(19, 34, 56, 0.28)),
    url("/super-map-reference.png") center / cover fixed;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

.demo-page::before {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(rgba(255, 255, 255, 0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.12) 1px, transparent 1px);
  background-size: 54px 54px;
  mix-blend-mode: soft-light;
}

.demo-shell {
  position: relative;
  z-index: 1;
  display: block;
  width: min(430px, calc(100% - 20px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 14px 0;
}

.demo-copy {
  display: none;
  color: #ffffff;
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.35);
}

.demo-copy h1 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(42px, 6.8vw, 92px);
  line-height: 0.92;
  letter-spacing: 0;
}

.demo-copy p {
  max-width: 560px;
  margin: 22px 0 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 20px;
  line-height: 1.55;
}

.demo-kicker {
  display: inline-flex;
  margin: 0 0 18px;
  padding: 8px 14px;
  border: 2px solid rgba(255, 255, 255, 0.48);
  border-radius: 8px;
  background: #ffcf38;
  color: #1c2c55;
  box-shadow: 6px 6px 0 rgba(19, 34, 56, 0.48);
  font-size: 15px;
  font-weight: 900;
  text-transform: uppercase;
}

.alfacrm-widget {
  width: min(430px, 100%);
  max-width: 430px;
  margin: 0 auto;
  overflow: visible;
  color: #16233c;
  background: rgba(255, 255, 255, 0.92);
  border: 3px solid #16233c;
  border-radius: 8px;
  box-shadow: 8px 10px 0 rgba(20, 24, 48, 0.58), 0 22px 70px rgba(0, 0, 0, 0.26);
}

.alfacrm-widget * {
  box-sizing: border-box;
}

.alfacrm-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 128px;
  min-height: 170px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(113, 70, 255, 0.94), rgba(236, 56, 111, 0.82)),
    linear-gradient(45deg, #5bd7ff, #f8ff7a);
  color: #ffffff;
}

.alfacrm-hero::before {
  position: absolute;
  inset: 15px -76px auto auto;
  width: 230px;
  height: 64px;
  content: "";
  background: #ffcf38;
  border: 3px solid #16233c;
  transform: rotate(-14deg);
  box-shadow: 7px 7px 0 rgba(22, 35, 60, 0.38);
}

.alfacrm-hero::after {
  position: absolute;
  inset: auto -52px -30px auto;
  width: 210px;
  height: 112px;
  content: "";
  background: rgba(91, 215, 255, 0.28);
  border: 3px dashed rgba(255, 255, 255, 0.6);
  transform: rotate(-9deg);
}

.alfacrm-hero-copy {
  position: relative;
  z-index: 1;
  padding: 20px 18px 18px;
}

.alfacrm-hero h2 {
  max-width: 260px;
  margin: 16px 0 0;
  color: #ffffff;
  font-size: 35px;
  line-height: 0.94;
  letter-spacing: 0;
}

.alfacrm-character {
  position: relative;
  z-index: 2;
  align-self: end;
  width: 132px;
  height: 170px;
  object-fit: cover;
  object-position: 50% 7%;
  filter: drop-shadow(0 18px 18px rgba(13, 20, 38, 0.42));
}

.alfacrm-speed-note {
  display: inline-flex;
  align-items: center;
  min-height: 39px;
  padding: 8px 12px;
  border: 2px solid #16233c;
  border-radius: 8px;
  background: #ffcf38;
  color: #16233c;
  box-shadow: 6px 6px 0 #16233c, 0 0 24px rgba(255, 207, 56, 0.75);
  font-size: 15px;
  font-weight: 950;
  text-transform: uppercase;
  transform-origin: left center;
  animation: alfacrm-blink 0.85s ease-in-out infinite;
}

@keyframes alfacrm-blink {
  0%,
  100% {
    transform: scale(1);
    filter: brightness(1) saturate(1);
  }

  50% {
    transform: scale(1.075) rotate(-1deg);
    filter: brightness(1.28) saturate(1.18);
  }
}

.alfacrm-body {
  overflow: visible;
  padding: 16px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.92)),
    repeating-linear-gradient(-8deg, rgba(92, 215, 255, 0.16) 0 12px, transparent 12px 24px);
}

.alfacrm-field {
  display: grid;
  gap: 7px;
}

.alfacrm-field span,
.alfacrm-consent {
  color: #334155;
  font-size: 13px;
  font-weight: 900;
}

.alfacrm-field input,
.alfacrm-field select,
.alfacrm-field textarea {
  width: 100%;
  min-height: 46px;
  border: 2px solid #16233c;
  border-radius: 8px;
  padding: 11px 12px;
  color: #16233c;
  background: #ffffff;
  font: inherit;
  outline: 0;
}

.alfacrm-field input:focus,
.alfacrm-field select:focus,
.alfacrm-field textarea:focus {
  border-color: #7146ff;
  box-shadow: 0 0 0 4px rgba(113, 70, 255, 0.16);
}

.alfacrm-field textarea {
  min-height: 78px;
  resize: vertical;
}

.alfacrm-slots {
  display: grid;
  gap: 12px;
  padding: 2px 2px 12px;
}

.alfacrm-calendar-head {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  gap: 10px;
  align-items: center;
}

.alfacrm-calendar-head strong {
  min-height: 44px;
  padding: 10px 12px;
  border: 2px solid #16233c;
  border-radius: 8px;
  background: #ffcf38;
  box-shadow: 4px 4px 0 rgba(22, 35, 60, 0.22);
  text-align: center;
}

.alfacrm-calendar-head button {
  min-height: 44px;
  border: 2px solid #16233c;
  border-radius: 8px;
  background: #9df6ff;
  color: #16233c;
  box-shadow: 4px 4px 0 rgba(22, 35, 60, 0.22);
  font-size: 26px;
  font-weight: 900;
  cursor: pointer;
}

.alfacrm-teacher-filter {
  display: grid;
  gap: 7px;
}

.alfacrm-teacher-filter span {
  color: #334155;
  font-size: 13px;
  font-weight: 900;
}

.alfacrm-teacher-filter select {
  min-height: 44px;
  border: 2px solid #16233c;
  border-radius: 8px;
  padding: 9px 11px;
  background: #ffffff;
  color: #16233c;
  font: inherit;
}

.alfacrm-custom-time-button {
  min-height: 50px;
  border: 2px solid #16233c;
  border-radius: 8px;
  background: #ffffff;
  color: #7146ff;
  box-shadow: 5px 5px 0 rgba(113, 70, 255, 0.28);
  font: inherit;
  font-weight: 950;
  cursor: pointer;
}

.alfacrm-custom-time-button:hover {
  background: #f3e8ff;
}

.alfacrm-week {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  overflow: visible;
  padding: 2px 2px 8px;
}

.alfacrm-day {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 146px;
  border: 2px solid #16233c;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 4px 4px 0 rgba(22, 35, 60, 0.16);
}

.alfacrm-day-title {
  display: grid;
  gap: 2px;
  padding: 7px 5px;
  border-bottom: 2px solid rgba(22, 35, 60, 0.2);
  text-align: center;
}

.alfacrm-day-title strong {
  color: #7146ff;
  font-size: 14px;
  text-transform: uppercase;
}

.alfacrm-day-title span {
  color: #475569;
  font-size: 12px;
  font-weight: 900;
}

.alfacrm-day-slots {
  display: grid;
  gap: 6px;
  align-content: start;
  padding: 7px;
}

.alfacrm-slot {
  position: relative;
  display: grid;
  gap: 4px;
  min-height: 78px;
  border: 2px solid #16233c;
  border-radius: 8px;
  padding: 8px;
  background: #f7fbff;
  color: #16233c;
  text-align: left;
  cursor: pointer;
  box-shadow: 4px 4px 0 rgba(22, 35, 60, 0.18);
}

.alfacrm-slot:hover,
.alfacrm-slot.is-selected {
  background: #eaffdf;
  box-shadow: 5px 5px 0 rgba(113, 70, 255, 0.36);
  transform: translate(-1px, -1px);
}

.alfacrm-slot.is-selected {
  border-color: #0f766e;
  background: #ccfbf1;
  box-shadow: 7px 7px 0 #0f766e, 0 0 0 4px rgba(15, 118, 110, 0.16);
}

.alfacrm-slot.is-selected::after {
  align-self: start;
  justify-self: start;
  width: max-content;
  padding: 3px 7px;
  border: 2px solid #16233c;
  border-radius: 999px;
  background: #ffffff;
  color: #0f766e;
  content: "Выбрано";
  font-size: 11px;
  font-weight: 950;
}

.alfacrm-slot-check {
  position: absolute;
  top: -10px;
  right: -10px;
  display: none;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 2px solid #16233c;
  border-radius: 999px;
  background: #0f766e;
  color: #ffffff;
  box-shadow: 3px 3px 0 rgba(22, 35, 60, 0.35);
  font-size: 18px;
  font-weight: 950;
}

.alfacrm-slot.is-selected .alfacrm-slot-check {
  display: grid;
}

.alfacrm-slot strong {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: baseline;
  color: #ec386f;
  font-size: 19px;
  line-height: 1;
}

.alfacrm-slot strong small {
  color: #16233c;
  font-size: 11px;
  font-weight: 950;
}

.alfacrm-slot span,
.alfacrm-slot small {
  overflow-wrap: anywhere;
}

.alfacrm-slot span {
  color: #16233c;
  font-size: 11px;
  font-weight: 950;
}

.alfacrm-slot small {
  color: #475569;
  font-size: 11px;
  line-height: 1.3;
}

.alfacrm-no-slot {
  display: grid;
  min-height: 54px;
  place-items: center;
  color: #94a3b8;
  font-weight: 900;
}

.alfacrm-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 3px dashed rgba(22, 35, 60, 0.24);
}

.alfacrm-progress {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 2px solid #16233c;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 4px 4px 0 rgba(22, 35, 60, 0.16);
}

.alfacrm-progress-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #16233c;
  font-size: 14px;
  font-weight: 950;
}

.alfacrm-progress-track {
  height: 12px;
  overflow: hidden;
  border: 2px solid #16233c;
  border-radius: 999px;
  background: #e2e8f0;
}

.alfacrm-progress-track div {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #9dff87, #0f766e);
  transition: width 180ms ease;
}

.alfacrm-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.alfacrm-custom-time {
  grid-column: 1 / -1;
  padding: 12px;
  border: 2px solid #7146ff;
  border-radius: 8px;
  background: #f3e8ff;
}

.alfacrm-custom-time[hidden] {
  display: none;
}

.alfacrm-wide {
  grid-column: 1 / -1;
}

.alfacrm-consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  line-height: 1.35;
}

.alfacrm-consent input {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  accent-color: #7146ff;
}

.alfacrm-consent a {
  color: #7146ff;
}

.alfacrm-submit {
  min-height: 54px;
  border: 2px solid #16233c;
  border-radius: 8px;
  background: #ec386f;
  color: #ffffff;
  box-shadow: 6px 6px 0 #16233c;
  font: inherit;
  font-size: 17px;
  font-weight: 950;
  cursor: pointer;
}

.alfacrm-submit:hover {
  background: #7146ff;
}

.alfacrm-submit:disabled {
  cursor: progress;
  opacity: 0.72;
}

.alfacrm-message {
  min-height: 22px;
  color: #475569;
  font-size: 14px;
  line-height: 1.45;
}

.alfacrm-message.is-error {
  color: #b42318;
}

.alfacrm-message.is-success {
  color: #087443;
}

.alfacrm-success {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 2px solid #16233c;
  border-radius: 8px;
  background: #eaffdf;
  box-shadow: 5px 5px 0 rgba(22, 35, 60, 0.22);
}

.alfacrm-success[hidden] {
  display: none;
}

.alfacrm-success strong {
  color: #087443;
  font-size: 20px;
}

.alfacrm-success span {
  color: #334155;
  line-height: 1.35;
}

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

.alfacrm-success-actions button,
.alfacrm-success-actions a {
  min-height: 42px;
  padding: 10px 12px;
  border: 2px solid #16233c;
  border-radius: 8px;
  background: #9df6ff;
  color: #16233c;
  box-shadow: 3px 3px 0 rgba(22, 35, 60, 0.22);
  font: inherit;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}

.alfacrm-empty {
  grid-column: 1 / -1;
  padding: 18px;
  border: 2px dashed #7146ff;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  color: #475569;
  text-align: center;
}

@media (max-width: 980px) {
  .demo-shell {
    padding-top: 14px;
  }

  .alfacrm-widget {
    max-height: none;
  }

  .alfacrm-body {
    max-height: none;
  }
}

@media (max-width: 640px) {
  .demo-shell {
    width: min(100% - 14px, 430px);
    padding-top: 8px;
  }

  .alfacrm-hero {
    grid-template-columns: 1fr 118px;
    min-height: 170px;
  }

  .alfacrm-hero-copy {
    padding: 20px;
  }

  .alfacrm-hero h2 {
    font-size: 34px;
  }

  .alfacrm-character {
    width: 128px;
    height: 170px;
  }

  .alfacrm-week {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }

  .alfacrm-form-grid {
    grid-template-columns: 1fr;
  }

  .alfacrm-body {
    padding: 16px;
  }
}
