/* ===== Booking form layout ===== */

/* The `hidden` attribute must always win over component display rules
   (e.g. .default-btn { display: flex } would otherwise keep a hidden button
   visible). JS toggles `hidden` to switch frame-5 states on/off. */
.booking__frame [hidden] {
  display: none !important;
}

.booking__form {
  width: 100%;
  max-width: 328px;
}

#frame-2 .booking__form {
  display: grid;
  grid-template-columns: 1fr;
  column-gap: 0;
  row-gap: 16px;
  max-width: none;
  margin-top: 24px;
}

#frame-2 .booking__form .row {
  display: contents;
}

#frame-2 .booking__form .row.separator.row--datetime {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  grid-column: 1 / -1;
  width: 100%;
  margin-top: 8px;
  padding-bottom: 0;
  box-sizing: border-box;
  border-bottom: none;
}

#frame-2 .booking__form .row.separator.row--datetime > * {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  flex: 0 0 auto;
}

#frame-2 .booking__form > .booking__form-attendee-title {
  grid-column: 1 / -1;
  margin-top: 0;
  margin-bottom: -4px;
}

#frame-2 .booking__form .row.separator.row--datetime .details__meeting-heading {
  grid-column: 1 / -1;
  width: 100%;
  margin: 0;
  padding: 0;
  font-family: "Inter", sans-serif;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.3;
  color: var(--booking-timezone-text);
}

@media (min-width: 768px) {
  #frame-2 .booking__form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 24px;
  }

  #frame-2 .booking__form .row.separator.row--datetime {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 24px;
  }

  #frame-2 .booking__form-field.booking__form-field--fullname {
    grid-column: 1;
  }

  #frame-2 .booking__form input[name="email"] {
    grid-column: 2;
  }

  #frame-2 .booking__form input[name="phone"] {
    grid-column: 1;
  }

  #frame-2 .booking__form input[name="code"] {
    grid-column: 2;
  }

  #frame-2 .booking__form .details__date {
    grid-column: 1;
  }

  #frame-2 .booking__form .details__time {
    grid-column: 2;
  }

  #frame-2 .booking__form-field.booking__form-field--phone {
    max-width: 272px;
  }
}

#frame-2 .booking__form .row.separator.row--platform {
  display: block;
  grid-column: 1 / -1;
  width: 100%;
  padding-bottom: 24px;
  margin-top: -4px;
  border-top: none;
}

#frame-2 .booking__form .row.separator.row--platform .details__platform {
  margin-top: 0;
}

#frame-2 .booking__form .row.booking__form-row--code {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  grid-column: 1 / -1;
  width: 100%;
  margin-top: 8px;
}

#frame-2 .booking__form .row.booking__form-row--code .booking__form-field--code {
  flex: 0 1 auto;
  max-width: 272px;
  width: 100%;
}

#frame-2 .booking__form .row.booking__form-row--code img.code {
  flex-shrink: 0;
  margin-left: auto;
}

/* ===== Form field detail rows (date/time/platform in frame 2) ===== */

#frame-2 .booking__form-field,
#frame-2 .booking__form .details__date,
#frame-2 .booking__form .details__time {
  margin: 0;
}

#frame-2 .booking__form .details__date {
  display: block;
  font-family: "Inter", sans-serif;
  font-weight: 500;
  font-size: 16px;
  line-height: 1.3;
  letter-spacing: 0;
}

#frame-2 .booking__form .details__date::before {
  content: "Date";
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  width: 100%;
  min-height: 20px;
  margin-bottom: 4px;
  padding-left: 28px;
  font-family: "Inter", sans-serif;
  font-weight: 600;
  font-size: 14px;
  line-height: 20px;
  letter-spacing: 0;
  color: var(--booking-timezone-text);
  background-image: url("../../images/booking/icons/calendar-icon.svg");
  background-repeat: no-repeat;
  background-position: left center;
  background-size: 20px 20px;
}

#frame-2 .booking__form .details__time {
  display: block;
  font-family: "Inter", sans-serif;
  font-weight: 500;
  font-size: 16px;
  line-height: 1.3;
  letter-spacing: 0;
  white-space: normal;
}

#frame-2 .booking__form .details__time::before {
  content: "Time";
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  width: 100%;
  min-height: 20px;
  margin-bottom: 4px;
  padding-left: 28px;
  font-family: "Inter", sans-serif;
  font-weight: 600;
  font-size: 14px;
  line-height: 20px;
  letter-spacing: 0;
  color: var(--booking-timezone-text);
  background-image: url("../../images/booking/icons/alarm-icon.svg");
  background-repeat: no-repeat;
  background-position: left center;
  background-size: 20px 20px;
}

#frame-2 .booking__form .details__time-main {
  display: block;
}

#frame-2 .booking__form .details__time-zone {
  display: block;
  margin-top: 2px;
  font-family: "Inter", sans-serif;
  font-weight: 400;
  font-size: 12px;
  line-height: 1.2;
  letter-spacing: 0;
  color: var(--gray-600);
}

