/* =============================================================================
   CLINICA PULVIRENTI – Portale candidato styles
   ============================================================================= */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  background: #f0f2f5;
  color: #212529;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: #1a2e5e; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Header ─────────────────────────────────────────────────────────────────── */
.portal-header {
  background: #1a2e5e;
  padding: 0;
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
  position: sticky;
  top: 0;
  z-index: 100;
}

.portal-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 62px;
}

.portal-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.portal-logo-mark {
  width: 36px;
  height: 36px;
  background: #c9a84c;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
  color: #fff;
  flex-shrink: 0;
}

.portal-logo-text { display: flex; flex-direction: column; }

.portal-logo-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.portal-logo-sub {
  font-size: 10px;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.5px;
}

.portal-user-menu {
  display: flex;
  align-items: center;
  gap: 16px;
}

.portal-user-name {
  font-size: 13px;
  color: rgba(255,255,255,0.75);
}

.portal-user-name strong { color: #fff; }

.btn-logout {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  padding: 6px 12px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  transition: color 0.2s, border-color 0.2s;
}

.btn-logout:hover { color: #c9a84c; border-color: #c9a84c; text-decoration: none; }

/* ── Page layout ────────────────────────────────────────────────────────────── */
.portal-content {
  max-width: 1100px;
  margin: 32px auto 60px;
  padding: 0 24px;
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  align-items: start;
}

.portal-main { min-width: 0; }

.portal-sidebar { display: flex; flex-direction: column; gap: 20px; }

/* ── Section titles ─────────────────────────────────────────────────────────── */
.section-heading {
  font-size: 11px;
  font-weight: 700;
  color: #c9a84c;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 14px;
}

/* ── Cards ──────────────────────────────────────────────────────────────────── */
.portal-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  margin-bottom: 20px;
  overflow: hidden;
}

.portal-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid #f0f2f5;
  background: #f8f9fa;
}

