/* ─────────────────────────────────────────────────────────────
   GIUR-IA  ·  Login  ·  Studio Legale — Elegant Law Firm Style
   ───────────────────────────────────────────────────────────── */

:root {
  --l-navy:       #0c1524;
  --l-navy-2:     #14213d;
  --l-gold:       #b8966c;
  --l-gold-light: #d4b48a;
  --l-gold-pale:  rgba(184,150,108,0.12);
  --l-ivory:      #faf8f4;
  --l-ivory-2:    #f0ece4;
  --l-charcoal:   #1e2b3a;
  --l-muted-d:    rgba(215,205,190,0.5);
  --l-muted-l:    #7a8499;
  --l-text-d:     #e4ddd2;
  --l-border-d:   rgba(184,150,108,0.22);
  --l-border-l:   #d6cec0;
  --l-success:    #059669;
  --l-error:      #b91c1c;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--l-navy);
  min-height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ══════════════════════════════════════════════
   LAYOUT — FULL-SCREEN SPLIT
   ══════════════════════════════════════════════ */

.l-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ══════════════════════════════════════════════
   LEFT PANEL — BRAND / IDENTITY
   ══════════════════════════════════════════════ */

.l-left {
  flex: 0 0 56%;
  position: relative;
  overflow: hidden;
  background: var(--l-navy);
  display: flex;
  flex-direction: column;
  padding: 3.2rem 4rem;
}

/* Ambient glow — barely perceptible, very slow */
.l-left::before {
  content: '';
  position: absolute;
  top: -30%;
  left: -20%;
  width: 80%;
  height: 80%;
  background: radial-gradient(ellipse at center,
    rgba(184,150,108,0.09) 0%,
    transparent 68%);
  animation: l-ambient 30s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 0;
}

.l-left::after {
  content: '';
  position: absolute;
  bottom: -15%;
  right: -10%;
  width: 65%;
  height: 65%;
  background: radial-gradient(ellipse at center,
    rgba(30,64,138,0.28) 0%,
    transparent 70%);
  animation: l-ambient 38s ease-in-out 6s infinite alternate-reverse;
  pointer-events: none;
  z-index: 0;
}

@keyframes l-ambient {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(4%, 6%) scale(1.06); }
}

/* Watermark background scales */
.l-watermark {
  position: absolute;
  right: -1.5rem;
  bottom: -2rem;
  font-size: 26rem;
  line-height: 1;
  pointer-events: none;
  z-index: 0;
  user-select: none;
  color: rgba(184,150,108,0.045);
  animation: l-mark-float 40s ease-in-out infinite alternate;
}

@keyframes l-mark-float {
  0%   { transform: translate(0, 0) rotate(-3deg); }
  100% { transform: translate(-3%, -4%) rotate(0deg); }
}

/* Decorative top gold line */
.l-gold-bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(to right,
    transparent 0%,
    rgba(184,150,108,0.6) 25%,
    rgba(212,180,138,0.9) 50%,
    rgba(184,150,108,0.6) 75%,
    transparent 100%);
}

/* Vertical gold rule between panels */
.l-panel-rule {
  position: absolute;
  top: 8%;
  right: 0;
  width: 1px;
  height: 84%;
  background: linear-gradient(to bottom,
    transparent,
    var(--l-border-d) 20%,
    var(--l-border-d) 80%,
    transparent);
  z-index: 1;
}

.l-left-content {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 460px;
}

/* ── Brand mark (LOGO-1C: rimosso dal pannello sinistro) ──
   Il brand principale è ora sul pannello destro (.login-form-brand) sopra
   "Accesso riservato". Le classi .l-mark / .login-brand-logo non sono più
   referenziate nel template; rimosse per evitare regole orfane. */

/* ── Studio name ─────────────────────────── */
.l-eyebrow {
  font-size: 0.66rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--l-gold);
  font-weight: 500;
  margin-bottom: 0.45rem;
  animation: l-up 0.6s ease-out 0.18s both;
}

.l-firm-name {
  font-family: 'Playfair Display', 'Georgia', 'Times New Roman', serif;
  font-size: 2.5rem;
  line-height: 1.15;
  font-weight: 600;
  color: var(--l-text-d);
  margin-bottom: 0.25rem;
  letter-spacing: -0.01em;
  animation: l-up 0.6s ease-out 0.26s both;
}

.l-firm-name em {
  color: var(--l-gold-light);
  font-style: normal;
}

.l-tagline {
  font-size: 0.88rem;
  color: var(--l-muted-d);
  line-height: 1.65;
  margin-bottom: 2rem;
  animation: l-up 0.6s ease-out 0.34s both;
}

