/* ========================================================================== 
 * TRUE FBS v5 — viewport-fit modal correction only
 *
 * Scope is intentionally narrow: registration, login and trial/request
 * dialogs on desktop/laptop viewports. No landing sections, feature grids,
 * marketplace cards, pricing, header, copy or mobile rules are changed here.
 *
 * Target: a 1920x1200 laptop at browser zoom 100% (including common OS display
 * scaling), where the usable browser viewport may be only ~700–900 CSS px high.
 * The complete modal, consent text and all legal links must remain visible.
 * ========================================================================== */

/* --------------------------------------------------------------------------
 * Desktop/laptop modal frame
 * -------------------------------------------------------------------------- */
@media (min-width: 768px) {
  .modal {
    align-items: center;
    padding: 14px 20px;
    overflow-y: auto; /* only the overlay may scroll on exceptionally short viewports */
  }

  .modal__panel--auth,
  .modal__panel--register,
  .modal__panel--trial {
    max-height: none;
    overflow: visible;
  }

  /* Shared compact brand mark and close control. */
  .modal__panel--auth .modal__logo,
  .modal__panel--register .modal__logo,
  .modal__panel--trial .modal__logo {
    margin-bottom: 8px;
  }

  .modal__panel--auth .modal__logo .brand__mark,
  .modal__panel--register .modal__logo .brand__mark,
  .modal__panel--trial .modal__logo .brand__mark {
    width: 52px;
    height: 52px;
    border-radius: 16px;
  }

  .modal__panel--auth .modal__logo .brand__mark svg,
  .modal__panel--register .modal__logo .brand__mark svg,
  .modal__panel--trial .modal__logo .brand__mark svg {
    width: 40px;
    height: 40px;
  }

  .modal__panel--auth .modal__close,
  .modal__panel--register .modal__close,
  .modal__panel--trial .modal__close {
    top: 14px;
    right: 14px;
    width: 44px;
    height: 44px;
    border-radius: 14px;
  }

  .modal__panel--auth .modal__close svg,
  .modal__panel--register .modal__close svg,
  .modal__panel--trial .modal__close svg {
    width: 19px;
    height: 19px;
  }

  /* ------------------------------------------------------------------------
   * LOGIN + REGISTRATION
   * Final desktop dimensions are intentionally identical where possible.
   * ------------------------------------------------------------------------ */
  .modal__panel--auth,
  .modal__panel--register {
    width: 500px;
    max-width: calc(100vw - 40px);
    padding: 20px 28px 18px;
    border-radius: 28px;
  }

  .modal__panel--auth h2,
  .modal__panel--register h2 {
    margin: 0 auto 6px;
    font-size: 38px;
    line-height: 42px;
    font-weight: 800;
  }

  .modal__panel--auth > .auth-switch,
  .modal__panel--register > .auth-switch {
    margin: 0 auto 18px;
    font-size: 14px;
    line-height: 20px;
  }

  .modal__panel--auth .auth-form,
  .modal__panel--register .auth-form {
    gap: 10px;
  }

  .modal__panel--register .auth-form {
    gap: 10px;
  }

  .modal__panel--auth .auth-form .form-field--compact > div,
  .modal__panel--register .auth-form .form-field--compact > div {
    min-height: 52px !important;
    padding: 0 16px;
    border-radius: 15px !important;
  }

  .modal__panel--auth .auth-form .form-field--compact input:not([type="checkbox"]),
  .modal__panel--register .auth-form .form-field--compact input:not([type="checkbox"]) {
    height: 50px !important;
    font-size: 15px;
    line-height: 22px;
  }

  .modal__panel--auth .auth-form .form-field--compact svg,
  .modal__panel--register .auth-form .form-field--compact svg {
    width: 19px;
    height: 19px;
  }

  .modal__panel--auth .auth-submit,
  .modal__panel--register .auth-submit {
    min-height: 54px;
    border-radius: 16px;
    font-size: 16px;
    line-height: 22px;
  }

  .modal__panel--auth .auth-divider {
    min-height: 26px;
    gap: 14px;
    font-size: 14px;
    line-height: 20px;
  }

  .modal__panel--auth .auth-alt-button {
    min-height: 50px;
    padding: 0 16px;
    border-radius: 15px;
    font-size: 15px;
    line-height: 20px;
  }

  .modal__panel--auth .auth-alt-button svg {
    width: 18px;
    height: 18px;
  }

  .modal__panel--auth .modal-consent,
  .modal__panel--register .modal-consent {
    margin-top: 2px;
    max-width: 410px;
    font-size: 12px;
    line-height: 17px;
  }

  .modal__panel--auth .modal-legal,
  .modal__panel--register .modal-legal {
    gap: 4px 0;
    margin-top: 0;
    padding-top: 9px;
    font-size: 11px;
    line-height: 15px;
  }

  .modal__panel--auth .modal-legal a,
  .modal__panel--register .modal-legal a {
    padding: 0 8px;
  }

  /* ------------------------------------------------------------------------
   * TRIAL / REQUEST MODAL
   * ------------------------------------------------------------------------ */
  .modal__panel--trial {
    width: 600px;
    max-width: calc(100vw - 40px);
    padding: 18px 30px 16px;
    border-radius: 28px;
  }

  .modal__panel--trial > .trial-badge {
    min-height: 28px;
    margin: 0 auto 6px;
    padding: 4px 13px;
    font-size: 13px;
    line-height: 18px;
  }

  .modal__panel--trial h2 {
    max-width: 520px;
    margin: 0 auto 6px;
    font-size: 32px;
    line-height: 36px;
    font-weight: 800;
  }

  .modal__panel--trial > p:not(.auth-switch) {
    max-width: 520px;
    margin: 0 auto 12px;
    font-size: 14px;
    line-height: 20px;
  }

  .modal__panel--trial .lead-form {
    gap: 7px;
  }

  .modal__panel--trial .lead-form > label.form-field > span,
  .modal__panel--trial .marketplace-choice-group > legend {
    margin-bottom: 3px;
    font-size: 12px;
    line-height: 16px;
  }

  .modal__panel--trial .lead-form > label.form-field > div {
    min-height: 48px !important;
    padding: 0 15px;
    border-radius: 14px !important;
  }

  .modal__panel--trial .lead-form > label.form-field input:not([type="checkbox"]) {
    height: 46px !important;
    font-size: 14px;
    line-height: 20px;
  }

  .modal__panel--trial .lead-form > label.form-field svg {
    width: 18px;
    height: 18px;
  }

  .modal__panel--trial .choice-grid {
    gap: 10px;
  }

  .modal__panel--trial .choice span {
    min-height: 44px;
    padding: 0 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 20px;
  }

  .modal__panel--trial .choice span i {
    width: 19px;
    height: 19px;
  }

  .modal__panel--trial .choice span i::after {
    width: 8px;
    height: 8px;
  }

  .modal__panel--trial .modal-submit {
    min-height: 52px;
    margin-top: 1px;
    border-radius: 16px;
    font-size: 16px;
    line-height: 22px;
  }

  .modal__panel--trial .modal-consent {
    margin-top: 1px;
    max-width: 510px;
    font-size: 11px;
    line-height: 16px;
  }

  .modal__panel--trial .modal-legal {
    gap: 3px 0;
    margin-top: 0;
    padding-top: 8px;
    font-size: 10px;
    line-height: 14px;
  }

  .modal__panel--trial .modal-legal a {
    padding: 0 7px;
  }
}

