/* ─────────────────────────────────────────────────────────────────
   Profile drawer — slide da destra, cliccabile via #nav-avatar.
   Gestito da assets/profile_drawer.js.
   ───────────────────────────────────────────────────────────────── */

/* Fa apparire il cursor pointer sull'avatar quando il modulo è caricato */
body.has-profile-drawer #nav-avatar { cursor: pointer; position: relative; }
body.has-profile-drawer #nav-avatar::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(255,255,255,0); transition: box-shadow .18s;
}
body.has-profile-drawer #nav-avatar:hover::after { box-shadow: 0 0 0 3px rgba(255,255,255,0.15); }

/* Overlay + drawer container */
.pf-overlay {
  position: fixed; inset: 0; background: rgba(5,14,43,0.4);
  z-index: 90000; display: none; opacity: 0; transition: opacity .18s;
}
.pf-overlay.open { display: block; opacity: 1; }

.pf-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 460px; max-width: 94vw;
  background: #fff; z-index: 90001;
  transform: translateX(100%); transition: transform .24s cubic-bezier(.2,.8,.2,1);
  display: flex; flex-direction: column;
  box-shadow: -18px 0 48px rgba(5,14,43,0.22);
  font-family: 'DM Sans', 'Inter', system-ui, sans-serif;
  color: #0d0d14;
}
.pf-drawer.open { transform: none; }

.pf-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px;
  background: #050e2b; color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.pf-head-left { display: flex; align-items: center; gap: 12px; }
