/* Family Hub — Chiaro e moderno */

:root {
  --fh-accent: #16a34a;
  --fh-accent-soft: #dcfce7;
  --fh-accent-dark: #15803d;
  --fh-bg: #f4f6f8;
  --fh-card: #ffffff;
  --fh-ink: #111827;
  --fh-muted: #6b7280;
  --fh-border: #e5e7eb;
  --fh-radius: 16px;
  --fh-shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 8px 24px rgba(16, 24, 40, 0.06);
}

html,
body {
  background-color: var(--fh-bg);
  color: var(--fh-ink);
  min-height: 100vh;
}

/* ----- Navbar ----- */
.main-navbar {
  border-bottom: 1px solid var(--fh-border);
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.04);
}

.main-navbar .navbar-brand {
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--fh-ink);
}

.brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #22c55e, #15803d);
  color: #fff;
  font-size: 1.05rem;
}

.main-navbar .nav-link {
  font-weight: 600;
  color: #374151;
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.main-navbar .nav-link:hover {
  color: var(--fh-accent);
  background-color: #f1f5f9;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  background-color: var(--fh-accent-soft);
  color: var(--fh-accent-dark);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
}

/* ----- Cards ----- */
.card {
  background-color: var(--fh-card);
  border: 1px solid var(--fh-border);
  border-radius: var(--fh-radius);
  box-shadow: var(--fh-shadow);
}

.card-header {
  background-color: #fafbfc;
  border-bottom: 1px solid var(--fh-border);
  border-radius: var(--fh-radius) var(--fh-radius) 0 0 !important;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--fh-ink);
  font-weight: 800;
  font-size: 1.02rem;
  padding-bottom: 0.65rem;
  margin-bottom: 0.6rem;
  border-bottom: 1px solid var(--fh-border);
}

.card-title i {
  color: var(--fh-accent);
  font-size: 1.15rem;
}

.list-group-item {
  background-color: transparent;
  border-color: var(--fh-border);
}

/* ----- Buttons ----- */
.btn-primary {
  background-color: var(--fh-accent);
  border-color: var(--fh-accent);
  font-weight: 600;
  border-radius: 10px;
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--fh-accent-dark);
  border-color: var(--fh-accent-dark);
}

.btn-success {
  background-color: var(--fh-accent);
  border-color: var(--fh-accent);
  font-weight: 600;
  border-radius: 10px;
}

.btn-success:hover,
.btn-success:focus {
  background-color: var(--fh-accent-dark);
  border-color: var(--fh-accent-dark);
}

.btn-outline-secondary {
  border-radius: 10px;
}

.badge {
  font-weight: 600;
  border-radius: 999px;
  padding: 0.4em 0.7em;
}

/* ----- Forms ----- */
.form-control,
.form-select {
  border-color: #d1d5db;
  border-radius: 10px;
  background-color: #fff;
  color: var(--fh-ink);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--fh-accent);
  box-shadow: 0 0 0 0.2rem rgba(34, 197, 94, 0.18);
}

.input-group-text {
  background-color: #f9fafb;
  border-color: #d1d5db;
  color: var(--fh-muted);
}

.form-check-input:checked {
  background-color: var(--fh-accent);
  border-color: var(--fh-accent);
}

/* ----- Tables ----- */
.table {
  --bs-table-bg: transparent;
  color: var(--fh-ink);
}

.table-hover > tbody > tr:hover > * {
  background-color: #f8fafc;
}

.table thead th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--fh-muted);
  border-bottom-width: 1px;
}

/* ----- Alerts & Modals ----- */
.alert {
  border-radius: 12px;
}

.modal-content {
  border: none;
  border-radius: var(--fh-radius);
  box-shadow: var(--fh-shadow);
}

.modal-title {
  font-weight: 800;
}

/* ----- Auth (login/register) ----- */
.auth-card {
  margin-top: 6vh;
  border-top: 4px solid var(--fh-accent);
  overflow: hidden;
}