/* Thin gold rule */
.l-rule {
  width: 36px;
  height: 1px;
  background: linear-gradient(to right, var(--l-gold), transparent);
  margin-bottom: 1.8rem;
  animation: l-up 0.6s ease-out 0.38s both;
}

/* ── Feature list ────────────────────────── */
.l-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  animation: l-up 0.6s ease-out 0.44s both;
}

.l-features li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.83rem;
  color: rgba(215,205,190,0.68);
  line-height: 1.55;
}

.l-feat-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(184,150,108,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 0.06rem;
}

.l-feat-dot::after {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--l-gold);
}

/* ── Bottom pill ─────────────────────────── */
.l-bottom-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.28rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--l-border-d);
  font-size: 0.7rem;
  color: var(--l-muted-d);
  margin-top: 2.2rem;
  animation: l-up 0.6s ease-out 0.5s both;
}

.l-bottom-pill i {
  color: var(--l-success);
  font-size: 0.72rem;
}

/* ══════════════════════════════════════════════
   RIGHT PANEL — LOGIN FORM
   ══════════════════════════════════════════════ */

.l-right {
  flex: 0 0 44%;
  background: var(--l-ivory);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 3.5rem;
  overflow: hidden;
}

/* Subtle paper-like texture overlay */
.l-right::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(184,150,108,0.07) 1px, transparent 0);
  background-size: 22px 22px;
  pointer-events: none;
  z-index: 0;
}

/* Warm top-right glow */
.l-right::after {
  content: '';
  position: absolute;
  top: -20%;
  right: -20%;
  width: 60%;
  height: 60%;
  background: radial-gradient(ellipse,
    rgba(184,150,108,0.08),
    transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.l-form-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 360px;
  animation: l-up 0.7s ease-out 0.12s both;
}

/* ── LOGO-1C: brand sopra "Accesso riservato" ──
   Posizionato in cima a .l-form-wrap. Usa logo.png (trilingue, gold scales
   + testo navy) progettato per sfondo chiaro (--l-ivory). Centrato, con
   margine inferiore generoso prima dell'eyebrow. */
.login-form-brand {
  text-align: center;
  margin-bottom: 1.6rem;
  animation: l-up 0.6s ease-out 0.06s both;
}

.login-form-brand-logo {
  display: inline-block;
  width: 100%;
  max-width: 220px;
  height: auto;
  object-fit: contain;
  user-select: none;
}

@media (max-width: 480px) {
  .login-form-brand { margin-bottom: 1.2rem; }
  .login-form-brand-logo { max-width: 170px; }
}

/* ── Form header ─────────────────────────── */
.l-form-eyebrow {
  font-size: 0.65rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--l-gold);
  margin-bottom: 0.4rem;
}

.l-form-title {
  font-family: 'Playfair Display', 'Georgia', serif;
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--l-charcoal);
  letter-spacing: -0.015em;
  line-height: 1.2;
  margin-bottom: 0.3rem;
}

.l-form-sub {
  font-size: 0.82rem;
  color: var(--l-muted-l);
  line-height: 1.55;
  margin-bottom: 0.6rem;
}

.l-form-rule {
  width: 28px;
  height: 1px;
  background: var(--l-gold);
  margin-bottom: 1.8rem;
}

/* ── Error ───────────────────────────────── */
.l-error-box {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-left: 3px solid var(--l-error);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  margin-bottom: 1.2rem;
  font-size: 0.8rem;
  color: #7f1d1d;
  line-height: 1.45;
}

.l-error-box i {
  color: var(--l-error);
  margin-top: 0.05rem;
  flex-shrink: 0;
}

/* ── Fields ──────────────────────────────── */
.l-field {
  margin-bottom: 1.1rem;
}

.l-label {
  display: block;
  font-size: 0.71rem;
  font-weight: 600;
  color: var(--l-charcoal);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.l-input-wrap {
  position: relative;
}

.l-input-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: #a89d8e;
  font-size: 0.82rem;
  pointer-events: none;
  transition: color 0.15s;
  z-index: 1;
}

.l-input {
  width: 100%;
  height: 46px;
  padding: 0 0.9rem 0 2.5rem;
  border: 1.5px solid var(--l-border-l);
  border-radius: 9px;
  background: #fff;
  font-size: 0.88rem;
  color: var(--l-charcoal);
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

.l-input::placeholder {
  color: #b8b0a4;
  font-size: 0.84rem;
}

.l-input:focus {
  border-color: var(--l-gold);
  box-shadow: 0 0 0 3px rgba(184,150,108,0.14);
  background: #fffdfb;
}

.l-input-wrap:focus-within .l-input-icon {
  color: var(--l-gold);
}

/* Password toggle */
.l-pw-toggle {
  position: absolute;
  right: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: #a89d8e;
  font-size: 0.82rem;
  transition: color 0.15s;
  line-height: 1;
  z-index: 1;
  user-select: none;
}

.l-pw-toggle:hover { color: var(--l-gold); }

/* ── Meta row ────────────────────────────── */
.l-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.4rem;
}

