﻿/* ==========================================================================
   Mondo Agenzia — login.css
   Foglio di stile dedicato alla sola pagina di accesso.
   ========================================================================== */

:root {
  --navy: #0F2540;
  --cyan: #00B4D8;
  --cyan-light: #3FD0EE;
  --cyan-dark: #007D96;
  --cyan-ink: #04222E;
  --page: #EEF3F8;
  --surface: #fff;
  --border: #E2EAF1;
  --ink: #0F2540;
  --ink-soft: #33424F;
  --muted: #5C6B7A;
  --muted-2: #9AA9B7;
  --on-navy: #C3D6E6;
  --on-navy-dim: #9FB6CB;
  --on-navy-label: #5C7186;
  --ok-bg: #E7F7EF;
  --ok-ink: #1F7A50;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--cyan-dark); text-decoration: none; }
a:hover { color: var(--cyan); }
input::placeholder { color: var(--muted-2); }

/* --- layout -------------------------------------------------------------- */
.login {
  min-height: 100vh;
  display: flex;
  background: var(--page);
  overflow: auto;
}

/* --- pannello brand ------------------------------------------------------ */
.brand {
  position: relative;
  overflow: hidden;
  width: 46%;
  min-width: 430px;
  flex: none;
  background: linear-gradient(150deg, #0F2540 0%, #143256 54%, #0B3A52 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 54px 56px;
}
.brand__glow,
.brand__glow--sm,
.brand__frame,
.brand__dot { position: absolute; }
.brand__glow {
  right: -90px; top: -110px; width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 180, 216, .34), transparent 66%);
}
.brand__glow--sm {
  left: -70px; bottom: -90px; top: auto; right: auto; width: 300px; height: 300px; border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 180, 216, .10), transparent 70%);
}
.brand__frame { right: 64px; top: 128px; width: 230px; height: 170px; border: 1.5px solid rgba(141, 162, 181, .28); border-radius: 18px; }
.brand__dot { right: 54px; top: 118px; width: 18px; height: 18px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 0 6px rgba(0, 180, 216, .22); }

.brand__logo, .brand__body, .brand__foot { position: relative; }
.brand__logo img { height: 46px; width: auto; display: block; }
.brand__body { max-width: 430px; }

.brand__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--cyan-light);
  background: rgba(0, 180, 216, .12);
  border: 1px solid rgba(0, 180, 216, .28);
  padding: 6px 13px;
  border-radius: 999px;
  margin-bottom: 22px;
}
.brand__claim { margin: 0 0 14px; font-size: 34px; line-height: 1.18; font-weight: 600; letter-spacing: -.01em; }
.brand__text { margin: 0 0 30px; font-size: 15px; line-height: 1.6; color: var(--on-navy); }

