/* Compact sign-up/log-in layout based on the supplied mobile reference.
   Desktop keeps the existing split-panel design and all account behavior. */
@media (max-width: 760px) {
  #authModal.modal-overlay,
  body.dark #authModal.modal-overlay {
    align-items: stretch !important;
    justify-content: flex-start !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    padding: 0 !important;
    background: #fff !important;
  }

  #authModal.modal-overlay::before,
  #authModal.modal-overlay::after {
    display: none !important;
  }

  #authModal .gw-auth-shell,
  body.dark #authModal .gw-auth-shell {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: 123px auto;
    align-content: start;
    width: 100% !important;
    max-width: none !important;
    min-height: 100vh;
    min-height: 100dvh;
    max-height: none !important;
    overflow: visible !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #fff !important;
    box-shadow: none !important;
  }

  #authModal .gw-auth-brand {
    position: relative;
    grid-row: 1;
    display: block;
    width: 100%;
    min-height: 123px;
    height: 123px;
    padding: 0 !important;
    overflow: hidden;
    background: #26384b !important;
  }

  #authModal .gw-auth-brand::before {
    display: none !important;
  }

  #authModal .gw-auth-brand::after {
    inset: 0;
    z-index: 1;
    width: auto;
    height: auto;
    border: 0;
    border-radius: 0;
    background: linear-gradient(90deg, rgba(12, 22, 35, .36), rgba(12, 22, 35, .08));
    box-shadow: none;
    pointer-events: none;
  }

  #authModal .gw-auth-scene {
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 123px !important;
    object-fit: cover !important;
    object-position: center 48% !important;
  }

  #authModal .gw-auth-logo {
    position: absolute;
    z-index: 2;
    top: 9px;
    left: 14px;
    width: 48px;
    height: 48px;
    max-height: none;
    margin: 0;
    object-fit: contain;
    object-position: center;
  }

  #authModal .gw-auth-kicker,
  #authModal .gw-auth-brand-foot {
    display: none !important;
  }

  #authModal .gw-auth-brand h2 {
    position: absolute;
    z-index: 2;
    right: 14px;
    bottom: 38px;
    left: 14px;
    margin: 0;
    color: #fff;
    font-size: 16px;
    line-height: 1.2;
    letter-spacing: -.02em;
    text-shadow: 0 1px 4px rgba(0, 0, 0, .48);
  }

  #authModal .gw-auth-brand p {
    position: absolute;
    z-index: 2;
    right: 12px;
    bottom: 7px;
    left: 14px;
    max-width: none;
    margin: 0;
    color: #fff;
    font-size: 9.5px;
    line-height: 1.35;
    text-shadow: 0 1px 4px rgba(0, 0, 0, .55);
  }

  #authModal .gw-auth-form,
  body.dark #authModal .gw-auth-form {
    grid-row: 2;
    align-self: start;
    width: 100%;
    padding: 11px 14px 18px !important;
    background: #fff !important;
    color: #38271c !important;
  }

  #authModal .gw-auth-tabs {
    gap: 4px;
    margin: 0 0 12px;
    padding: 3px;
    border-color: #e9ded4;
    border-radius: 10px;
    background: #fff;
  }

  #authModal .gw-auth-tabs button {
    min-height: 34px;
    border-radius: 7px;
    color: #38271c;
    font-size: 11px;
  }

  #authModal .gw-auth-tabs button[aria-pressed="true"] {
    background: #ef741e;
    color: #fff;
    box-shadow: 0 2px 6px rgba(217, 92, 16, .2);
  }

  #authModal .gw-auth-form h3,
  body.dark #authModal .gw-auth-form h3 {
    margin: 0 0 3px;
    color: #38271c !important;
    font-size: 16px;
    letter-spacing: -.02em;
  }

  #authModal .gw-auth-form #authSubtitle,
  body.dark #authModal .gw-auth-form #authSubtitle {
    margin: 0 0 10px;
    color: #82766d !important;
    font-size: 10.5px;
    line-height: 1.4;
  }

  #authModal .gw-auth-field {
    margin: 0 0 10px;
  }

  #authModal .gw-auth-field > label,
  #authModal .gw-auth-profile-fields > label {
    display: block;
    margin: 0 0 4px;
    color: #34291f;
    font-size: 10px;
    font-weight: 700;
  }

  #authModal .auth-input,
  body.dark #authModal .auth-input {
    width: 100%;
    height: 38px;
    min-height: 38px;
    margin: 0 0 8px;
    padding: 0 10px;
    border: 1px solid #e9ded4 !important;
    border-radius: 9px;
    background: #fff !important;
    color: #34291f !important;
    font-size: 11px;
  }

  #authModal .auth-input::placeholder,
  body.dark #authModal .auth-input::placeholder {
    color: #82766d !important;
  }

  #authModal .gw-auth-profile-options {
    margin: 0 0 10px;
    border: 1px solid #e9ded4;
    border-radius: 9px;
    background: #fffdfa;
  }

  #authModal .gw-auth-profile-options summary {
    display: flex;
    min-height: 38px;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    color: #34291f;
    font-size: 10px;
    font-weight: 700;
    list-style: none;
  }

  #authModal .gw-auth-profile-options summary::-webkit-details-marker {
    display: none;
  }

  #authModal .gw-auth-optional-tag {
    padding: 2px 6px;
    border-radius: 999px;
    background: #fff0e3;
    color: #a34a12;
    font-size: 9px;
  }

  #authModal .gw-auth-profile-fields {
    display: grid;
    gap: 7px;
    padding: 0 10px 10px;
  }

  #authModal .gw-auth-private-note {
    margin: -2px 0 0;
    font-size: 9px;
    line-height: 1.35;
  }

  #authModal .gw-auth-divider {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0 5px;
    color: #82766d;
    font-size: 9px;
  }

  #authModal .gw-auth-divider::before,
  #authModal .gw-auth-divider::after {
    flex: 1;
    height: 1px;
    background: #e9ded4;
    content: "";
  }

  #authModal #authGenderPicker {
    gap: 8px !important;
    margin-bottom: 7px !important;
  }

  #authModal #authGenderPicker .gender-option {
    min-height: 33px;
    flex: 1 1 0;
    justify-content: center;
    border-radius: 8px;
    font-size: 10px;
  }

  #authModal #authSignupExtra > p {
    margin: -3px 0 7px !important;
    font-size: 9px !important;
    line-height: 1.35 !important;
  }

  #authModal #authSubmitBtn {
    min-height: 38px;
    margin-top: 2px;
    border-radius: 8px;
    background: #ef741e;
    box-shadow: none;
    font-size: 11px;
  }

  #authModal .gw-auth-social-actions {
    grid-template-columns: 1fr;
    gap: 5px;
    margin-top: 6px;
  }

  #authModal .gw-auth-social-button {
    width: 100%;
    max-width: 180px;
    min-height: 35px;
    font-size: 10.5px;
  }

  #authModal #authAgreement,
  body.dark #authModal #authAgreement {
    margin-top: 7px !important;
    color: #8c8076 !important;
    font-size: 9px !important;
    line-height: 1.4 !important;
  }

  #authModal .gw-auth-form > p:last-child {
    margin-top: 6px !important;
    font-size: 10.5px !important;
  }
}

@media (max-width: 360px) {
  #authModal .gw-auth-form,
  body.dark #authModal .gw-auth-form {
    padding-right: 12px !important;
    padding-left: 12px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  #authModal .gw-auth-tabs button {
    transition: none !important;
  }
}
