/* ============================================================
   LOGIN LDV — stile ispirato al portale Leonardo Da Vinci
   Palette bordeaux/crema, tipografia classica
   Condiviso tra login.php, login_studente.php, login_genitore.php,
   admin.php
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --ldv-bordeaux:       #6B1D1F;
  --ldv-bordeaux-dark:  #4A1214;
  --ldv-crimson:        #8B2332;
  --ldv-cream:          #F5EBD8;
  --ldv-cream-light:    #FAF5EB;
  --ldv-gold:           #C9A961;
  --ldv-gold-dark:      #A68846;
  --ldv-ink:            #2B1810;
  --ldv-muted:          #6B5848;
  --ldv-border:         #E0D4B7;
  --ldv-danger:         #B91C1C;
  --ldv-success:        #166534;
}

/* Varianti per ruolo (accento) */
body[data-login="docente"]  { --ldv-accent: var(--ldv-bordeaux); --ldv-accent-dark: var(--ldv-bordeaux-dark); }
body[data-login="studente"] { --ldv-accent: #6B1D1F; --ldv-accent-dark: #4A1214; }
body[data-login="genitore"] { --ldv-accent: #7A3B1E; --ldv-accent-dark: #5C2B15; }
body[data-login="admin"]    { --ldv-accent: #3D1214; --ldv-accent-dark: #280A0C; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--ldv-ink);
  background: var(--ldv-cream-light);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   Layout split: brand a sinistra, form a destra
   ============================================================ */
.ldv-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

/* Pannello brand (sinistra) */
.ldv-brand {
  background:
    linear-gradient(135deg, rgba(107,29,31,0.92) 0%, rgba(74,18,20,0.95) 100%),
    radial-gradient(ellipse at 30% 40%, rgba(201,169,97,0.25) 0%, transparent 55%);
  background-color: var(--ldv-bordeaux-dark);
  color: var(--ldv-cream);
  padding: 64px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
/* Motivo architettonico decorativo */
.ldv-brand::before {
  content: "";
  position: absolute;
  top: -80px; right: -80px;
  width: 360px; height: 360px;
  background: radial-gradient(circle, var(--ldv-gold) 0%, transparent 70%);
  opacity: 0.12;
  border-radius: 50%;
}
.ldv-brand::after {
  content: "";
  position: absolute;
  bottom: -120px; left: -80px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, var(--ldv-cream) 0%, transparent 65%);
  opacity: 0.08;
  border-radius: 50%;
}

.ldv-brand-top {
  position: relative;
  z-index: 2;
}
.ldv-logo {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--ldv-cream);
  padding: 10px;
  display: grid;
  place-items: center;
  margin-bottom: 36px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25), inset 0 0 0 2px var(--ldv-gold);
}
.ldv-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
}
.ldv-brand h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 46px;
  font-weight: 600;
  letter-spacing: 1px;
  line-height: 1.15;
  margin: 0 0 14px;
  color: var(--ldv-cream);
}
.ldv-brand .subtitle {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px;
  font-style: italic;
  font-weight: 500;
  color: var(--ldv-gold);
  letter-spacing: 0.5px;
  margin: 0 0 40px;
}
.ldv-brand .tagline {
  font-size: 15px;
  line-height: 1.7;
  color: rgba(245,235,216,0.88);
  max-width: 440px;
}
.ldv-separator {
  width: 60px;
  height: 2px;
  background: var(--ldv-gold);
  margin: 28px 0;
}

.ldv-brand-bottom {
  position: relative;
  z-index: 2;
  font-size: 12px;
  color: rgba(245,235,216,0.6);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.ldv-brand-bottom strong { color: var(--ldv-gold); font-weight: 600; }

/* Pannello form (destra) */
.ldv-form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  background: var(--ldv-cream-light);
  position: relative;
}
/* Ornamento angolare */
.ldv-form-panel::before {
  content: "";
  position: absolute;
  top: 24px; right: 24px;
  width: 40px; height: 40px;
  border-top: 2px solid var(--ldv-gold);
  border-right: 2px solid var(--ldv-gold);
  opacity: 0.5;
}
.ldv-form-panel::after {
  content: "";
  position: absolute;
  bottom: 24px; left: 24px;
  width: 40px; height: 40px;
  border-bottom: 2px solid var(--ldv-gold);
  border-left: 2px solid var(--ldv-gold);
  opacity: 0.5;
}