.bullets { display: flex; flex-direction: column; gap: 17px; }
.bullet { display: flex; align-items: flex-start; gap: 14px; }
.bullet__icon {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 180, 216, .16);
  color: var(--cyan-light);
  border: 1px solid rgba(0, 180, 216, .26);
}
.bullet__title { font-size: 14.5px; font-weight: 600; color: #fff; margin-bottom: 2px; }
.bullet__text { font-size: 13px; line-height: 1.5; color: var(--on-navy-dim); }

.brand__foot { display: flex; align-items: center; gap: 9px; font-size: 11.5px; color: #7D94AA; letter-spacing: .04em; }
.brand__foot span:first-child { color: var(--on-navy-label); }
.brand__foot strong { font-weight: 600; color: #C3D2E0; }

/* --- pannello form ------------------------------------------------------- */
.panel { flex: 1; min-width: 360px; display: flex; align-items: center; justify-content: center; padding: 48px 40px; }
.panel__inner { width: 100%; max-width: 392px; }

/* le tre viste: login / recupero / inviata */
.view { display: none; }
.view.is-active { display: block; }

/* Logo dell'agenzia (sostituisce il box di upload del mockup originale): il backend
   lo popola solo quando si accede con un link ?agz=&ua= riconosciuto (vedi
   mag_login.aspx.cs). Se l'agenzia non ha un logo configurato, l'intero blocco resta
   assente dal markup (asp:Panel Visible="false"), quindi qui non serve uno stato
   "vuoto"/placeholder da disegnare. */
.agency-logo-row { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.agency-logo-row img { display: block; max-height: 52px; max-width: 190px; object-fit: contain; }
.agency-logo-row .agency-logo__name {
  font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted);
}

.title { margin: 0 0 6px; font-size: 25px; font-weight: 600; letter-spacing: -.01em; color: var(--ink); }
.subtitle { margin: 0 0 30px; font-size: 14px; line-height: 1.55; color: var(--muted); }

.label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); margin-bottom: 7px; }
.field { position: relative; margin-bottom: 18px; }
.field--last { margin-bottom: 26px; }
/* top:24px (metà dei 48px di altezza dell'input, vedi .field input più sotto) invece di
   top:50%: il validator ora vive DENTRO .field (subito dopo l'input), quindi .field può
   crescere in altezza quando compare "Campo obbligatorio" — con top:50% l'icona si sarebbe
   spostata verso il centro di tutto il blocco (input + errore) invece di restare sull'input. */
.field__icon { position: absolute; left: 13px; top: 24px; transform: translateY(-50%); display: flex; color: var(--muted-2); pointer-events: none; }
.field input {
  width: 100%;
  height: 48px;
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 0 14px 0 42px;
  font-family: inherit;
  font-size: 14.5px;
  color: var(--ink);
  outline: none;
  background: var(--surface);
  transition: border-color .12s, box-shadow .12s;
}
.field input.has-action { padding-right: 46px; }
.field input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(0, 180, 216, .16); }
.field__action {
  /* stesso motivo di .field__icon qui sopra: fissa sull'input, non sul centro di .field */
  position: absolute; right: 8px; top: 24px; transform: translateY(-50%);
  width: 32px; height: 32px;
  border: none; background: transparent; color: var(--muted-2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; border-radius: 7px;
}
.field__action:hover { background: #F1F5F9; color: var(--cyan-dark); }

.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 26px; }
.remember { display: flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; font-size: 13px; color: var(--ink-soft); }
.remember__box {
  width: 19px; height: 19px; border-radius: 6px; flex: none;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid #C7D5E2; background: var(--surface); color: #fff;
  transition: background .12s, border-color .12s;
}
.remember.is-on .remember__box { background: var(--cyan); border-color: var(--cyan); }
.remember__box svg { opacity: 0; }
.remember.is-on .remember__box svg { opacity: 1; }
.link-strong { font-size: 13px; font-weight: 600; color: var(--cyan-dark); cursor: pointer; background: none; border: none; font-family: inherit; padding: 0; }
.link-strong:hover { color: var(--cyan); }

.btn {
  width: 100%;
  height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 15.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background .12s, transform .06s;
}
.btn--primary { background: var(--cyan); color: var(--cyan-ink); box-shadow: 0 6px 18px rgba(0, 180, 216, .28); }
.btn--primary:hover { background: #06C3E8; }
.btn--primary:active { transform: translateY(1px); }
.btn--ghost { background: var(--surface); border: 1px solid var(--border); color: var(--ink); font-size: 15px; }
.btn--ghost:hover { background: #F1F5F9; }

.secure { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 24px; font-size: 12px; color: var(--muted-2); }
.secure span { display: flex; }

.back-link {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 24px;
  font-size: 13px; font-weight: 600; color: var(--muted);
  background: none; border: none; font-family: inherit; padding: 0; cursor: pointer;
}
.back-link:hover { color: var(--cyan-dark); }

.sent { text-align: center; }
.sent__icon {
  width: 74px; height: 74px; border-radius: 50%;
  background: var(--ok-bg); color: var(--ok-ink);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 22px;
}

/* --- toast -------------------------------------------------------------- */
.toasts { position: fixed; right: 24px; bottom: 24px; display: flex; flex-direction: column; gap: 10px; z-index: 300; }
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: 12px;
  background: var(--navy); color: #fff;
  font-size: 13.5px; font-weight: 500;
  box-shadow: 0 14px 34px rgba(15, 37, 64, .28);
  animation: toastIn .18s ease;
}
.toast--success { background: var(--ok-ink); }
.toast--error { background: #C13438; }
@keyframes toastIn { from { transform: translateY(14px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* --- responsive --------------------------------------------------------- */
@media (max-width: 980px) {
  .login { flex-direction: column; }
  .brand { width: 100%; min-width: 0; padding: 38px 28px; gap: 30px; }
  .brand__claim { font-size: 27px; }
  .brand__frame, .brand__dot { display: none; }
  .panel { padding: 34px 24px 48px; }
}
@media (max-width: 480px) {
  .brand { padding: 28px 20px; }
  .bullets { gap: 13px; }
  .agency-logo-row { flex-direction: column; align-items: flex-start; }
}

/* ==========================================================================
   Integrazione MAT — validazione dei controlli server ASP.NET (non presente
   nel mockup, che non ha campi realmente collegati a un backend).
   ========================================================================== */
/* Messaggio dei RequiredFieldValidator (Display="Dynamic"): ora è DENTRO al div
   .field (subito dopo l'input, vedi mag_login.aspx), quindi basta un margine
   piccolo per stare vicino all'input. Lo spazio verso il campo successivo lo dà
   già .field { margin-bottom: 18px }, che con l'errore dentro si applica dopo
   il messaggio invece che dopo l'input. */
.field-error {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: #C13438;
}
/* Nasconde il "fumetto" del ValidatorCalloutExtender (Ajax Control Toolkit):
   la validazione resta visibile comunque tramite .field-error, come nel resto del sito. */
.CustomValidatorCalloutStyle {
  display: none;
  border: none;
  background-color: transparent;
  width: 0;
  color: transparent;
}
/* Bordo rosso sul campo non valido: l'AjaxControlToolkit (ValidatorCalloutExtender,
   HighlightCssClass="is-invalid" nell'aspx) aggiunge questa classe direttamente
   all'input quando il relativo RequiredFieldValidator è in errore. */
.field input.is-invalid {
  border-color: #E5484D;
  box-shadow: 0 0 0 3px rgba(229, 72, 77, .14);
}