.l-remember {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  color: var(--l-muted-l);
  cursor: pointer;
  user-select: none;
}

.l-remember input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--l-charcoal);
  cursor: pointer;
}

/* Phase 12F-1: link recupero password */
.l-forgot {
  font-size: 0.78rem;
  color: var(--l-muted-l);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .15s, border-color .15s;
}
.l-forgot:hover {
  color: var(--l-charcoal);
  border-bottom-color: currentColor;
  text-decoration: none;
}

/* ── Submit button ───────────────────────── */
.l-submit {
  width: 100%;
  height: 48px;
  border: none;
  border-radius: 9px;
  background: var(--l-charcoal);
  color: #f8f6f0;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  transition: background 0.15s, transform 0.12s, box-shadow 0.15s;
  font-family: inherit;
  position: relative;
  overflow: hidden;
}

.l-submit::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
    rgba(184,150,108,0.18) 0%,
    transparent 55%);
  opacity: 0;
  transition: opacity 0.2s;
}

.l-submit:hover:not(:disabled) {
  background: #111e30;
  box-shadow: 0 6px 24px rgba(14,20,32,0.28),
              0 1px 0 rgba(255,255,255,0.04) inset;
  transform: translateY(-1px);
}

.l-submit:hover:not(:disabled)::after { opacity: 1; }
.l-submit:active:not(:disabled) { transform: translateY(0); box-shadow: none; }

.l-submit-arrow {
  transition: transform 0.15s;
  font-size: 0.85rem;
}

.l-submit:hover:not(:disabled) .l-submit-arrow { transform: translateX(3px); }

.l-submit:disabled {
  cursor: wait;
  opacity: 0.9;
}

.l-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(248,246,240,0.2);
  border-top-color: #f8f6f0;
  border-radius: 50%;
  animation: l-spin 0.65s linear infinite;
  flex-shrink: 0;
}

/* ── Footer note ─────────────────────────── */
.l-form-note {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 1.3rem;
  font-size: 0.73rem;
  color: #a89d8e;
  line-height: 1.5;
}

.l-form-note i {
  color: var(--l-success);
  font-size: 0.75rem;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════
   THEME TOGGLE (subtle, top-right)
   ══════════════════════════════════════════════ */

.l-theme-toggle {
  position: fixed;
  top: 1.1rem;
  right: 1.3rem;
  z-index: 100;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(14,21,35,0.85);
  border: 1px solid rgba(184,150,108,0.25);
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.l-theme-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  transition: transform 0.15s, box-shadow 0.15s;
}

.l-theme-dot--navy { background: radial-gradient(circle, #4476c8, #14213d); }
.l-theme-dot--gold { background: radial-gradient(circle, #d4b48a, #8a6030); }

body:not(.l-theme-gold) .l-theme-dot--navy {
  box-shadow: 0 0 0 2px rgba(100,158,240,0.7);
  transform: scale(1.15);
}
body.l-theme-gold .l-theme-dot--gold {
  box-shadow: 0 0 0 2px rgba(212,180,138,0.8);
  transform: scale(1.15);
}

/* ── Gold theme overrides ────────────────── */
body.l-theme-gold {
  --l-navy:   #1a140a;
  --l-navy-2: #2e2008;
  --l-gold:   #c9a45c;
  --l-gold-light: #e0be82;
  --l-charcoal: #18100a;
}

body.l-theme-gold .l-submit {
  background: linear-gradient(135deg, #3d2b0a, #1a140a);
  box-shadow: 0 6px 24px rgba(100,60,0,0.3);
}

/* ══════════════════════════════════════════════
   ANIMATIONS
   ══════════════════════════════════════════════ */

@keyframes l-up {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes l-spin {
  to { transform: rotate(360deg); }
}

/* ══════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════ */

@media (max-width: 900px) {
  body { overflow: auto; }
  .l-shell { flex-direction: column; height: auto; min-height: 100vh; }
  .l-left  { display: none; }
  .l-right { flex: 1; padding: 2.5rem 2rem; min-height: 100vh; }
}

@media (max-width: 480px) {
  .l-right { padding: 2rem 1.2rem; }
  .l-form-title { font-size: 1.55rem; }
}