/* --------------------------------------------------------------------------
 * Short laptop viewport safety net.
 * At heights up to 820 CSS px use an even denser vertical rhythm while keeping
 * all controls comfortably clickable. This does NOT affect mobile (<768px).
 * -------------------------------------------------------------------------- */
@media (min-width: 768px) and (max-height: 820px) {
  .modal {
    padding-block: 8px;
  }

  .modal__panel--auth,
  .modal__panel--register {
    padding-top: 14px;
    padding-bottom: 13px;
  }

  .modal__panel--trial {
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .modal__panel--auth .modal__logo,
  .modal__panel--register .modal__logo,
  .modal__panel--trial .modal__logo {
    margin-bottom: 5px;
  }

  .modal__panel--auth .modal__logo .brand__mark,
  .modal__panel--register .modal__logo .brand__mark,
  .modal__panel--trial .modal__logo .brand__mark {
    width: 46px;
    height: 46px;
    border-radius: 14px;
  }

  .modal__panel--auth .modal__logo .brand__mark svg,
  .modal__panel--register .modal__logo .brand__mark svg,
  .modal__panel--trial .modal__logo .brand__mark svg {
    width: 35px;
    height: 35px;
  }

  .modal__panel--auth h2,
  .modal__panel--register h2 {
    font-size: 34px;
    line-height: 38px;
  }

  .modal__panel--auth > .auth-switch,
  .modal__panel--register > .auth-switch {
    margin-bottom: 12px;
  }

  .modal__panel--auth .auth-form,
  .modal__panel--register .auth-form {
    gap: 8px;
  }

  .modal__panel--trial h2 {
    font-size: 29px;
    line-height: 33px;
  }

  .modal__panel--trial > p:not(.auth-switch) {
    margin-bottom: 8px;
  }

  .modal__panel--trial .lead-form {
    gap: 5px;
  }
}