.pf-head-av {
  width: 40px; height: 40px; border-radius: 50%;
  background: #2352e8; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; letter-spacing: .02em;
  border: 2px solid rgba(255,255,255,0.1);
}
.pf-head-name { font-size: 13px; font-weight: 600; }
.pf-head-email { font-size: 10px; color: rgba(255,255,255,0.55); margin-top: 1px; }
.pf-head-close {
  background: transparent; border: 1px solid rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.7);
  width: 28px; height: 28px; border-radius: 6px; cursor: pointer;
  font-size: 14px; display: flex; align-items: center; justify-content: center;
}
.pf-head-close:hover { background: rgba(255,255,255,0.06); color: #fff; }

.pf-body { flex: 1; overflow-y: auto; padding: 20px 22px 24px; }

.pf-sec { margin-bottom: 22px; }
.pf-sec-label {
  font-size: 9px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: #8892a4; margin-bottom: 10px;
}

.pf-field { margin-bottom: 14px; }
.pf-field-label {
  font-size: 12px; font-weight: 600; color: #1e2330;
  margin-bottom: 6px; display: flex; justify-content: space-between; align-items: center;
}
.pf-field-val { font-size: 12px; font-weight: 700; color: #2352e8; font-family: 'DM Mono', monospace; }
.pf-field-hint { font-size: 11px; color: #8892a4; line-height: 1.5; margin-top: 6px; }

.pf-input, .pf-select {
  width: 100%; padding: 10px 12px; border: 1px solid #ede9e2; border-radius: 8px;
  background: #fff; font-size: 13px; font-family: inherit; color: #0d0d14;
  transition: border-color .15s, box-shadow .15s;
}
.pf-input:focus, .pf-select:focus {
  outline: none; border-color: #2352e8; box-shadow: 0 0 0 3px rgba(35,82,232,0.12);
}
.pf-input:disabled { background: #f7f4ef; color: #8892a4; cursor: not-allowed; }

/* University picker: search + list */
.pf-uni-search {
  position: relative; margin-bottom: 8px;
}
.pf-uni-search input { padding-left: 30px; }
.pf-uni-search::before {
  content: '🔍'; position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  font-size: 11px; opacity: .5;
}
.pf-uni-list {
  max-height: 220px; overflow-y: auto;
  border: 1px solid #ede9e2; border-radius: 8px; background: #f7f4ef;
}
.pf-uni-item {
  padding: 9px 12px; cursor: pointer; border-bottom: 1px solid #ede9e2;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  transition: background .12s;
}
.pf-uni-item:last-child { border-bottom: none; }
.pf-uni-item:hover { background: #fff; }
.pf-uni-item.selected {
  background: rgba(35,82,232,0.08);
  box-shadow: inset 3px 0 0 #2352e8;
}
.pf-uni-main { min-width: 0; flex: 1; }
.pf-uni-name { font-size: 12px; font-weight: 600; color: #0d0d14; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-uni-meta { font-size: 10px; color: #8892a4; margin-top: 1px; }
.pf-uni-badge {
  font-size: 9px; font-weight: 700; padding: 2px 6px; border-radius: 10px;
  background: rgba(240,180,41,0.15); color: #8B6F00; border: 1px solid rgba(240,180,41,0.3);
  white-space: nowrap; flex-shrink: 0;
}
.pf-uni-badge.privata { background: rgba(109,40,217,0.1); color: #6d28d9; border-color: rgba(109,40,217,0.25); }
.pf-uni-none { padding: 14px; text-align: center; font-size: 11px; color: #8892a4; }

/* Appello radio cards */
.pf-appello {
  display: flex; gap: 10px;
}
.pf-appello-opt {
  flex: 1; border: 1.5px solid #ede9e2; border-radius: 10px;
  padding: 12px 14px; cursor: pointer; transition: border-color .15s, background .15s;
  position: relative;
}
.pf-appello-opt:hover { border-color: #2352e8; }
.pf-appello-opt input { position: absolute; opacity: 0; }
.pf-appello-opt.active {
  border-color: #2352e8; background: rgba(35,82,232,0.06);
}
.pf-appello-lbl { font-size: 11px; color: #8892a4; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.pf-appello-date { font-size: 15px; font-weight: 700; color: #0d0d14; margin-top: 4px; font-family: 'Instrument Serif', serif; letter-spacing: .01em; }

/* Slider */
.pf-slider {
  width: 100%; accent-color: #2352e8;
  height: 4px; border-radius: 2px;
}
.pf-slider-marks {
  display: flex; justify-content: space-between;
  font-size: 10px; color: #8892a4; margin-top: 4px; font-family: 'DM Mono', monospace;
}

/* Foot */
.pf-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 22px; border-top: 1px solid #ede9e2; background: #fff;
  flex-shrink: 0;
}
.pf-btn {
  padding: 9px 18px; border-radius: 8px; font-size: 12px; font-weight: 600;
  font-family: inherit; cursor: pointer; border: 1px solid transparent;
  transition: background .15s, color .15s, border-color .15s;
}
.pf-btn-cancel { background: #fff; color: #1e2330; border-color: #ede9e2; }
.pf-btn-cancel:hover { background: #f7f4ef; }
.pf-btn-save { background: #2352e8; color: #fff; }
.pf-btn-save:hover:not(:disabled) { background: #3d6bff; }
.pf-btn-save:disabled { opacity: .6; cursor: not-allowed; }

.pf-loading { padding: 40px 20px; text-align: center; color: #8892a4; font-size: 12px; }
.pf-error { padding: 14px; background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.25); color: #b91c1c; font-size: 12px; border-radius: 8px; margin-bottom: 14px; }

/* Toast locale — riuso styling minimale (in caso la pagina non abbia un toast globale) */
.pf-toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 90002;
  background: #0f172a; color: #fff; padding: 12px 18px; border-radius: 10px;
  font-size: 12px; font-weight: 600; box-shadow: 0 10px 24px rgba(0,0,0,0.25);
  opacity: 0; transform: translateY(12px); pointer-events: none;
  transition: opacity .22s, transform .22s;
}
.pf-toast.show { opacity: 1; transform: none; }

@media (max-width: 560px) {
  .pf-drawer { width: 100vw; max-width: 100vw; }
  .pf-appello { flex-direction: column; }
}
