/* ============================================================
   Demo - "Book a demo" appointment page
   Full-screen starry-mountain background with a centered form.
   ============================================================ */

.demo-page {
  position: relative;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 40px 24px;
}

/* Fixed layer rather than background-attachment: fixed, which iOS Safari
   renders wrong. The card scrolls over it when the calendar is embedded. */
.demo-page::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background-color: #0b1020;
  background-image: url('../assets/images/demo/demo-bg.jpg');
  background-size: cover;
  background-position: center bottom;
  background-repeat: no-repeat;
}

.demo-close {
  position: absolute;
  top: 24px;
  right: 28px;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-white);
  font-size: 24px;
  border-radius: 999px;
  transition: background-color 160ms ease, transform 120ms ease;
}

.demo-close:hover {
  background-color: rgba(255, 255, 255, 0.14);
}

.demo-close:active {
  transform: scale(0.94);
}

/* Card ------------------------------------------------------- */
.demo-card {
  width: 100%;
  max-width: 866px;
  /* auto margins instead of align-items: center - centering a flex item
     taller than the viewport clips its top out of the scroll range. */
  margin: auto;
  background: var(--brand-white);
  border-radius: 8px;
  padding: 40px;
  box-shadow: 0 30px 80px rgba(9, 12, 24, 0.5);
}

.demo-form {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* Intro ------------------------------------------------------ */
.demo-form__intro {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.demo-form__title {
  margin: 0;
  font-size: 32px;
  line-height: 40px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #111827;
}

.demo-form__subtitle {
  margin: 0;
  max-width: 436px;
  font-size: 16px;
  line-height: 1.4;
  font-weight: 400;
  color: #111827;
}

/* Field grid ------------------------------------------------- */
.demo-form__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.demo-form__col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.demo-field {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.demo-field--grow {
  flex: 1 0 auto;
}

.demo-field__label {
  font-size: 16px;
  line-height: 1.4;
  font-weight: 400;
  color: #111827;
}

.demo-field__input {
  width: 100%;
  height: 48px;
  padding: 12px;
  background: #faf8f8;
  border: 1px solid #bdbdbd;
  border-radius: 4px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.015em;
  color: #111827;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.demo-field__input::placeholder {
  color: #c8c8c8;
}

.demo-field__input:hover {
  border-color: #9a9a9a;
}

.demo-field__input:focus {
  outline: none;
  border-color: #111827;
  box-shadow: 0 0 0 1px #111827;
}

/* Select ----------------------------------------------------- */
.demo-field__select {
  position: relative;
}

.demo-field__input--select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 40px;
  cursor: pointer;
}

.demo-field__chevron {
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  font-size: 14px;
  color: #111827;
  pointer-events: none;
}

/* Textarea --------------------------------------------------- */
.demo-field__input--textarea {
  height: 248px;
  padding: 12px;
  line-height: 1.5;
  resize: vertical;
}

/* Actions ---------------------------------------------------- */
.demo-form__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.demo-form__submit {
  padding: 10px 20px;
  background: #1d1d1d;
  color: var(--brand-white);
  border: none;
  border-radius: 5px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 160ms ease, transform 120ms ease;
}

.demo-form__submit:hover {
  background: #000000;
}

.demo-form__submit:active {
  transform: translateY(1px);
}

.demo-form__submit:disabled {
  cursor: wait;
  opacity: 0.55;
}

.demo-form__consent {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: 0.015em;
  font-weight: 500;
  color: #646464;
}

.demo-form__consent a {
  color: inherit;
  text-decoration: underline;
}

.demo-form__status {
  display: none;
  margin: 0;
  padding: 16px;
  border-radius: 4px;
  font-size: 16px;
  line-height: 1.4;
}

.demo-form__status--success {
  min-height: 626px;
  padding: 32px 36px;
  background:
    radial-gradient(circle at 100% 0, rgba(213, 239, 235, 0.9), transparent 32%),
    linear-gradient(135deg, #f9fbfa 0%, #edf6f2 100%);
  border: 1px solid #d8e9e1;
  color: #111827;
  flex-direction: column;
  justify-content: space-between;
}

.demo-form__success-brand {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 8px;
  color: #111827;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.06em;
}

.demo-form__success-brand svg {
  width: 25px;
  height: 29px;
}

.demo-form__success-content {
  max-width: 500px;
  margin: auto;
  text-align: center;
}

.demo-form__success-icon {
  width: 52px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  border-radius: 50%;
  background: #1d6551;
  color: var(--brand-white);
  font-size: 20px;
}

.demo-form__success-eyebrow {
  margin: 0 0 10px;
  color: #1d6551;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.demo-form__success-title {
  margin: 0;
  color: #111827;
  font-size: 36px;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.demo-form__success-copy {
  max-width: 390px;
  margin: 16px auto 0;
  color: #4b5563;
  font-size: 16px;
  line-height: 1.5;
}

.demo-form__success-actions {
  display: flex;
  justify-content: center;
}

.demo-form__success-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #111827;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.demo-form__success-link:hover {
  text-decoration: underline;
}

.demo-form__status--error {
  background: #fceded;
  color: #9c1c1c;
}

/* Responsive ------------------------------------------------- */
@media (max-width: 720px) {
  .demo-page {
    padding: 24px 16px;
    align-items: flex-start;
  }

  .demo-card {
    padding: 24px;
  }

  .demo-form {
    gap: 28px;
  }

  .demo-form__title {
    font-size: 26px;
    line-height: 32px;
  }

  .demo-form__grid {
    grid-template-columns: 1fr;
  }

  .demo-field__input--textarea {
    height: 160px;
  }

  .demo-form__status--success {
    min-height: 430px;
    padding: 24px;
  }

  .demo-form__success-title {
    font-size: 28px;
  }
}