.ldv-card {
  width: 100%;
  max-width: 420px;
  padding: 44px 40px;
  background: #fff;
  border-radius: 4px;
  border: 1px solid var(--ldv-border);
  box-shadow: 0 4px 24px rgba(43,24,16,0.06), 0 1px 2px rgba(43,24,16,0.04);
}

.ldv-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ldv-gold-dark);
  margin-bottom: 10px;
}
.ldv-card h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 32px;
  font-weight: 600;
  color: var(--ldv-ink);
  margin: 0 0 8px;
  letter-spacing: 0.3px;
}
.ldv-card .lead {
  font-size: 14px;
  color: var(--ldv-muted);
  margin: 0 0 32px;
  line-height: 1.55;
}

.ldv-field { margin-bottom: 18px; }
.ldv-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--ldv-ink);
  margin-bottom: 6px;
}
.ldv-field input {
  width: 100%;
  padding: 12px 14px;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  color: var(--ldv-ink);
  background: var(--ldv-cream-light);
  border: 1px solid var(--ldv-border);
  border-radius: 3px;
  outline: none;
  transition: all 0.15s;
}
.ldv-field input:focus {
  border-color: var(--ldv-accent, var(--ldv-bordeaux));
  background: #fff;
  box-shadow: 0 0 0 3px rgba(107,29,31,0.08);
}
.ldv-field input::placeholder {
  color: #bfaf93;
  font-style: italic;
}

.ldv-btn {
  display: block;
  width: 100%;
  padding: 14px 18px;
  margin-top: 26px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ldv-cream);
  background: var(--ldv-accent, var(--ldv-bordeaux));
  border: none;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.18s;
  box-shadow: 0 2px 8px rgba(107,29,31,0.3);
}
.ldv-btn:hover {
  background: var(--ldv-accent-dark, var(--ldv-bordeaux-dark));
  box-shadow: 0 4px 14px rgba(107,29,31,0.4);
  transform: translateY(-1px);
}
.ldv-btn:active { transform: translateY(0); }

.ldv-alert {
  padding: 12px 14px;
  border-radius: 3px;
  font-size: 13px;
  margin-bottom: 20px;
  font-weight: 500;
}
.ldv-alert.error {
  background: #FCE8E8;
  border-left: 3px solid var(--ldv-danger);
  color: var(--ldv-danger);
}

.ldv-footer-links {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--ldv-border);
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}
.ldv-footer-links a {
  color: var(--ldv-accent, var(--ldv-bordeaux));
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s;
}
.ldv-footer-links a:hover { border-bottom-color: currentColor; }

.ldv-role-switcher {
  margin-top: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--ldv-muted);
}
.ldv-role-switcher a {
  color: var(--ldv-accent, var(--ldv-bordeaux));
  text-decoration: none;
  font-weight: 600;
  margin: 0 6px;
}
.ldv-role-switcher a:hover { text-decoration: underline; }

/* PWA install button */
.ldv-install {
  display: none;
  margin-top: 14px;
  width: 100%;
  padding: 10px;
  background: transparent;
  border: 1px dashed var(--ldv-border);
  color: var(--ldv-muted);
  font-size: 13px;
  border-radius: 3px;
  cursor: pointer;
}
.ldv-install:hover {
  border-color: var(--ldv-accent, var(--ldv-bordeaux));
  color: var(--ldv-accent, var(--ldv-bordeaux));
}
.ldv-ios-hint {
  display: none;
  margin-top: 14px;
  font-size: 12px;
  color: var(--ldv-muted);
  font-style: italic;
  text-align: center;
}

/* ============================================================
   Mobile
   ============================================================ */
@media (max-width: 900px) {
  .ldv-page {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  .ldv-brand {
    padding: 40px 32px 28px;
  }
  .ldv-brand h1 { font-size: 32px; }
  .ldv-brand .subtitle { font-size: 16px; margin-bottom: 20px; }
  .ldv-brand .tagline { display: none; }
  .ldv-brand-bottom { display: none; }
  .ldv-separator { margin: 16px 0; }
  .ldv-logo { width: 72px; height: 72px; margin-bottom: 20px; }
  .ldv-form-panel { padding: 32px 20px; }
  .ldv-card { padding: 32px 24px; }
  .ldv-card h2 { font-size: 26px; }
}