.auth-card .card-header {
  background: linear-gradient(135deg, #f0fdf4, #ffffff);
  background-size: cover;
  padding: 1.4rem 1.4rem 0.8rem;
  text-align: center;
  border-bottom: 0;
}

.auth-card .card-header h3 {
  font-weight: 800;
  color: var(--fh-ink);
}

.auth-card .card-footer {
  background-color: #fafbfc;
}

/* ----- FullCalendar: stile Teamup (griglia pulita, eventi piccoli) ----- */
.fc {
  color: var(--fh-ink);
}

.calendar-card {
  overflow: hidden;
}

.fc .fc-theme-standard td,
.fc .fc-theme-standard th {
  border-color: #eff1f4;
}

.fc .fc-theme-standard .fc-scrollgrid {
  border-color: #eef0f3;
  border-radius: 10px;
  overflow: hidden;
}

.fc .fc-toolbar-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #1f2937;
}

.fc .fc-button {
  background-color: #fff;
  color: #475569;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-weight: 600;
  box-shadow: none;
  padding: 0.3rem 0.65rem;
}

.fc .fc-button:hover {
  background-color: #f8fafc;
  color: #0f172a;
}

.fc .fc-button-primary:not(:disabled).fc-button-active {
  background-color: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.fc .fc-col-header-cell {
  background-color: #fff;
}

.fc .fc-col-header-cell a {
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
  text-decoration: none;
}

.fc .fc-daygrid-day-frame {
  background-color: #fff;
}

.fc .fc-daygrid-day-top {
  justify-content: flex-end;
  padding: 3px 5px;
}

.fc .fc-daygrid-day-number {
  font-size: 0.8rem;
  font-weight: 600;
  color: #64748b;
}

.fc .fc-day-today {
  background-color: #f6f9ff !important;
}

.fc .fc-day-today .fc-daygrid-day-number {
  background-color: #2563eb;
  color: #fff;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

/* Evento "blocco" stile Teamup */
.fc .fc-event {
  background-color: transparent;
  border: none;
  color: inherit;
}

.tu-event {
  display: flex;
  align-items: center;
  gap: 5px;
  background-color: #fff;
  border: 1px solid #eef0f3;
  border-radius: 6px;
  padding: 1px 6px;
  margin: 1px 2px;
  color: var(--et, #334155);
  font-size: 0.75rem;
  line-height: 1.4;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
  overflow: hidden;
}

.tu-event .tu-bar {
  width: 3px;
  align-self: stretch;
  border-radius: 3px;
  background-color: var(--ec, #e2e8f0);
}

.tu-event .tu-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tu-event .tu-time {
  color: inherit;
  opacity: 0.65;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.fc-h-event .fc-event-main {
  padding: 0;
  color: inherit;
}

.fc .fc-daygrid-more-link {
  color: #2563eb;
  font-weight: 600;
  font-size: 0.75rem;
}

.fc .fc-timegrid-slot {
  height: 2.1em;
}

.fc .fc-list-day-cushion {
  background-color: #f8fafc;
}

.fc .fc-list-day-cushion a {
  font-weight: 700;
  color: #334155;
}

.fc .fc-list-event-dot {
  border-radius: 50%;
}

.fc .fc-list-event:hover td {
  background-color: #f8fafc;
}

/* ----- FullCalendar: ottimizzazioni mobile ----- */
@media (max-width: 768px) {
  .fc .fc-toolbar-title {
    font-size: 0.95em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .fc .fc-button {
    font-size: 0.78rem;
    padding: 0.24rem 0.5rem;
  }

  .fc .fc-col-header-cell a,
  .fc .fc-daygrid-day-number {
    font-size: 0.72rem;
  }

  .fc .fc-daygrid-day-top {
    padding: 2px 3px;
  }

  .tu-event {
    font-size: 0.68rem;
    padding: 0 4px;
    margin: 0 1px;
  }
}

/* ----- Footer ----- */
footer {
  border-top: 1px solid var(--fh-border);
  background-color: #fff;
}

/* Link generici */
a {
  color: var(--fh-accent);
}

a:hover {
  color: var(--fh-accent-dark);
}