#frame-2 .booking__form .details__platform {
  grid-column: 1 / -1;
  font-family: "Inter", sans-serif;
  font-weight: 500;
  font-size: 16px;
  line-height: 1.3;
  color: var(--booking-timezone-text);
}

#frame-2 .booking__form-field.booking__form-field--textarea,
#frame-2 .booking__form-field.booking__form-field--phone {
  grid-column: 1 / -1;
}

#frame-2 .booking__form-field.booking__form-field--code {
  width: 100%;
  max-width: 272px;
}

/* ===== Form field labels & inputs (frame 2) ===== */

#frame-2 .booking__form .booking__form-field label {
  font-family: "Inter", sans-serif;
  font-weight: 500;
  font-size: 14px;
  line-height: 1.3;
  color: var(--gray-600);
  padding-top: 14px;
  padding-bottom: 14px;
  padding-left: 28px;
}

#frame-2 .booking__form .booking__form-field input {
  padding-top: 14px;
  padding-bottom: 14px;
  padding-left: 28px;
}

#frame-2 .booking__form .booking__form-field--fullname,
#frame-2 .booking__form .booking__form-field--email,
#frame-2 .booking__form .booking__form-field--phone,
#frame-2 .booking__form .booking__form-field--code {
  --field-icon-size: 20px;
  --field-icon-color: var(--gray-300);
}

#frame-2 .booking__form .booking__form-field--fullname::before,
#frame-2 .booking__form .booking__form-field--email::before,
#frame-2 .booking__form .booking__form-field--phone::before,
#frame-2 .booking__form .booking__form-field--code::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: var(--field-icon-size);
  height: var(--field-icon-size);
  background-color: var(--field-icon-color);
  -webkit-mask-image: var(--field-icon);
  mask-image: var(--field-icon);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  pointer-events: none;
}

#frame-2 .booking__form .booking__form-field--fullname {
  --field-icon: url("../../images/booking/icons/account_circle_icon.svg");
}

#frame-2 .booking__form .booking__form-field--email {
  --field-icon: url("../../images/booking/icons/email_icon.svg");
}

#frame-2 .booking__form .booking__form-field--phone {
  --field-icon: url("../../images/booking/icons/phone_icon.svg");
}

#frame-2 .booking__form .booking__form-field--code {
  --field-icon: url("../../images/booking/icons/verify_code_icon.svg");
  --field-icon-size: 24px;
}

#frame-2 .booking__form .booking__form-field.error {
  --field-icon-color: var(--red-300);
}

#frame-2 .booking__form .booking__form-field.error label,
#frame-2 .booking__form .booking__form-field.error input::placeholder,
#frame-2 .booking__form .booking__form-field.error textarea::placeholder {
  color: var(--red-300);
}

#frame-2 .booking__form.booking__form--oauth .booking__form-field--fullname,
#frame-2 .booking__form.booking__form--oauth .booking__form-field--email,
#frame-2 .booking__form.booking__form--oauth .booking__form-row--code {
  display: none;
}

#frame-2 .booking__form.booking__form--oauth .booking__form-field--phone:not(:has(input[required])) {
  display: none;
}

#frame-2 .booking__form .booking__notes-title {
  grid-column: 1 / -1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: "Inter", sans-serif;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.5;
  color: var(--booking-timezone-text);
}

#frame-2 .booking__form .booking__notes-title::before {
  content: "";
  width: 20px;
  height: 20px;
  background-image: url("../../images/booking/icons/notes_icon.svg");
  background-repeat: no-repeat;
  background-size: 20px 20px;
}

#frame-2 .booking__organiser-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  margin-bottom: 0;
  font-family: "Inter", sans-serif;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.5;
  color: var(--booking-timezone-text);
}

#frame-2 .booking__organiser-title::before {
  content: "";
  width: 20px;
  height: 20px;
  background-image: url("../../images/booking/icons/account_circle_icon.svg");
  background-repeat: no-repeat;
  background-size: 20px 20px;
}

#frame-2 .booking__attendees-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-family: "Inter", sans-serif;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.5;
  color: var(--booking-timezone-text);
}

#frame-2 .booking__attendees-title::before {
  content: "";
  width: 20px;
  height: 20px;
  background-image: url("../../images/booking/icons/attendees_icon.svg");
  background-repeat: no-repeat;
  background-size: 20px 20px;
}

#frame-2 .booking__form .booking__form-field--textarea {
  border: none;
  border-bottom: 1px solid var(--gray-200);
  border-radius: 0;
}

#frame-2 .booking__form .booking__form-field--textarea:hover {
  border-bottom-color: var(--gray-500);
}

#frame-2 .booking__form .booking__form-field--textarea:has(textarea:focus) {
  border-bottom-color: var(--green-500);
}

#frame-2 .booking__form .booking__form-field--textarea.error {
  border-bottom-color: var(--red-300);
}

#frame-2 .booking__form .booking__form-field--textarea label {
  padding-left: 0;
  padding-top: 0;
  top: 0;
}

#frame-2 .booking__form .booking__form-field--textarea textarea[name="description"] {
  padding: 0;
  border: 0;
  background-image: none;
  resize: vertical;
}

