/* ============================================================================
   auth.css — pagine di autenticazione (login / recupero / reset password)
   Design condiviso "refined teal glass" con brand panel + mesh IoT.
   ========================================================================== */
:root {
  --brand-500: #12cfe3;
  --brand-700: #0a7c86;
  --brand-900: #083c44;
  --brand-gradient: linear-gradient(135deg, #0a7c86 0%, #12cfe3 100%);
  --ease: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; }

body {
  font-family: "Inter", system-ui, sans-serif;
  margin: 0;
  min-height: 100vh;
  background: #eef7f9;
  color: #12343a;
}
[data-bs-theme="dark"] body { background: #051a1f; color: #e8fbfd; }

.auth-wrap { display: flex; min-height: 100vh; }

/* ---------------- BRAND PANEL (sinistra) ---------------- */
.brand-panel {
  position: relative;
  flex: 1.1;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 18% 22%, rgba(18,207,227,.35), transparent 40%),
    radial-gradient(circle at 82% 78%, rgba(10,124,134,.45), transparent 42%),
    linear-gradient(135deg, #041f24 0%, #06323a 42%, #0a7c86 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 3rem 3.4rem;
}

#mesh { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; opacity: .55; }
.brand-panel > * { position: relative; z-index: 1; }

.bp-top { display: flex; align-items: center; gap: .8rem; }
.bp-logo { height: 40px; filter: brightness(0) invert(1); opacity: .96; }

.bp-hero { max-width: 540px; }
.bp-eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: #9fe9f3;
  padding: .4rem .8rem; border-radius: 999px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14);
}
.bp-title { margin: 1.4rem 0 1rem; font-size: 2.8rem; font-weight: 800; line-height: 1.08; letter-spacing: -.02em; }
.bp-title .grad {
  background: linear-gradient(90deg, #7ff0ff, #12cfe3);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.bp-sub { font-size: 1.05rem; line-height: 1.6; color: rgba(233,251,253,.82); margin: 0; max-width: 480px; }

.bp-features { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: 1.9rem; }
.bp-chip {
  display: inline-flex; align-items: center; gap: .45rem;
  font-size: .85rem; font-weight: 600;
  padding: .5rem .85rem; border-radius: 999px;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(6px);
  transition: background .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}
.bp-chip:hover { background: rgba(18,207,227,.16); border-color: rgba(127,240,255,.4); transform: translateY(-1px); }
.bp-chip i { color: #5fe0ef; }

.bp-status { display: inline-flex; align-items: center; gap: .6rem; font-size: .85rem; color: rgba(233,251,253,.82); font-weight: 600; }
.live-dot { position: relative; width: 9px; height: 9px; border-radius: 50%; background: #41e0a3; flex: 0 0 9px; }
.live-dot::after {
  content:""; position:absolute; inset:-5px; border-radius:50%;
  border:2px solid #41e0a3; opacity:.5; animation: ping 1.8s var(--ease) infinite;
}
@keyframes ping { 0%{transform:scale(.6);opacity:.6} 100%{transform:scale(1.6);opacity:0} }

/* ---------------- FORM PANEL (destra) ---------------- */
.form-panel { flex: .9; display: flex; align-items: center; justify-content: center; padding: 2rem 1.5rem; }

.auth-card {
  width: 100%; max-width: 410px;
  background: rgba(255,255,255,.9);
  border: 1px solid rgba(8,60,68,.08);
  border-radius: 26px;
  padding: 2.4rem 2.2rem;
  box-shadow: 0 30px 70px rgba(8,60,68,.16);
  backdrop-filter: blur(14px);
  animation: rise .6s var(--ease) both;
}
[data-bs-theme="dark"] .auth-card {
  background: rgba(11,37,42,.82); border-color: rgba(18,207,227,.14); box-shadow: 0 30px 70px rgba(0,0,0,.5);
}
@keyframes rise { from{opacity:0; transform:translateY(14px)} to{opacity:1; transform:none} }

.auth-card .mobile-logo { display: none; }

.auth-h { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; margin: 0 0 .35rem; }
.auth-p { color: #6b8b90; font-size: .95rem; margin: 0 0 1.6rem; }
[data-bs-theme="dark"] .auth-p { color: #8eb6bb; }

.form-label { font-size: .88rem; font-weight: 700; margin-bottom: .45rem; }

.input-wrap { position: relative; }
.input-wrap .input-icon {
  position: absolute; top: 50%; left: 1rem; transform: translateY(-50%);
  color: #94a3b8; font-size: 1.05rem; pointer-events: none; transition: color .2s var(--ease);
}
.input-wrap:focus-within .input-icon { color: var(--brand-500); }

.form-control {
  min-height: 52px; border-radius: 14px;
  padding: .8rem 1rem .8rem 2.9rem;
  border: 1px solid #dbe7ea; background: #f7fbfc; font-size: .97rem;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease);
}
[data-bs-theme="dark"] .form-control { background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.10); color: #e8fbfd; }
.form-control:focus { border-color: var(--brand-500); background: #fff; box-shadow: 0 0 0 3px rgba(18,207,227,.2); }
[data-bs-theme="dark"] .form-control:focus { background: rgba(255,255,255,.06); }

.pw-toggle {
  position: absolute; top: 50%; right: .5rem; transform: translateY(-50%);
  border: 0; background: transparent; color: #94a3b8; width: 40px; height: 40px;
  border-radius: 10px; cursor: pointer; transition: color .2s var(--ease);
}
.pw-toggle:hover { color: var(--brand-700); }

.btn-auth {
  width: 100%; min-height: 52px; border: 0; border-radius: 14px;
  font-weight: 700; letter-spacing: .2px; color: #fff;
  background-image: var(--brand-gradient);
  box-shadow: 0 12px 26px rgba(10,124,134,.28);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), filter .18s var(--ease);
}
.btn-auth:hover { transform: translateY(-2px); box-shadow: 0 16px 32px rgba(10,124,134,.34); filter: saturate(1.06); color:#fff; }
.btn-auth:active { transform: translateY(0); }

.auth-footer { margin-top: 1.1rem; text-align: center; font-size: .9rem; }
.auth-footer a { color: var(--brand-700); font-weight: 600; text-decoration: none; }
.auth-footer a:hover { color: var(--brand-500); }

.copyright { margin-top: 1.6rem; text-align: center; font-size: .8rem; color: #94a3b8; }

.flash-container { display: flex; flex-direction: column; gap: .65rem; margin-bottom: 1.1rem; }
.flash {
  display: flex; align-items: flex-start; gap: .6rem;
  padding: .8rem 1rem; border-radius: 14px; font-size: .9rem; line-height: 1.4; text-align: left;
  border: 1px solid transparent;
}
.flash i { margin-top: 2px; }
.flash-success { background: rgba(32,180,134,.14); color: #14946f; border-color: rgba(32,180,134,.28); }
.flash-error, .flash-danger { background: rgba(224,82,82,.14); color: #c2393b; border-color: rgba(224,82,82,.26); }
.flash-warning { background: rgba(244,183,64,.16); color: #9a6a00; border-color: rgba(244,183,64,.3); }
.flash-info { background: rgba(18,207,227,.14); color: #0a7c86; border-color: rgba(18,207,227,.28); }

/* password strength meter (reset) */
.pw-meter { height: 6px; border-radius: 999px; background: rgba(8,60,68,.10); overflow: hidden; margin-top: .5rem; }
[data-bs-theme="dark"] .pw-meter { background: rgba(255,255,255,.10); }
.pw-meter-bar { height: 100%; width: 0; border-radius: 999px; transition: width .25s var(--ease), background .25s var(--ease); }
.pw-hint { font-size: .78rem; color: #94a3b8; margin-top: .35rem; }

/* ---------------- Responsive ---------------- */
@media (max-width: 991px) {
  .brand-panel { display: none; }
  .form-panel { flex: 1; }
  .auth-card .mobile-logo { display: block; height: 54px; margin: 0 auto 1.3rem; }
  .auth-h, .auth-p { text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
