@charset "UTF-8";

/* ====================== auth/login.css ====================== */
/* Stili esclusivi delle pagine di autenticazione               */
/* (da caricare dopo main.css)                                  */

/* ------------------------------------------------------------ */
/* LAYOUT DI PAGINA                                             */
/* ------------------------------------------------------------ */

body.login-page {
  background: linear-gradient(135deg, #8b1f1f 0%, #1e3a8a 50%, #267f99 100%);
  display: flex;                   /* flex in colonna per login + footer */
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  padding: var(--sp-lg) var(--sp-md) 0;   /* spazio in alto e ai lati, ma niente in basso */
}

/* ------------------------------------------------------------ */
/* CONTENITORE PRINCIPALE                                       */
/* ------------------------------------------------------------ */

.login-container {
  background: var(--sr-surface);
  width: 100%;
  max-width: 420px;
  padding: var(--sp-lg);
  border-radius: var(--radius-md);
  box-shadow: var(--sr-shadow-deep);
  animation: fadeInDown .5s ease-out;
  /* se il form è più alto dello schermo: scrollbar interna     */
  max-height: calc(100dvh - 2*var(--sp-lg));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;

  /* margin:auto centra orizzontalmente e verticalmente (fra top e footer) */
  margin: auto;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ------------------------------------------------------------ */
/* LOGO                                                         */
/* ------------------------------------------------------------ */

.login-logo {
  width: 200px; max-width: none;
  height: auto;
  display: block;
  margin: 0 auto var(--sp-lg);
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.4));
}
@media(max-width: 480px) {
  .login-logo { width: 150px; }
}

/* ------------------------------------------------------------ */
/* TITOLI                                                       */
/* ------------------------------------------------------------ */

.login-container h2 {
  font-family: var(--font-heading);
  font-size: var(--fs-xl);
  color: var(--sr-primary-dark);
  text-align: center;
  margin-bottom: var(--sp-lg);
}

/* ------------------------------------------------------------ */
/* PULSANTE PRIMARIO                                            */
/* ------------------------------------------------------------ */

.btn-login {
  width: 100%;
  padding: var(--sp-sm);
  margin-top: var(--sp-md);
  background: var(--sr-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--fs-base);
  cursor: pointer;
  transition: background .2s, transform .1s;
}
.btn-login:hover {
  background: var(--sr-primary-dark);
  transform: translateY(-1px);
}

/* ------------------------------------------------------------ */
/* LINK DI SWITCH                                               */
/* ------------------------------------------------------------ */

.switch-link {
  text-align: center;
  margin-top: var(--sp-md);
  font-size: var(--fs-sm);
}
.switch-link a { color: var(--sr-primary); font-weight: 600; }
.switch-link a:hover { text-decoration: underline; }

/* ------------------------------------------------------------ */
/* CHECKBOX TERMINI                                             */
/* ------------------------------------------------------------ */

.terms-group {
  flex-direction: row;
  align-items: center;
  gap: .5rem;
}

/* ------------------------------------------------------------ */
/* VISIBILITÀ BOX (gestita via JS)                              */
/* ------------------------------------------------------------ */

#regBox, #forgotBox, #resetBox { display: none; }
#loginBox.active,
#regBox.active,
#forgotBox.active,
#resetBox.active { display: block; }

/* ------------------------------------------------------------ */
/* MODAL (titolo specifico)                                     */
/* ------------------------------------------------------------ */

.modal h3 { font-size: var(--fs-lg); }

/* ------------------------------------------------------------ */
/* REMEMBER-ME – wrapper orizzontale                           */
/* ------------------------------------------------------------ */
div.form-group.remember-group {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 1rem !important;            /* spazio maggiore tra checkbox e label */
  margin: 0.75rem 0 1.25rem !important;
  padding: 0 !important;
}

/* ------------------------------------------------------------ */
/* REMEMBER-ME – checkbox centrata via absolute positioning     */
/* ------------------------------------------------------------ */
div.form-group.remember-group > input[type="checkbox"] {
  appearance: none !important;
  -webkit-appearance: none !important;
  width: 1.5rem !important;
  height: 1.5rem !important;
  border: 2px solid var(--sr-primary) !important;
  border-radius: 0.25rem !important;
  position: relative !important;       /* per contenere il ::after */
  cursor: pointer !important;
  transition:
    transform 0.15s ease-in-out,
    box-shadow 0.15s ease-in-out,
    border-color 0.15s ease-in-out !important;
  margin: 0 !important;               /* eliminare padding/margini interni */
}

/* hover: leggero glow e scale up */
div.form-group.remember-group > input[type="checkbox"]:hover {
  box-shadow: 0 0 0.3rem var(--sr-primary)50 !important;
  transform: scale(1.1) !important;
}

/* sfondo quando checked */
div.form-group.remember-group > input[type="checkbox"]:checked {
  background-color: var(--sr-primary) !important;
  border-color: var(--sr-primary) !important;
}

/* la spunta, assoluta e centrata */
div.form-group.remember-group > input[type="checkbox"]::after {
  content: '' !important;
  position: absolute !important;
  top: 40% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) rotate(45deg) scale(0) !important;
  transform-origin: center center !important;
  width: 0.4rem !important;
  height: 0.8rem !important;
  border: solid #fff !important;
  border-width: 0 0.2rem 0.2rem 0 !important;
  opacity: 0 !important;
  transition: transform 0.15s ease-in-out, opacity 0.15s ease-in-out !important;
}

/* quando checked mostriamo la spunta */
div.form-group.remember-group > input[type="checkbox"]:checked::after {
  transform: translate(-50%, -50%) rotate(45deg) scale(1) !important;
  opacity: 1 !important;
}

/* ─── Modal override per login.css ─── */

/* Overlay */
#modalOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;             /* verrà mostrato via JS aggiungendo .show */
  align-items: center;
  justify-content: center;
  padding: var(--sp-lg);
  z-index: 2000;
}
#modalOverlay.show {
  display: flex !important;
}

/* Container del modal */
.modal {
  position: fixed; inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.5);
  padding: var(--sp-lg);
  z-index: 2000;
}

/* Header */
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--sr-border);
  padding-bottom: var(--sp-sm);
  margin-bottom: var(--sp-md);
}
.modal-header h3 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: var(--fs-lg);
  color: var(--sr-text);
}


/* Body */
.modal-body {
  margin-bottom: var(--sp-md);
  line-height: 1.5;
  color: var(--sr-text);
}

/* Pulsante OK usa le regole btn-primary di main.css */
#modalOk {
  /* ereditato: .btn-primary */
}

/* ------------------------------------------------------------ */
/* OVERRIDE PER IL FOOTER SU LOGIN PAGE                         */
/* ------------------------------------------------------------ */
/* Poiché il <body> ha padding laterale, il footer ereditava
   quei margini. Con questa regola, il footer si estende
   fino ai bordi della viewport senza “ristrettezza”. */

body.login-page .footer {
  box-sizing: border-box;
  width: calc(100% + (var(--sp-md) * 2));
  margin-left: calc(-1 * var(--sp-md));
  margin-right: calc(-1 * var(--sp-md));
}