.portal-card-header h2 {
  font-size: 14px;
  font-weight: 700;
  color: #1a2e5e;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.portal-card-body { padding: 22px; }

/* ── CV digitale (curriculum view) ─────────────────────────────────────────── */
.cv-section { margin-bottom: 28px; }
.cv-section:last-child { margin-bottom: 0; }

.cv-section-title {
  font-size: 11px;
  font-weight: 700;
  color: #c9a84c;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid #f0f2f5;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cv-row {
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 14px;
}

.cv-label {
  min-width: 170px;
  color: #868e96;
  font-size: 13px;
  flex-shrink: 0;
}

.cv-value { color: #212529; font-weight: 500; }

.cv-exp-item {
  background: #f8f9fa;
  border-left: 3px solid #1a2e5e;
  border-radius: 0 8px 8px 0;
  padding: 14px 18px;
  margin-bottom: 12px;
}

.cv-exp-item:last-child { margin-bottom: 0; }

.cv-exp-title {
  font-size: 15px;
  font-weight: 700;
  color: #1a2e5e;
  margin-bottom: 3px;
}

.cv-exp-sub {
  font-size: 13px;
  color: #6c757d;
  margin-bottom: 6px;
}

.cv-exp-desc {
  font-size: 13px;
  color: #495057;
  line-height: 1.6;
  margin-top: 8px;
}

.cv-motivation {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 16px 18px;
  font-size: 14px;
  color: #344054;
  line-height: 1.7;
  white-space: pre-line;
  font-style: italic;
}

/* ── Stato candidatura ──────────────────────────────────────────────────────── */
.stato-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 16px;
}

.stato-ricevuta        { background: #f3f4f6; color: #374151; }
.stato-in_valutazione  { background: #dbeafe; color: #1d4ed8; }
.stato-idonea          { background: #dcfce7; color: #15803d; }
.stato-non_idonea      { background: #fee2e2; color: #b91c1c; }
.stato-sospesa         { background: #ffedd5; color: #c2410c; }
.stato-colloquio_fase2 { background: #ede9fe; color: #6d28d9; }

.stato-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

/* ── Timeline ───────────────────────────────────────────────────────────────── */
.timeline { position: relative; padding-left: 20px; }

.timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #e9ecef;
}

.timeline-item {
  position: relative;
  margin-bottom: 18px;
  padding-left: 16px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -20px;
  top: 5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #1a2e5e;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px #1a2e5e;
}

.timeline-date {
  font-size: 11px;
  color: #9ca3af;
  margin-bottom: 3px;
}

.timeline-text {
  font-size: 13px;
  color: #344054;
  line-height: 1.5;
}

/* ── Comunicazioni ──────────────────────────────────────────────────────────── */
.com-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid #f0f2f5;
  cursor: pointer;
  transition: background 0.15s;
}

.com-item:last-child { border-bottom: none; }
.com-item:hover { background: #f8f9fa; margin: 0 -22px; padding: 14px 22px; border-radius: 0; }

.com-icon {
  width: 36px;
  height: 36px;
  background: #f0f4ff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #1a2e5e;
}

.com-body { flex: 1; min-width: 0; }

.com-oggetto {
  font-size: 14px;
  font-weight: 600;
  color: #212529;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.com-date { font-size: 12px; color: #9ca3af; }

.com-empty {
  text-align: center;
  padding: 28px 0;
  color: #9ca3af;
  font-size: 14px;
}

/* ── Modal ──────────────────────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 500;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open { display: flex; }

.modal-box {
  background: #fff;
  border-radius: 14px;
  max-width: 680px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 48px rgba(0,0,0,0.22);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid #e9ecef;
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: #1a2e5e;
  line-height: 1.3;
}

.modal-date { font-size: 12px; color: #9ca3af; margin-top: 3px; }

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: #9ca3af;
  font-size: 22px;
  line-height: 1;
  padding: 2px 6px;
  transition: color 0.2s;
  flex-shrink: 0;
}

.modal-close:hover { color: #1a2e5e; }

.modal-body {
  overflow-y: auto;
  padding: 22px 24px;
  font-size: 14px;
  color: #344054;
  line-height: 1.7;
}

/* ── Auth pages (login/reset) ───────────────────────────────────────────────── */
.auth-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
}

.auth-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 4px 28px rgba(0,0,0,0.10);
  width: 100%;
  max-width: 460px;
  padding: 40px 36px;
}

.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}

.auth-logo-mark {
  display: inline-flex;
  width: 52px;
  height: 52px;
  background: #1a2e5e;
  border-radius: 12px;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  color: #c9a84c;
  margin-bottom: 10px;
}

.auth-logo-name {
  font-size: 13px;
  font-weight: 700;
  color: #1a2e5e;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: block;
}

.auth-title {
  font-size: 22px;
  font-weight: 800;
  color: #1a2e5e;
  margin-bottom: 6px;
}

.auth-sub {
  font-size: 14px;
  color: #6c757d;
  margin-bottom: 28px;
}

.form-group { margin-bottom: 18px; }

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #344054;
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid #dee2e6;
  border-radius: 8px;
  font-size: 15px;
  color: #212529;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
}

.form-group input:focus {
  border-color: #1a2e5e;
  box-shadow: 0 0 0 3px rgba(26,46,94,0.10);
}

.btn-submit {
  width: 100%;
  padding: 13px;
  background: #1a2e5e;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 6px;
}

.btn-submit:hover { background: #0f1e3d; }

.alert {
  border-radius: 8px;
  padding: 13px 16px;
  font-size: 14px;
  margin-bottom: 20px;
  line-height: 1.5;
}

.alert-error   { background: #fff1f0; border: 1px solid #fca5a5; color: #b91c1c; }
.alert-success { background: #f0fdf4; border: 1px solid #86efac; color: #15803d; }
.alert-info    { background: #f0f4ff; border: 1px solid #93c5fd; color: #1d4ed8; }

.auth-links {
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  color: #868e96;
}

.auth-links a { color: #1a2e5e; font-weight: 600; }

/* ── Footer ─────────────────────────────────────────────────────────────────── */
.portal-footer {
  background: #0f1e3d;
  padding: 18px 0;
  text-align: center;
  margin-top: auto;
}

.portal-footer p { font-size: 12px; color: rgba(255,255,255,0.3); }

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .portal-content {
    grid-template-columns: 1fr;
  }
  .portal-sidebar { order: -1; }
}

@media (max-width: 600px) {
  .portal-content { padding: 0 16px; margin-top: 20px; }
  .portal-card-body { padding: 16px; }
  .auth-card { padding: 28px 20px; }
  .cv-row { flex-direction: column; gap: 2px; }
  .cv-label { min-width: unset; }
}
