/* The central sign-in's pages (spec 03 RE-IAM-14), loaded only by them (UNFOLD_SIGN_IN["STYLES"]): Unfold's own
   sign-in layout made a form beside a picture from laptop width (Unfold shows its picture only on wide screens), with
   the website's pill buttons, the platform's logo, and the account request's modal (RE-IAM-15). */

@media (min-width: 640px) {
  body.login #page > div:first-child > div:first-child {
    width: 26rem;
  }
}

@media (min-width: 1024px) {
  body.login #page > .bg-cover {
    display: block;
    flex: 0 0 50%;
    max-width: none;
    background-position: center;
  }
}

@media (min-width: 1536px) {
  body.login #page > .bg-cover {
    flex-basis: 55%;
  }
}

.central-logo img {
  width: auto;
  height: 3.5rem;
  margin-bottom: 1.5rem;
}

body .central-pill {
  border-radius: 9999px;
}

.central-request {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-base-200, #e5e7eb);
}

.dark .central-request {
  border-top-color: var(--color-base-800, #1f2937);
}

.central-or {
  margin-bottom: 0.75rem;
  text-align: center;
}

/* The account request's modal (RE-IAM-15): a header, a body that scrolls, and a footer that stays in view. */
.central-modal {
  display: flex;
  flex-direction: column;
  width: min(40rem, calc(100vw - 2rem));
  max-height: calc(100dvh - 2rem);
  overflow: hidden;
  border-radius: 1rem;
  box-shadow: 0 30px 70px -20px rgb(15 23 42 / 0.45);
}

.central-modal form {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.central-modal__head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: start;
  padding: 1.5rem 1.5rem 1.25rem;
  border-bottom: 1px solid var(--color-base-200);
}

.central-modal__mark {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.75rem;
  color: var(--color-primary-600);
  background: var(--color-primary-50);
}

.central-modal__title {
  font-size: 1.125rem;
  line-height: 1.4;
}

.central-modal__lead {
  color: var(--color-base-500);
  font-size: 0.875rem;
  line-height: 1.55;
}

.central-modal__close {
  margin-top: -0.25rem;
}

.central-modal__body {
  display: grid;
  gap: 1rem;
  min-height: 0;
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  scrollbar-width: thin;
}

.central-modal__body .form-field,
.central-modal__body .form-checkbox {
  margin-bottom: 0;
}

.central-pair {
  display: grid;
  gap: 1rem;
}

@media (min-width: 640px) {
  .central-pair {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* What the person needs: Unfold's radios side by side, each a card with its icon. */
#id_request_need {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.625rem;
}

#id_request_need label {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  height: 100%;
  padding: 0.75rem 0.875rem;
  border: 1px solid var(--color-base-200);
  border-radius: 0.75rem;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}

#id_request_need label:hover {
  border-color: var(--color-primary-300);
}

#id_request_need label:has(input:checked) {
  border-color: var(--color-primary-600);
  background: color-mix(in oklab, var(--color-primary-500) 7%, transparent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--color-primary-500) 18%, transparent);
}

#id_request_need label:has(input:focus-visible) {
  outline: 2px solid var(--color-primary-600);
  outline-offset: 2px;
}

#id_request_need input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

#id_request_need .truncate {
  font-weight: 500;
  line-height: 1.35;
  white-space: normal;
}

#id_request_need .truncate::before {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--color-primary-600);
  font-family: "Material Symbols Outlined";
  font-size: 1.375rem;
  font-weight: normal;
  font-feature-settings: "liga";
  line-height: 1;
}

#id_request_need input[value="account"] + .truncate::before {
  content: "person_add";
}

#id_request_need input[value="pricing"] + .truncate::before {
  content: "sell";
}

#id_request_need input[value="demo"] + .truncate::before {
  content: "smart_display";
}

/* The consent: the company's privacy notice, quieter than the fields. */
.central-consent {
  padding: 0.75rem 0.875rem;
  border: 1px solid var(--color-base-200);
  border-radius: 0.75rem;
  background: var(--color-base-50);
}

.central-consent .form-checkbox > div {
  align-items: flex-start;
}

.central-consent input[type="checkbox"] {
  flex: none;
  margin-top: 0.2rem;
}

.central-consent label {
  color: var(--color-base-600);
  font-size: 0.8125rem;
  line-height: 1.55;
}

.central-modal__foot {
  display: grid;
  gap: 0.75rem;
  padding: 1rem 1.5rem 1.25rem;
  border-top: 1px solid var(--color-base-200);
  background: var(--color-base-50);
}

/* On phones the request opens as a sheet from the bottom: full width, tighter, and one need per row. */
@media (max-width: 639px) {
  .central-modal {
    align-self: flex-end;
    width: 100%;
    max-height: 92dvh;
    border-radius: 1.25rem 1.25rem 0 0;
  }

  .central-modal__head {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
    padding: 1.25rem 1.25rem 1rem;
  }

  .central-modal__mark {
    display: none;
  }

  .central-modal__body {
    padding: 1rem 1.25rem;
  }

  .central-modal__foot {
    padding: 0.875rem 1.25rem calc(1rem + env(safe-area-inset-bottom));
  }

  #id_request_need {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.5rem;
  }

  #id_request_need label {
    padding: 0.625rem 0.875rem;
  }

  #id_request_need .truncate {
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }

  #id_request_need .truncate::before {
    margin-bottom: 0;
  }
}

.dark .central-modal__head,
.dark .central-modal__foot,
.dark #id_request_need label,
.dark .central-consent {
  border-color: var(--color-base-700);
}

.dark .central-modal__foot,
.dark .central-consent {
  background: color-mix(in oklab, var(--color-base-900) 45%, var(--color-base-800));
}

.dark .central-modal__mark {
  color: var(--color-primary-300);
  background: color-mix(in oklab, var(--color-primary-500) 18%, transparent);
}

.dark .central-modal__lead {
  color: var(--color-base-400);
}

.dark .central-consent label {
  color: var(--color-base-300);
}

.central-hp {
  position: absolute;
  inset-inline-start: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Right to left (Arabic): Unfold's styles have no right-to-left variants, so the header's arrow and its language menu
   turn here (templates/unfold/helpers/unauthenticated_header.html). */
[dir="rtl"] .central-back {
  transform: scaleX(-1);
}

[dir="rtl"] .group:hover .central-back {
  left: 0.25rem;
}

[dir="rtl"] .central-languages {
  right: auto;
  left: -0.5rem;
}
