/*
 * Pagine di autenticazione (login, password dimenticata, 2FA)
 */

:root {
  --auth-navy: #1c2e51;
  --auth-white: #FFFFFF;
  --auth-white-70: rgba(255, 255, 255, 0.7);
  --auth-white-55: rgba(255, 255, 255, 0.55);
  --auth-field: #657089;
  --auth-field-focus: #657089;
  --auth-orange: #F5A623;
  --auth-gutter: 16px;
  --auth-radius: 22px;
}

html, body.auth-body {
  height: 100%;
  margin: 0;
  background-color: var(--auth-navy);
  color: var(--auth-white);
  font-family: Poppins, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 300;
}

.auth {
  display: flex;
  min-height: 100vh;
  background-color: var(--auth-navy);
}

/* ---------- Pannello visivo (sinistra) ---------- */

.auth-visual {
  position: relative;
  flex: 0 0 calc(50% - var(--auth-gutter));
  width: calc(50% - var(--auth-gutter));
  margin: var(--auth-gutter);
  min-height: calc(100vh - var(--auth-gutter) * 2);
  border-radius: var(--auth-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 44px 52px;
  color: var(--auth-white);
  background-color: #E4E3EA;
  background-image: url("../assets/auth/Integro360-auth-sx.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.auth-visual__brand {
  position: relative;
  z-index: 1;
  display: inline-block;
  align-self: flex-start;
  line-height: 0;
}

/* Desktop: logo cliente in un'area max 390x190, proporzioni originali.
   Orizzontale -> fino a 390px di larghezza; quadrato -> 190x190; verticale -> fino a 190px di altezza */
.auth-visual__brand img {
  display: block;
  max-width: 390px;
  max-height: 190px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.auth-visual__bottom {
  position: relative;
  z-index: 1;
}

.auth-visual__claim {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: 2.93rem;
  line-height: 1.18;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 28px rgba(0, 0, 0, 0.18);
}

/* Streaming news sotto il claim */
.auth-news {
  list-style: none;
  margin: 40px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
  max-width: 34rem;
  font-size: 1.43rem;
  line-height: 1.3;
  font-weight: 300;
  text-shadow: 0 1px 18px rgba(0, 0, 0, 0.16);
}

.auth-news__item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.auth-news__arrow {
  flex: 0 0 auto;
  font-weight: 300;
}

.auth-news__body {
  min-width: 0;
}

.auth-news__title {
  margin: 0;
  font-weight: 500;
}

.auth-news__text p {
  margin: 0;
}

.auth-news__text p + p {
  margin-top: 0.9em;
}

.auth-news__text strong,
.auth-news__text b {
  font-weight: 500;
}

.auth-news__link {
  display: inline-block;
  margin-top: 16px;
  color: var(--auth-white);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.auth-news__link:hover,
.auth-news__link:focus {
  color: var(--auth-white-70);
}

.auth-news--mobile {
  display: none;
  margin-top: 36px;
  max-width: none;
  font-size: 1.27rem;
  line-height: 1.35;
  text-shadow: none;
}

.auth-news--mobile .auth-news__item {
  flex-direction: column;
  gap: 18px;
}

.auth-news--mobile .auth-news__arrow {
  display: inline-block;
  font-size: 2.09rem;
  line-height: 1;
  transform: rotate(90deg);
  transform-origin: center;
  margin-left: 4px;
}

.auth-news--mobile .auth-news__item:not(:first-child) .auth-news__arrow {
  display: none;
}

.auth-news--mobile .auth-news__item + .auth-news__item::before {
  content: "";
  display: block;
  width: 18rem;
  max-width: 100%;
  height: 1px;
  background-color: rgba(255, 255, 255, 0.75);
  margin-bottom: 6px;
}

.auth-news--mobile .auth-news__title {
  margin-bottom: 8px;
}

.auth-news--mobile .auth-news__text p + p {
  margin-top: 0.6em;
}

.auth-news--mobile .auth-news__link {
  margin-top: 12px;
}

/* ---------- Pannello form (destra) ---------- */

.auth-panel {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  padding: 60px 56px;
  min-width: 0;
}

.auth-panel__meta {
  position: absolute;
  right: 56px;
  font-size: 1.16rem;
  font-weight: 300;
  color: var(--auth-white);
}

.auth-panel__meta--top {
  top: 56px;
}

.auth-panel__meta--bottom {
  bottom: 52px;
  color: var(--auth-white-70);
  font-size: 1.04rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-social__link {
  color: var(--auth-white-70);
  font-weight: 500;
  text-transform: none;
  font-size: 1.21rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-social__link:hover,
.auth-social__link:focus {
  color: var(--auth-white);
  text-decoration: underline;
}

.auth-panel__body {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-panel .login-content {
  width: 100%;
  max-width: 400px;
  padding: 0 !important;
  margin: 0 auto;
  overflow: visible !important; /* le view hanno overflow-hidden: taglierebbe il bordo di focus dei campi */
}

.auth-panel .login-form {
  width: 100%;
}

.auth-logo {
  margin: 0 0 22px;
}

.auth-logo img {
  display: block;
  height: 84px;
  width: auto;
  max-width: 100%;
}

/* Titoli e testi */
.auth-panel h3,
.auth-panel .text-dark,
.auth-panel .text-dark-75,
.auth-panel .text-dark-50,
.auth-panel label {
  color: var(--auth-white) !important;
}

.auth-panel h3 {
  font-size: 2.09rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: 0;
}

.auth-panel .text-muted,
.auth-panel .form-text {
  color: var(--auth-white-70) !important;
}

.auth-panel .text-primary,
.auth-panel a.text-primary {
  color: var(--auth-white) !important;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-panel label {
  font-size: 1.16rem;
  font-weight: 500;
  margin-bottom: 10px;
}

/* Campi */
.auth-panel .form-control,
.auth-panel .form-control.form-control-solid {
  background-color: var(--auth-field);
  border: 0;
  border-radius: 999px;
  color: var(--auth-white);
  height: 52px;
  padding: 0 22px !important;
  font-size: 1.16rem;
  font-weight: 300;
  box-shadow: none;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-panel .form-control::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

/* autocompletamento Chrome/Safari: senza queste regole il campo diventa giallo */
.auth-panel .form-control:-webkit-autofill,
.auth-panel .form-control:-webkit-autofill:hover,
.auth-panel .form-control:-webkit-autofill:focus,
.auth-panel .form-control:-webkit-autofill:active,
.auth-panel .form-control.form-control-solid:-webkit-autofill,
.auth-panel .form-control.form-control-solid:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--auth-white) !important;
  -webkit-box-shadow: 0 0 0 1000px var(--auth-field) inset !important;
  box-shadow: 0 0 0 1000px var(--auth-field) inset !important;
  background-color: var(--auth-field) !important;
  background-clip: content-box !important;
  caret-color: var(--auth-white);
  transition: background-color 9999s ease-out 0s;
}

.auth-panel .form-control:-webkit-autofill:focus,
.auth-panel .form-control.form-control-solid:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--auth-field) inset, 0 0 0 2px rgba(255, 255, 255, 0.45) !important;
  box-shadow: 0 0 0 1000px var(--auth-field) inset, 0 0 0 2px rgba(255, 255, 255, 0.45) !important;
}

.auth-panel .form-control:focus,
.auth-panel .form-control.form-control-solid:focus {
  background-color: var(--auth-field-focus);
  color: var(--auth-white);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.45);
  outline: none;
}

.auth-panel .form-control.is-invalid,
.auth-panel .form-control.form-control-solid.is-invalid {
  box-shadow: 0 0 0 2px #FF8A80;
  background-image: none;
}

.auth-panel .invalid-feedback,
.auth-panel .fv-help-block {
  color: #FFB4AE;
  padding-left: 20px;
}

.auth-panel .form-group {
  margin-bottom: 26px;
}

/* Pulsante */
.auth-panel .btn.btn-primary {
  background-color: var(--auth-white) !important;
  border-color: var(--auth-white) !important;
  color: var(--auth-navy) !important;
  border-radius: 999px;
  min-width: 170px;
  padding: 14px 34px !important;
  font-size: 1.16rem !important;
  font-weight: 500 !important;
  margin: 12px 0 0 !important;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.auth-panel .btn.btn-primary:hover,
.auth-panel .btn.btn-primary:focus {
  background-color: #EEF1F7 !important;
  border-color: #EEF1F7 !important;
  color: var(--auth-navy) !important;
}

.auth-panel .btn.btn-primary:focus-visible {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.4) !important;
}

.auth-panel .btn.btn-primary:active {
  transform: translateY(1px);
}

/* Messaggi */
.auth-panel .alert {
  border-radius: 14px;
  border: 0;
  font-size: 0.94rem;
}

.auth-panel .alert-danger {
  background-color: rgba(246, 78, 96, 0.18);
  color: #FFC7CC;
}

.auth-panel .alert-success {
  background-color: rgba(27, 197, 189, 0.18);
  color: #BFF4F1;
}

/* Piè di pagina del form */
.auth-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 48px;
  margin-top: 56px;
  font-size: 1.16rem;
  color: var(--auth-white);
}

.auth-footer a {
  color: var(--auth-white);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-footer a:hover,
.auth-footer a:focus {
  color: var(--auth-white-70);
}

/* footer delle altre view (forgot, 2fa) */
.auth-panel .logoFooter {
  height: 22px;
  width: auto;
  vertical-align: middle;
  margin-right: 4px;
}

/* ---------- Responsive ---------- */

@media (max-width: 991.98px) {
  .auth {
    flex-direction: column;
  }

  .auth-visual {
    flex: 0 0 auto;
    width: auto;
    min-height: 300px;
    height: auto;
    gap: 28px;
    margin: var(--auth-gutter) var(--auth-gutter) 0;
    padding: 28px 30px;
    background-image: url("../assets/auth/Integro360-auth-sx-mobile.png");
  }

  /* Mobile: logo cliente in un'area max 716x290 (limitata alla larghezza disponibile).
     Orizzontale -> fino a 716px; quadrato -> 290x290; verticale -> fino a 290px di altezza */
  .auth-visual__brand {
    max-width: 100%;
  }

  .auth-visual__brand img {
    max-width: min(716px, 100%);
    max-height: 290px;
  }

  .auth-visual__claim {
    font-size: 2.04rem;
  }

  /* piè di pagina: meno spazio fra le voci, cosi' stanno su una riga */
  .auth-footer {
    gap: 10px 22px;
  }

  .auth-news--desktop {
    display: none;
  }

  .auth-news--mobile {
    display: flex;
    gap: 26px;
  }

  .auth-panel {
    padding: 56px 28px 84px;
  }

  .auth-panel__meta--top {
    top: 22px;
    right: 28px;
  }

  .auth-panel__meta--bottom {
    bottom: 28px;
    right: 28px;
  }
}

@media (max-width: 479.98px) {
  .auth-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-panel .form-control,
  .auth-panel .btn.btn-primary {
    transition: none;
  }
}

/* campo codice 2FA (font grande) */
.auth-panel .form-control.font-size-h2 {
  height: 60px;
  letter-spacing: 0.25em;
}

/* ---------- View secondarie (forgot, 2FA): stesso tono del login ---------- */

.auth-panel h3.font-size-h1-lg,
.auth-panel h3.font-weight-bolder {
  font-size: 2.09rem !important;
  font-weight: 500 !important;
}

.auth-panel .btn.btn-light-primary {
  background-color: transparent !important;
  border: 1px solid rgba(255, 255, 255, 0.5) !important;
  color: var(--auth-white) !important;
  border-radius: 999px;
  padding: 13px 32px !important;
  font-size: 1.16rem !important;
  font-weight: 500 !important;
  margin: 12px 0 0 12px !important;
}

.auth-panel .btn.btn-light-primary:hover,
.auth-panel .btn.btn-light-primary:focus {
  border-color: var(--auth-white) !important;
  background-color: rgba(255, 255, 255, 0.08) !important;
}

.auth-panel .login-content > .d-flex.align-items-end {
  margin-top: 48px;
  font-size: 0.94rem;
}

.auth-panel .login-content > .d-flex.align-items-end .font-weight-bolder {
  font-weight: 300 !important;
  font-size: 0.94rem !important;
}