@media (max-width: 992px) {
  .booking__form {
    margin: 0 auto;
  }
}

/* ===== Form field base ===== */

.booking__form-field {
  position: relative;
  border-bottom: 1px solid var(--gray-200);
  border-radius: 0;
  width: 100%;
  height: 52px;
  transition: all 200ms;

  &.error{
    border-bottom: 1px solid var(--red-300);

    label {
      color: var(--red-300);
    }

    input::placeholder,
    textarea::placeholder {
      color: var(--red-300);
    }
  }

  img {
    position: absolute;
    right: 0;
    top: 0;
  }

  &:not(:first-child) {
    margin-top: 16px;
  }

  label {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    pointer-events: none;
    font-weight: 400;
    font-size: 16px;
    color: var(--gray-600);
    opacity: 1;
  }

  input,
  textarea {
    width: 100%;
    height: 100%;
    padding-block: 16px;
    background-color: transparent;
    color: var(--black);
    border: none;
    outline: none;
    resize: none;
  }

  input[readonly] {
    cursor: default;
    color: var(--gray-700);
    pointer-events: none;
  }

  input:focus + label,
  textarea:focus + label {
    opacity: 0;
  }

  input:not(:placeholder-shown) + label,
  textarea:not(:placeholder-shown) + label {
    clip: rect(1px, 1px, 1px, 1px);
  }

  &:hover:not(.error) {
    border-color: var(--gray-500);
  }

  &:has(input:focus, textarea:focus):not(.error) {
    border-color: var(--green-500);

    input,
    textarea {
      + label {
        color: var(--black);
      }
    }
  }

  &.error:has(input:focus, textarea:focus) {
    border-bottom-color: var(--red-300);
  }
}

.booking__form-field--textarea {
  height: auto;
  min-height: 52px;
}

.booking__form-field--textarea textarea {
  height: auto;
  min-height: 90px;
  resize: vertical;
  overflow: auto;
  padding-right: 28px;
}

.booking__form-field--textarea label {
  top: 16px;
  transform: none;
}

/* ===== Buttons ===== */

.default-btn {
  width: 100%;
  background-color: var(--green-500);
  padding-block: 13px;
  border: none;
  border-radius: 4px;
  font-weight: 700;
  font-size: 14px;
  color: var(--white-primary);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  width: 220px;
  height: 48px;
  min-width: 200px;
  padding: 16px 32px;
  border-radius: 50px;
  font-family: "Inter", sans-serif;
  font-weight: 500;
  font-size: 14px;
  line-height: 1.2;
  letter-spacing: 0;
  text-align: center;
  color: var(--white-primary);
  transition: background-color 0.28s ease;
  display: flex;
  margin: 24px auto 0;
}

.select-new-time-btn {
  margin-top: 30px;
}

.default-btn.booking__form-btn {
  margin-top: 39px;
  position: relative;
  text-align: center;
}

#frame-2 .booking__form .default-btn.booking__form-btn {
  grid-column: 1 / -1;
  justify-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 35px;
  width: 220px;
  height: 48px;
  min-width: 200px;
  padding: 16px 32px;
  border-radius: 50px;
  background-color: var(--green-500);
  font-family: "Inter", sans-serif;
  font-weight: 500;
  font-size: 14px;
  line-height: 1.2;
  letter-spacing: 0;
  text-align: center;
  color: var(--white-primary);
  transition: background-color 0.28s ease;
}

#frame-2 .booking__form .default-btn.booking__form-btn:hover,
#frame-7 .select-new-time-btn:hover {
  background-color: var(--green-600);
}

.default-btn.booking__form-btn--loading,
.default-btn.booking__form-btn[disabled] {
  cursor: default;
  background-color: #47d676;
}

.default-btn.booking__form-btn--loading::after {
  content: url("../../images/booking/loader.svg");
  position: absolute;
  width: 18px;
  height: 18px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  animation: spinnerCenter 1s infinite linear;
}

.default-btn.cancel-meeting-btn--loading,
.default-btn.cancel-meeting-btn[disabled] {
  cursor: default;
  background-color: #eb5e7585;
  position: relative;
}

.default-btn.cancel-meeting-btn--loading::after {
  content: url("../../images/booking/loader.svg");
  position: absolute;
  width: 18px;
  height: 18px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  animation: spinnerCenter 1s infinite linear;
}

.default-btn.send-copy-btn {
  margin-top: 16px;
}

.default-btn.cancel-meeting-btn {
  margin-top: 24px;
  background-color: var(--red-300);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 220px;
  height: 48px;
  min-width: 200px;
  padding: 16px 32px;
  border-radius: 50px;
  font-family: "Inter", sans-serif;
  font-weight: 500;
  font-size: 14px;
  line-height: 1.2;
  letter-spacing: 0;
  text-align: center;
  color: var(--white-primary);
  transition: background-color 0.28s ease;
}

#frame-5 .cancel-meeting-btn.default-btn {
  display: flex;
  margin: 24px auto 0;
}
