/* Demo class request widget — mounted on body (not inside mobile nav drawer) */

body.page-public .demo-class-widget {
  position: fixed;
  top: var(--demo-class-panel-top, 4.75rem);
  right: 1rem;
  z-index: 10003;
  width: min(100vw - 2rem, 300px);
  max-width: calc(100vw - 2rem);
  pointer-events: none;
}

body.page-public .demo-class-widget__mobile-toggle {
  display: none;
  pointer-events: auto;
}

body.page-public .demo-class-widget__panel {
  pointer-events: auto;
  width: 100%;
  padding: 1rem 1.1rem 1.1rem;
  background: #fff;
  border: 1px solid rgba(18, 24, 32, 0.1);
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(18, 24, 32, 0.14);
  max-height: calc(100vh - var(--demo-class-panel-top, 4.75rem) - 1rem);
  overflow-y: auto;
}

body.page-public .demo-class-widget__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

body.page-public .demo-class-widget__title {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--black, #121820);
}

body.page-public .demo-class-widget__close {
  display: none;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(18, 24, 32, 0.12);
  border-radius: 50%;
  background: #f5f6f8;
  color: var(--black, #121820);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

body.page-public .demo-class-widget__close:hover {
  background: #ebecef;
  color: #000;
}

body.page-public .demo-class-widget__close:focus-visible {
  outline: 2px solid rgba(221, 178, 30, 0.65);
  outline-offset: 2px;
}

body.page-public .demo-class-widget__alert:empty {
  display: none;
}

body.page-public .demo-class-widget__alert .alert {
  margin: 0 0 0.75rem;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  font-size: 0.82rem;
  line-height: 1.4;
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
}

body.page-public .demo-class-widget__alert .alert-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

body.page-public .demo-class-widget__alert .alert-success {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

body.page-public .demo-class-widget__field {
  margin-bottom: 0.7rem;
}

body.page-public .demo-class-widget__field label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted, #5a6570);
}

body.page-public .demo-class-widget__field input,
body.page-public .demo-class-widget__field select {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid rgba(18, 24, 32, 0.12);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.88rem;
  color: var(--black, #121820);
  background: #fafafa;
  box-sizing: border-box;
}

body.page-public .demo-class-widget__field input:focus,
body.page-public .demo-class-widget__field select:focus {
  outline: 2px solid rgba(221, 178, 30, 0.55);
  outline-offset: 1px;
  background: #fff;
}

body.page-public .demo-class-widget__submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.6rem 1rem;
  border: none;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(145deg, #c9a010, var(--accent, #ddb21e));
  box-shadow: 0 6px 18px rgba(221, 178, 30, 0.35);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

body.page-public .demo-class-widget__submit:hover:not(:disabled) {
  transform: translateY(-1px);
}

body.page-public .demo-class-widget__submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* Mobile: always on screen (not inside hamburger drawer); tap bar to expand form */
@media (max-width: 991px) {
  body.page-public .demo-class-widget {
    top: auto;
    bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
    right: 0.75rem;
    left: 0.75rem;
    width: auto;
    max-width: none;
  }

  body.page-public .demo-class-widget__mobile-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    margin: 0 0 0.5rem;
    padding: 0.7rem 1rem;
    border: 1px solid rgba(232, 185, 35, 0.45);
    border-radius: 999px;
    background: linear-gradient(145deg, #fff9e6, #fff);
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--black, #121820);
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(20, 24, 40, 0.1);
  }

  body.page-public .demo-class-widget__mobile-toggle-icon {
    transition: transform 0.2s ease;
  }

  body.page-public .demo-class-widget--expanded .demo-class-widget__mobile-toggle-icon {
    transform: rotate(180deg);
  }

  body.page-public .demo-class-widget__panel {
    display: none;
    max-height: min(62vh, 480px);
  }

  body.page-public .demo-class-widget--expanded .demo-class-widget__panel {
    display: block;
  }

  body.page-public .demo-class-widget__close {
    display: inline-flex;
  }

  body.page-public.demo-class-widget-mounted {
    padding-bottom: calc(4.25rem + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 720px) {
  body.page-public .demo-class-widget__panel {
    max-height: min(58vh, 440px);
  }
}
