/*
 * Calendario familiar -- the private family calendar page (/c/<token>).
 * Every value is copied from Ana's handover screens:
 * docs/design/prototypes/calendario-familiar/screens/*.html
 * Loaded only by layouts/family_calendar, never by the app's own pages.
 */

/* Person slots (HANDOVER.md section 1): fill, initial on fill, tint, mark.
   Kept in step with Calendar::MemberSlots by test. */
.fc-s1 { --fill: #97a663; --on: #131717; --tint: #e9ecdf; --mark: #7c884e; }
.fc-s2 { --fill: #fbae6b; --on: #131717; --tint: #feefe1; --mark: #fbae6b; }
.fc-s3 { --fill: #d9297b; --on: #ffffff; --tint: #f7d4e4; --mark: #d9297b; }
.fc-s4 { --fill: #f23322; --on: #131717; --tint: #fcd7d4; --mark: #f23322; }
.fc-s5 { --fill: #7c5ec6; --on: #ffffff; --tint: #e5dff4; --mark: #7c5ec6; }
.fc-s6 { --fill: #4f86d9; --on: #131717; --tint: #dce7f7; --mark: #4f86d9; }
.fc-s7 { --fill: #f5c22b; --on: #131717; --tint: #fdf3d5; --mark: #f5c22b; }
.fc-sf { --fill: #506162; --on: #ffffff; --tint: #e3ecec; --mark: #506162; }

.fc-body { margin: 0; background: #f6f8f8; }
:where(.fc-page) a { color: #131717; }
:where(.fc-page) a:hover { color: #000000; }
.fc-page :focus-visible { outline: 2px solid #131717; outline-offset: 2px; }

.fc-page {
  width: 100%; max-width: 480px; margin: 0 auto; min-height: 100vh; box-sizing: border-box;
  background: #f6f8f8; font-family: Poppins, system-ui, sans-serif; color: #131717;
  display: flex; flex-direction: column;
}

/* Header */
.fc-header { padding: 20px 20px 0; display: flex; flex-direction: column; gap: 14px; }
.fc-head-row { display: flex; align-items: flex-end; justify-content: space-between; }
.fc-head-titles { display: flex; flex-direction: column; }
.fc-head-large-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.fc-kicker { font-family: Caveat, cursive; font-weight: 600; font-size: 26px; line-height: 1.1; color: #c83c7a; }
.fc-h1 { margin: 0; font-size: 28px; line-height: 36px; font-weight: 400; }
.fc-stack { display: flex; padding-bottom: 4px; }
.fc-stack-av {
  width: 30px; height: 34px; border-radius: 15px 15px 4px 4px; background: var(--fill); color: var(--on);
  font-size: 13px; font-weight: 600; display: flex; align-items: center; justify-content: center; border: 2px solid #f6f8f8;
}
.fc-stack-av + .fc-stack-av { margin-left: -8px; }
.fc-stack-sm { padding-bottom: 0; }
.fc-stack-sm .fc-stack-av { width: 26px; height: 30px; border-radius: 13px 13px 4px 4px; font-size: 12px; }

.fc-tabs {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 4px;
  background: #ffffff; border-radius: 12px; box-shadow: 6px 6px 12px rgba(80, 97, 98, 0.28);
}
.fc-tab {
  height: 44px; display: flex; align-items: center; justify-content: center; border-radius: 9px;
  font-size: 14px; font-weight: 500; text-decoration: none;
}
:where(.fc-page) a.fc-tab { color: #506162; }
:where(.fc-page) a.fc-tab[aria-current="page"] { background: #d9297b; color: #000000; font-weight: 600; }

/* Period row */
.fc-section { padding: 20px 20px 0; display: flex; flex-direction: column; gap: 14px; }
.fc-period { display: flex; align-items: center; justify-content: space-between; }
.fc-period-titles { display: flex; flex-direction: column; }
.fc-overline { font-size: 13px; line-height: 16px; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; color: #506162; }
.fc-h2 { margin: 0; font-size: 22px; line-height: 28px; font-weight: 700; }
.fc-arrows { display: flex; gap: 4px; }
.fc-arrow {
  width: 44px; height: 44px; border-radius: 999px; background: #ffffff;
  display: flex; align-items: center; justify-content: center;
}

/* Legend */
.fc-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.fc-legend li { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #506162; }
.fc-swatch { width: 10px; height: 12px; border-radius: 5px 5px 2px 2px; background: var(--mark); flex-shrink: 0; }
.fc-legend-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
.fc-legend-grid li { gap: 8px; font-size: 14px; line-height: 20px; color: #131717; }
.fc-legend-grid .fc-swatch { width: 12px; height: 14px; border-radius: 6px 6px 2px 2px; }

/* Dots */
.fc-dots { display: flex; gap: 3px; height: 6px; }
.fc-dot { width: 6px; height: 6px; border-radius: 3px; background: var(--mark); }

/* Día: week strip */
.fc-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; padding: 8px; background: #ffffff; border-radius: 16px; }
.fc-strip-day {
  height: 64px; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; padding: 0; background: transparent; text-decoration: none;
}
.fc-strip-day.is-today { box-shadow: inset 0 0 0 2px #d9297b; }
:where(.fc-page) a.fc-strip-day.is-selected { background: #d9297b; color: #000000; box-shadow: none; }
.fc-strip-wd { font-size: 12px; line-height: 16px; font-weight: 500; }
.fc-strip-num { font-size: 16px; line-height: 22px; font-weight: 600; }

/* Día: timeline */
.fc-timeline { padding: 20px 20px 0; display: flex; flex-direction: column; gap: 10px; }
.fc-tl-item { display: flex; gap: 8px; text-decoration: none; }
.fc-tl-time { width: 52px; flex-shrink: 0; padding-top: 14px; font-size: 13px; line-height: 16px; font-weight: 500; color: #506162; }
.fc-card {
  flex: 1; min-width: 0; background: var(--tint); border-radius: 16px; padding: 12px 14px;
  display: flex; gap: 12px; align-items: flex-start;
}
.fc-card-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.fc-card-title { margin: 0; font-size: 16px; line-height: 22px; font-weight: 600; overflow-wrap: anywhere; }
.fc-card-meta { font-size: 14px; line-height: 20px; color: #506162; }
.fc-card-note { display: flex; align-items: center; gap: 6px; font-size: 14px; line-height: 20px; color: #131717; }
.fc-card-note svg { flex-shrink: 0; }
.fc-card-av {
  width: 28px; height: 32px; flex-shrink: 0; border-radius: 14px 14px 4px 4px; background: var(--fill); color: var(--on);
  font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: center;
}
.fc-now { display: flex; align-items: center; gap: 8px; padding: 2px 0; }
.fc-now-time { width: 52px; flex-shrink: 0; font-size: 13px; font-weight: 600; color: #131717; }
.fc-now-dot { width: 10px; height: 10px; border-radius: 5px; background: #d9297b; flex-shrink: 0; }
.fc-now-line { flex: 1; height: 2px; background: #d9297b; }
.fc-now-label { font-size: 13px; font-weight: 500; color: #131717; }
.fc-empty { font-size: 14px; line-height: 20px; color: #506162; padding: 14px 0; }

/* Lists (Mañana, agenda del día) */
.fc-list-section { padding: 24px 20px 0; display: flex; flex-direction: column; gap: 10px; }
.fc-list-section.is-month { padding-top: 22px; }
.fc-list { background: #ffffff; border-radius: 16px; padding: 4px 16px; }
.fc-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid #d2dcdc; text-decoration: none; }
.fc-row:last-child { border-bottom: 0; }
.fc-row-time { width: 44px; flex-shrink: 0; font-size: 13px; color: #506162; }
.fc-row-title { flex: 1; min-width: 0; font-size: 14px; line-height: 20px; font-weight: 500; }
.fc-row-day .fc-row-time { width: 48px; }
.fc-row-day .fc-row-title { line-height: normal; }

/* Semana */
.fc-week { padding: 18px 20px 0; display: flex; flex-direction: column; gap: 10px; }
.fc-wday { display: flex; gap: 12px; padding: 12px; border-radius: 16px; background: #ffffff; }
.fc-wday.is-today { box-shadow: 0 0 0 2px #d9297b; }
.fc-wday-left { width: 48px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.fc-wday-name { font-size: 12px; line-height: 16px; font-weight: 500; color: #506162; }
.fc-wday-num {
  width: 36px; height: 40px; border-radius: 18px 18px 6px 6px; display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 600; background: transparent; color: #131717;
}
.fc-wday.is-today .fc-wday-num { background: #d9297b; color: #000000; }
.fc-wday-hoy { font-size: 12px; line-height: 16px; font-weight: 600; color: #131717; }
.fc-wday-events { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; padding-top: 2px; }
.fc-chip { display: flex; align-items: center; gap: 8px; background: var(--tint); border-radius: 6px; padding: 7px 10px; text-decoration: none; }
.fc-chip-mark { width: 8px; height: 10px; flex-shrink: 0; border-radius: 4px 4px 1px 1px; background: var(--mark); }
.fc-chip-time { width: 44px; flex-shrink: 0; font-size: 13px; line-height: 18px; font-weight: 500; color: #506162; }
.fc-chip-title { flex: 1; min-width: 0; font-size: 14px; line-height: 20px; font-weight: 500; color: #131717; }
.fc-free { font-size: 14px; line-height: 36px; color: #506162; }

/* Mes */
.fc-month { background: #ffffff; border-radius: 16px; padding: 12px 8px; display: flex; flex-direction: column; gap: 4px; }
.fc-month-head { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; padding-bottom: 4px; }
.fc-month-head span { text-align: center; font-size: 12px; line-height: 16px; font-weight: 500; color: #506162; }
.fc-month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.fc-month-pad { height: 50px; }
.fc-cell {
  height: 50px; padding: 0; background: transparent; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px; text-decoration: none;
}
.fc-cell-num {
  width: 32px; height: 32px; border-radius: 16px; display: flex; align-items: center; justify-content: center;
  font-size: 15px; color: #131717; font-weight: 400;
}
.fc-cell.is-today .fc-cell-num { box-shadow: inset 0 0 0 2px #d9297b; font-weight: 600; }
.fc-cell.is-selected .fc-cell-num { background: #d9297b; color: #000000; font-weight: 600; box-shadow: none; }
.fc-special-section { padding: 22px 20px 0; display: flex; flex-direction: column; gap: 10px; }
.fc-special { display: flex; flex-wrap: wrap; gap: 10px; }
.fc-special-card {
  flex: 1 1 0; min-width: calc(50% - 5px); box-sizing: border-box; background: var(--tint); border-radius: 16px;
  padding: 14px; display: flex; flex-direction: column; gap: 6px;
}
.fc-special-date { font-size: 13px; color: #506162; }
.fc-special-title { font-size: 15px; line-height: 20px; font-weight: 600; }

/* Año */
.fc-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.fc-tile {
  min-height: 92px; box-sizing: border-box; padding: 12px; border-radius: 16px; text-decoration: none;
  display: flex; flex-direction: column; gap: 6px; background: #ffffff;
}
.fc-tile.is-past { background: #e3ecec; }
.fc-tile.is-current { background: #ffffff; box-shadow: 0 0 0 2px #d9297b; }
.fc-tile-top { display: flex; align-items: center; justify-content: space-between; }
.fc-tile-name { font-size: 15px; line-height: 20px; font-weight: 600; }
.fc-pill { font-size: 12px; line-height: 16px; font-weight: 600; padding: 2px 6px; border-radius: 6px; background: #d9297b; color: #000000; }
.fc-tile-count { font-size: 13px; line-height: 18px; color: #506162; }
.fc-repeats-section { padding: 24px 20px 0; display: flex; flex-direction: column; gap: 10px; }
.fc-repeat { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid #d2dcdc; }
.fc-repeat:last-child { border-bottom: 0; }
.fc-badge {
  width: 44px; height: 48px; flex-shrink: 0; border-radius: 22px 22px 6px 6px; background: var(--tint);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.fc-badge-day { font-size: 16px; line-height: 18px; font-weight: 700; }
.fc-badge-month { font-size: 12px; line-height: 16px; font-weight: 500; color: #131717; }
.fc-repeat-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fc-repeat-title { font-size: 15px; line-height: 20px; font-weight: 600; }
.fc-repeat-sub { font-size: 13px; line-height: 18px; color: #506162; }
.fc-helper { margin: 4px 0 0; font-size: 13px; line-height: 20px; color: #506162; }

/* Footer */
.fc-footer { margin-top: auto; padding: 28px 20px 28px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.fc-cta {
  width: 100%; height: 52px; box-sizing: border-box; border-radius: 999px; background: #88d7d4;
  font-size: 15px; font-weight: 600; text-decoration: none; display: flex; align-items: center; justify-content: center;
  gap: 10px; box-shadow: 6px 6px 12px rgba(80, 97, 98, 0.28);
}
.fc-privacy { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; line-height: 16px; color: #506162; text-align: center; }

/* Detalle del evento */
.fc-ev-top { padding: 16px 20px 0; display: flex; align-items: center; justify-content: space-between; }
.fc-back {
  height: 44px; padding: 0 16px 0 10px; border-radius: 999px; background: #ffffff; text-decoration: none;
  display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500;
}
.fc-hero-section { padding: 18px 20px 0; }
.fc-hero { background: var(--tint); border-radius: 16px; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.fc-hero-top { display: flex; align-items: center; justify-content: space-between; }
.fc-hero-av {
  width: 36px; height: 40px; border-radius: 18px 18px 5px 5px; background: var(--fill); color: var(--on);
  font-size: 14px; font-weight: 600; display: flex; align-items: center; justify-content: center;
}
.fc-hero-title { margin: 0; font-size: 28px; line-height: 34px; font-weight: 400; overflow-wrap: anywhere; }
.fc-hero-when { display: flex; flex-direction: column; gap: 2px; }
.fc-hero-date { font-size: 16px; line-height: 24px; font-weight: 600; }
.fc-hero-time { font-size: 16px; line-height: 24px; color: #131717; }
.fc-details-section { padding: 16px 20px 0; }
.fc-details { background: #ffffff; border-radius: 16px; padding: 4px 16px; }
.fc-drow { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid #d2dcdc; }
.fc-drow:last-child { border-bottom: 0; }
.fc-drow > svg { flex-shrink: 0; margin-top: 1px; }
.fc-dcol { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fc-dcol.gap-6 { gap: 6px; }
.fc-dcol.gap-8 { gap: 8px; }
.fc-dcol.gap-10 { gap: 10px; }
.fc-dlabel { font-size: 13px; line-height: 16px; font-weight: 500; color: #506162; }
.fc-place { font-size: 15px; line-height: 22px; font-weight: 500; overflow-wrap: anywhere; }
.fc-dtext { font-size: 15px; line-height: 22px; overflow-wrap: anywhere; }
.fc-dir-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.fc-dir {
  min-height: 36px; padding: 0 14px; border-radius: 12px; background: #88d7d4; font-size: 13px; font-weight: 600;
  text-decoration: none; display: flex; align-items: center; gap: 6px;
}
.fc-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.fc-pchip { display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px; background: var(--tint); font-size: 14px; font-weight: 500; }
.fc-pchip-av {
  width: 24px; height: 28px; border-radius: 12px 12px 4px 4px; background: var(--fill); color: var(--on);
  font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: center;
}
.fc-check-form { margin: 0; }
.fc-check { display: flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; position: relative; }
.fc-check input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.fc-box {
  width: 24px; height: 24px; flex-shrink: 0; box-sizing: border-box; border-radius: 6px; display: flex;
  align-items: center; justify-content: center; background: #ffffff; border: 2px solid #789192;
}
.fc-box svg { visibility: hidden; }
.fc-check input:checked + .fc-box { background: #88d7d4; border: 0; }
.fc-check input:checked + .fc-box svg { visibility: visible; }
.fc-check input:focus-visible + .fc-box { outline: 2px solid #131717; outline-offset: 2px; }


/* Estados (docs/design/prototypes/calendario-estados): empty day, new
   family, expired link, load error. Characters only on white cards: the
   PNGs have an opaque white background. */
.fc-character { object-fit: contain; flex-shrink: 0; }
.fc-character-112 { width: 112px; height: 112px; }
.fc-character-128 { width: 128px; height: 128px; }
.fc-character-56 { width: 56px; height: 56px; }
.fc-characters { display: flex; gap: 2px; align-items: flex-end; }

.fc-state-section { padding: 20px 20px 0; }
.fc-msg {
  background: #ffffff; border-radius: 16px; display: flex; flex-direction: column; align-items: center;
  gap: 12px; text-align: center;
}
.fc-msg-day { padding: 28px 24px 24px; }
.fc-msg-welcome { padding: 24px 24px 26px; gap: 14px; }
.fc-msg-gone { padding: 32px 24px 28px; }
.fc-msg-error { padding: 32px 24px 24px; }
.fc-msg-kicker { font-family: Caveat, cursive; font-weight: 600; font-size: 28px; line-height: 1.1; color: #c83c7a; }
.fc-msg-h1 { margin: 0; font-size: 24px; line-height: 30px; font-weight: 700; }
.fc-msg-h3 { margin: 0; font-size: 20px; line-height: 26px; font-weight: 700; }
.fc-msg-p { margin: 0; font-size: 15px; line-height: 22px; color: #506162; }

.fc-list-next .fc-row-title { line-height: 20px; }
.fc-bubbles { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.fc-bubble {
  max-width: 300px; background: #ffffff; border-radius: 16px 16px 16px 4px; padding: 10px 14px;
  font-size: 15px; line-height: 22px;
}

.fc-steps { list-style: none; margin: 0; padding: 4px 16px; background: #ffffff; border-radius: 16px; }
.fc-step { display: flex; gap: 14px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid #d2dcdc; }
.fc-step:last-child { border-bottom: 0; }
.fc-step-num {
  width: 32px; height: 36px; flex-shrink: 0; border-radius: 16px 16px 5px 5px; color: #131717;
  font-size: 15px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.fc-step-1 { background: #e9ecdf; }
.fc-step-2 { background: #feefe1; }
.fc-step-3 { background: #f7d4e4; }
.fc-step-text { display: flex; flex-direction: column; gap: 2px; }
.fc-step-title { font-size: 15px; line-height: 22px; font-weight: 600; }
.fc-step-body { font-size: 14px; line-height: 20px; color: #506162; }

/* Enlace vencido / Error al cargar: no header, card centered above the fine print */
.fc-state { flex: 1; box-sizing: border-box; padding: 20px; display: flex; flex-direction: column; }
.fc-state-center { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.fc-msg-cta { margin-top: 8px; }
.fc-fine { margin: 0; padding: 16px 8px 8px; font-size: 13px; line-height: 20px; color: #506162; text-align: center; }
.fc-retry-form { margin: 8px 0 0; width: 100%; }
.fc-retry { border: 0; font-family: inherit; color: #131717; cursor: pointer; }
.fc-retry:disabled { cursor: default; }
.fc-spinner {
  width: 18px; height: 18px; box-sizing: border-box; border-radius: 9px; border: 2.5px solid #131717;
  border-right-color: transparent; animation: fc-spin 0.8s linear infinite;
}
@keyframes fc-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .fc-spinner { animation: none; } }
:where(.fc-page) a.fc-secondary { color: #506162; }
.fc-secondary {
  width: 100%; height: 48px; box-sizing: border-box; border-radius: 12px; background: #d9e3e3; border: 1px solid #88d7d4;
  font-size: 14px; font-weight: 600; text-decoration: none; display: flex; align-items: center; justify-content: center; gap: 8px;
}
