/**
 * SaaS M0/M1 — Login responsivo (área cliente + admin + find tenant)
 * Viewports estreitos (telemóvel): largura total, tipografia e touch targets.
 */

/* —— Área do cliente / Balcão —— */
@media (max-width: 767px) {
  body.customers.customers_login #content > .container,
  body.customers.register #content > .container,
  body.customers.forgot-password #content > .container,
  body.customers.reset-password #content > .container {
    width: 100%;
    max-width: 100%;
    padding-left: 16px;
    padding-right: 16px;
  }

  body.customers.customers_login .mtop40,
  body.customers.register .mtop40,
  body.customers.forgot-password .mtop40 {
    margin-top: 12px !important;
    padding-left: 0;
    padding-right: 0;
  }

  body.customers.customers_login .mtop40 > [class*="col-"],
  body.customers.register .mtop40 > [class*="col-"],
  body.customers.forgot-password .mtop40 > [class*="col-"],
  body.customers.customers_login .row > [class*="col-"],
  body.customers.register .row > [class*="col-"],
  body.customers.forgot-password .row > [class*="col-"] {
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  body.customers.customers_login .login-heading,
  body.customers.customers_login h1,
  body.customers.register h1,
  body.customers.forgot-password h1,
  body.customers.reset-password h1 {
    font-size: 22px !important;
    line-height: 1.3 !important;
    letter-spacing: -0.02em;
    text-align: center;
    padding: 0 4px;
    margin-bottom: 1rem !important;
  }

  body.customers.customers_login .panel_s,
  body.customers.register .panel_s,
  body.customers.forgot-password .panel_s,
  body.customers.reset-password .panel_s {
    margin-bottom: 1rem;
  }

  body.customers.customers_login .panel_s .panel-body,
  body.customers.register .panel_s .panel-body,
  body.customers.forgot-password .panel_s .panel-body,
  body.customers.reset-password .panel_s .panel-body {
    padding: 20px 16px !important;
  }

  body.customers.customers_login .form-control,
  body.customers.register .form-control,
  body.customers.forgot-password .form-control,
  body.customers.reset-password .form-control,
  body.customers.customers_login .bootstrap-select > .dropdown-toggle,
  body.customers.register .bootstrap-select > .dropdown-toggle {
    min-height: 44px;
    font-size: 16px !important; /* evita zoom iOS */
  }

  body.customers.customers_login .bootstrap-select,
  body.customers.register .bootstrap-select {
    width: 100% !important;
  }

  body.customers.customers_login .btn-primary,
  body.customers.customers_login .btn-default,
  body.customers.register .btn-primary,
  body.customers.register .btn-default,
  body.customers.forgot-password .btn-primary,
  body.customers.reset-password .btn-primary {
    min-height: 46px;
    font-size: 16px !important;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  body.customers.customers_login .navbar a.navbar-brand img,
  body.customers.register .navbar a.navbar-brand img {
    height: auto !important;
    max-height: 30px;
    max-width: min(170px, 55vw);
    width: auto;
  }

  body.customers.customers_login .navbar a.navbar-brand,
  body.customers.register .navbar a.navbar-brand {
    padding-top: 12px;
    padding-bottom: 12px;
    max-width: calc(100% - 56px);
  }

  body.customers.customers_login .input-group-addon,
  body.customers.register .input-group-addon {
    max-width: 42%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
  }

  body.customers.customers_login .find-tenant-form .input-group,
  body.customers.customers_login .email-verification-form .input-group {
    display: flex;
    flex-wrap: wrap;
  }

  body.customers.customers_login .find-tenant-form .input-group .form-control,
  body.customers.customers_login .email-verification-form .input-group .form-control {
    width: 100%;
  }
}

@media (max-width: 480px) {
  body.customers.customers_login .login-heading,
  body.customers.customers_login h1,
  body.customers.register h1 {
    font-size: 20px !important;
  }

  body.customers.customers_login #content > .container,
  body.customers.register #content > .container {
    padding-left: 12px;
    padding-right: 12px;
  }
}

/* —— Admin / staff login —— */
@media (max-width: 767px) {
  body.login_admin,
  body.authentication,
  body.forgot-password,
  body.reset-password,
  body.set-password,
  body.two-factor-authentication-code {
    overflow-x: hidden;
  }

  body.login_admin .authentication-form-wrapper,
  body.authentication .authentication-form-wrapper {
    width: 100%;
    max-width: 100%;
    padding-left: 14px !important;
    padding-right: 14px !important;
    padding-top: 1.25rem !important;
    margin-left: auto;
    margin-right: auto;
  }

  body.login_admin .company-logo::before,
  body.authentication .company-logo::before,
  body.forgot-password .company-logo::before,
  body.reset-password .company-logo::before,
  body.set-password .company-logo::before {
    width: 168px !important;
    max-height: 52px !important;
  }

  body.login_admin .company-logo::after,
  body.authentication .company-logo::after {
    font-size: 13px !important;
    max-width: 280px;
    padding: 0 8px;
  }

  body.login_admin .authentication-form-wrapper > .text-center h1,
  body.authentication .authentication-form-wrapper > .text-center h1,
  body.login_admin h1.tw-text-neutral-800,
  body.authentication h1.tw-text-neutral-800 {
    font-size: 1.2rem !important;
    padding: 0 4px;
  }

  body.login_admin .tw-bg-white,
  body.authentication .tw-bg-white,
  body.login_admin .authentication-form-wrapper > div[class*="tw-bg-white"],
  body.authentication .authentication-form-wrapper > div[class*="tw-bg-white"] {
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  body.login_admin .form-control,
  body.authentication .form-control {
    min-height: 44px;
    font-size: 16px !important;
  }

  body.login_admin .btn-primary,
  body.authentication .btn-primary {
    min-height: 46px;
    font-size: 16px !important;
  }

  body.login_admin .tw-inline-flex.tw-justify-between {
    flex-wrap: wrap;
    gap: 0.35rem;
  }
}
