/* Felice Client Portal 14.6.22 - Stable Mobile Reset
   Obiettivo: ridurre bug responsive, testo tagliato, overlay ingestibili e conflitti CSS. */

:root{
  --fcp-bg:#f6f8fb;
  --fcp-surface:#ffffff;
  --fcp-surface-2:#f8fbff;
  --fcp-border:#e4eaf2;
  --fcp-text:#102033;
  --fcp-muted:#667085;
  --fcp-blue:#0b3b8f;
  --fcp-blue-2:#2563eb;
  --fcp-cyan:#e8f4ff;
  --fcp-green:#12b76a;
  --fcp-orange:#f79009;
  --fcp-red:#d92d20;
  --fcp-radius:18px;
  --fcp-shadow:0 10px 28px rgba(16,32,51,.08);
}

html.fcp-mobile-app-ready,
body.fcp-app-root-page{
  background:var(--fcp-bg)!important;
  color:var(--fcp-text)!important;
  overflow-x:hidden!important;
  -webkit-text-size-adjust:100%;
}

body.fcp-app-root-page *,
body.fcp-app-root-page *::before,
body.fcp-app-root-page *::after{
  box-sizing:border-box!important;
}

body.fcp-app-root-page button,
body.fcp-app-root-page input,
body.fcp-app-root-page select,
body.fcp-app-root-page textarea{
  font-family:inherit!important;
  font-size:16px!important;
  line-height:1.35!important;
}

body.fcp-app-root-page .fcp-app-shell{
  width:100%!important;
  max-width:none!important;
  min-height:100svh!important;
  background:var(--fcp-bg)!important;
  display:grid!important;
  grid-template-columns:280px minmax(0,1fr)!important;
  gap:0!important;
  overflow-x:hidden!important;
}

body.fcp-app-root-page .fcp-app-main{
  width:100%!important;
  min-width:0!important;
  padding:24px!important;
  overflow-x:hidden!important;
}

body.fcp-app-root-page .fcp-app-legacy-content{
  min-width:0!important;
}

body.fcp-app-root-page .fcp-app-sidebar{
  position:sticky!important;
  top:0!important;
  height:100svh!important;
  background:#fff!important;
  border-right:1px solid var(--fcp-border)!important;
  padding:18px!important;
  display:flex!important;
  flex-direction:column!important;
  gap:18px!important;
}

body.fcp-app-root-page .fcp-app-nav a,
body.fcp-app-root-page .fcp-app-sidebar a{
  color:var(--fcp-text)!important;
  text-decoration:none!important;
  border-radius:14px!important;
  padding:12px 14px!important;
  line-height:1.2!important;
}
body.fcp-app-root-page .fcp-app-nav a.is-active{
  background:var(--fcp-cyan)!important;
  color:var(--fcp-blue)!important;
  font-weight:800!important;
}

body.fcp-app-root-page .fcp-native-mobile-header,
body.fcp-app-root-page .fcp-app-bottom-nav{
  display:none!important;
}

body.fcp-app-root-page .fcp-app-topbar{
  background:#fff!important;
  border:1px solid var(--fcp-border)!important;
  border-radius:22px!important;
  padding:18px 20px!important;
  margin:0 0 18px!important;
  box-shadow:var(--fcp-shadow)!important;
}
body.fcp-app-root-page .fcp-app-topbar h1{
  margin:4px 0 0!important;
  font-size:28px!important;
  line-height:1.12!important;
  letter-spacing:-.02em!important;
  color:var(--fcp-text)!important;
}
body.fcp-app-root-page .fcp-app-topbar small{
  color:var(--fcp-muted)!important;
}

/* Card generiche */
body.fcp-app-root-page .fcp-mobile-block,
body.fcp-app-root-page .fcp-mobile-task-card,
body.fcp-app-root-page .fcp-mobile-lead-card,
body.fcp-app-root-page .fcp-mobile-client-card,
body.fcp-app-root-page .fcp-card,
body.fcp-app-root-page .fcp-panel{
  background:var(--fcp-surface)!important;
  border:1px solid var(--fcp-border)!important;
  border-radius:var(--fcp-radius)!important;
  box-shadow:0 8px 22px rgba(16,32,51,.06)!important;
  overflow:visible!important;
}

body.fcp-app-root-page .fcp-mobile-task-card{
  position:relative!important;
  display:flex!important;
  align-items:flex-start!important;
  gap:12px!important;
  padding:14px!important;
  min-height:unset!important;
  margin:0 0 10px!important;
  color:var(--fcp-text)!important;
  isolation:isolate!important;
}

body.fcp-app-root-page .fcp-mobile-task-card *,
body.fcp-app-root-page [data-fcp-task-card] *{
  line-height:1.32!important;
  max-width:100%!important;
}

body.fcp-app-root-page .fcp-mobile-task-card strong,
body.fcp-app-root-page [data-fcp-task-card] strong{
  display:block!important;
  color:var(--fcp-text)!important;
  font-size:15px!important;
  font-weight:800!important;
  line-height:1.25!important;
  letter-spacing:-.01em!important;
  white-space:normal!important;
  overflow:visible!important;
  text-overflow:clip!important;
  word-break:normal!important;
  overflow-wrap:anywhere!important;
  padding-left:1px!important;
}

body.fcp-app-root-page .fcp-mobile-task-card span,
body.fcp-app-root-page .fcp-mobile-task-card small,
body.fcp-app-root-page [data-fcp-task-card] span,
body.fcp-app-root-page [data-fcp-task-card] small{
  color:var(--fcp-muted)!important;
  white-space:normal!important;
  overflow:visible!important;
  text-overflow:clip!important;
}

body.fcp-app-root-page [data-fcp-complete-task],
body.fcp-app-root-page .fcp-task-check,
body.fcp-app-root-page .fcp-mobile-task-check{
  flex:0 0 24px!important;
  width:24px!important;
  height:24px!important;
  min-width:24px!important;
  min-height:24px!important;
  border-radius:8px!important;
  border:2px solid #cbd5e1!important;
  background:#fff!important;
  color:#fff!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  cursor:pointer!important;
  overflow:hidden!important;
  pointer-events:auto!important;
  z-index:3!important;
}
body.fcp-app-root-page [data-fcp-complete-task]::after,
body.fcp-app-root-page .fcp-task-check::after,
body.fcp-app-root-page .fcp-mobile-task-check::after{
  content:'✓';
  font-size:15px!important;
  font-weight:900!important;
  opacity:0;
}
body.fcp-app-root-page [data-fcp-complete-task].is-done,
body.fcp-app-root-page .fcp-task-check.is-done,
body.fcp-app-root-page .fcp-mobile-task-check.is-done,
body.fcp-app-root-page [data-fcp-task-card].is-completed [data-fcp-complete-task]{
  background:var(--fcp-green)!important;
  border-color:var(--fcp-green)!important;
}
body.fcp-app-root-page [data-fcp-complete-task].is-done::after,
body.fcp-app-root-page .fcp-task-check.is-done::after,
body.fcp-app-root-page .fcp-mobile-task-check.is-done::after,
body.fcp-app-root-page [data-fcp-task-card].is-completed [data-fcp-complete-task]::after{
  opacity:1;
}

body.fcp-app-root-page a.call,
body.fcp-app-root-page .fcp-mobile-detail-actions a:first-child,
body.fcp-app-root-page a[href^="tel:"]{
  background:var(--fcp-blue-2)!important;
  color:#fff!important;
  border-color:var(--fcp-blue-2)!important;
}
body.fcp-app-root-page a.call *,
body.fcp-app-root-page .fcp-mobile-detail-actions a:first-child *,
body.fcp-app-root-page a[href^="tel:"] *{
  color:#fff!important;
}

/* Calendario: leggibile e scrollabile */
body.fcp-app-root-page .fcp-mobile-task-tabs,
body.fcp-app-root-page .fcp-mobile-calendar-menu,
body.fcp-app-root-page .fcp-mobile-date-actions{
  overflow-x:auto!important;
  -webkit-overflow-scrolling:touch!important;
  scrollbar-width:none!important;
}
body.fcp-app-root-page .fcp-mobile-month-grid{
  width:100%!important;
  overflow:visible!important;
}
body.fcp-app-root-page .fcp-mobile-weekdays,
body.fcp-app-root-page .fcp-mobile-month-grid{
  min-width:0!important;
}
body.fcp-app-root-page .fcp-mobile-weekdays{
  display:grid!important;
  grid-template-columns:repeat(7,minmax(0,1fr))!important;
  gap:6px!important;
  margin-bottom:6px!important;
}
body.fcp-app-root-page .fcp-mobile-weekdays span{
  text-align:center!important;
  color:var(--fcp-muted)!important;
  font-size:11px!important;
  font-weight:800!important;
}
body.fcp-app-root-page .fcp-mobile-month-grid{
  display:grid!important;
  grid-template-columns:repeat(7,minmax(0,1fr))!important;
  gap:6px!important;
}
body.fcp-app-root-page .fcp-mobile-month-grid .fcp-mobile-weekdays{
  grid-column:1 / -1!important;
}
body.fcp-app-root-page .fcp-mobile-month-day{
  min-height:92px!important;
  padding:7px!important;
  background:#fff!important;
  border:1px solid var(--fcp-border)!important;
  border-radius:12px!important;
  color:var(--fcp-text)!important;
  text-align:left!important;
  overflow:hidden!important;
}
body.fcp-app-root-page .fcp-mobile-month-day strong{
  font-size:13px!important;
  color:var(--fcp-text)!important;
}
body.fcp-app-root-page .fcp-mobile-month-day span{
  display:block!important;
  margin-top:4px!important;
  padding:3px 5px!important;
  background:#eef6ff!important;
  color:var(--fcp-blue)!important;
  border-radius:7px!important;
  font-size:10px!important;
  line-height:1.15!important;
  white-space:normal!important;
}
body.fcp-app-root-page .fcp-mobile-month-day em,
body.fcp-app-root-page .fcp-mobile-schedule-more{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  margin-top:5px!important;
  padding:4px 7px!important;
  border-radius:999px!important;
  background:var(--fcp-blue)!important;
  color:#fff!important;
  font-style:normal!important;
  font-size:11px!important;
  font-weight:900!important;
  cursor:pointer!important;
}

body.fcp-app-root-page .fcp-mobile-schedule{
  width:100%!important;
  overflow:auto!important;
  -webkit-overflow-scrolling:touch!important;
  background:#fff!important;
  border:1px solid var(--fcp-border)!important;
  border-radius:18px!important;
}
body.fcp-app-root-page .fcp-mobile-schedule[data-days="3"],
body.fcp-app-root-page .fcp-mobile-schedule[data-days="7"]{
  min-width:720px!important;
}
body.fcp-app-root-page .fcp-mobile-schedule-event{
  white-space:normal!important;
  line-height:1.15!important;
  overflow:visible!important;
}

/* Drawer / popup: sempre chiudibili e scrollabili */
body.fcp-app-root-page .fcp-mobile-sheet-backdrop,
body.fcp-app-root-page .fcp-mobile-edit-backdrop,
body.fcp-app-root-page .fcp-mobile-ai-backdrop,
body.fcp-app-root-page .fcp-mobile-lead-backdrop,
body.fcp-app-root-page .fcp-mobile-day-backdrop,
body.fcp-app-root-page .fcp-mobile-menu-backdrop{
  position:fixed!important;
  inset:0!important;
  background:rgba(15,23,42,.42)!important;
  z-index:9990!important;
  cursor:pointer!important;
}
body.fcp-app-root-page .fcp-mobile-task-sheet,
body.fcp-app-root-page .fcp-mobile-edit-sheet,
body.fcp-app-root-page .fcp-mobile-ai-sheet,
body.fcp-app-root-page .fcp-mobile-lead-sheet,
body.fcp-app-root-page .fcp-mobile-day-sheet,
body.fcp-app-root-page .fcp-mobile-menu-panel{
  position:fixed!important;
  left:50%!important;
  bottom:14px!important;
  transform:translateX(-50%) translateY(110%)!important;
  width:min(680px, calc(100vw - 24px))!important;
  max-height:min(82svh, 720px)!important;
  overflow:auto!important;
  -webkit-overflow-scrolling:touch!important;
  background:#fff!important;
  border:1px solid var(--fcp-border)!important;
  border-radius:24px!important;
  box-shadow:0 24px 70px rgba(15,23,42,.25)!important;
  z-index:9995!important;
  padding:20px!important;
  pointer-events:auto!important;
}
body.fcp-mobile-task-open .fcp-mobile-task-sheet,
body.fcp-mobile-edit-open .fcp-mobile-edit-sheet,
body.fcp-mobile-ai-open .fcp-mobile-ai-sheet,
body.fcp-mobile-lead-open .fcp-mobile-lead-sheet,
body.fcp-mobile-day-open .fcp-mobile-day-sheet,
body.fcp-app-root-page .fcp-mobile-day-sheet.is-open{
  transform:translateX(-50%) translateY(0)!important;
}
body.fcp-app-root-page .fcp-mobile-sheet-x{
  position:sticky!important;
  top:0!important;
  margin-left:auto!important;
  width:38px!important;
  height:38px!important;
  border-radius:12px!important;
  border:1px solid var(--fcp-border)!important;
  background:#fff!important;
  color:var(--fcp-text)!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  font-size:24px!important;
  font-weight:900!important;
  cursor:pointer!important;
  z-index:2!important;
}
body.fcp-app-root-page .fcp-mobile-day-sheet-body{
  max-height:calc(82svh - 110px)!important;
  overflow:auto!important;
  padding:4px 2px 20px!important;
}

body.fcp-app-root-page label{
  display:block!important;
  color:var(--fcp-text)!important;
  font-weight:700!important;
  margin-bottom:12px!important;
}
body.fcp-app-root-page input,
body.fcp-app-root-page select,
body.fcp-app-root-page textarea{
  width:100%!important;
  min-height:44px!important;
  border:1px solid #ccd6e4!important;
  border-radius:12px!important;
  background:#fff!important;
  color:var(--fcp-text)!important;
  padding:11px 12px!important;
  outline:none!important;
}
body.fcp-app-root-page textarea{
  min-height:92px!important;
  resize:vertical!important;
}
body.fcp-app-root-page input:focus,
body.fcp-app-root-page select:focus,
body.fcp-app-root-page textarea:focus{
  border-color:var(--fcp-blue-2)!important;
  box-shadow:0 0 0 4px rgba(37,99,235,.12)!important;
}
body.fcp-app-root-page .fcp-mobile-save-button,
body.fcp-app-root-page button[type="submit"]{
  min-height:46px!important;
  border-radius:14px!important;
  border:0!important;
  background:var(--fcp-blue-2)!important;
  color:#fff!important;
  font-weight:900!important;
  cursor:pointer!important;
}

@media (max-width: 960px){
  body.fcp-app-root-page .fcp-app-shell{
    display:block!important;
    min-height:100svh!important;
    padding:0!important;
  }
  body.fcp-app-root-page .fcp-app-sidebar,
  body.fcp-app-root-page .fcp-app-topbar{
    display:none!important;
  }
  body.fcp-app-root-page .fcp-native-mobile-header{
    position:sticky!important;
    top:0!important;
    z-index:1200!important;
    display:flex!important;
    align-items:center!important;
    justify-content:space-between!important;
    gap:12px!important;
    padding:12px 14px!important;
    min-height:64px!important;
    background:rgba(255,255,255,.96)!important;
    border-bottom:1px solid var(--fcp-border)!important;
    backdrop-filter:blur(12px)!important;
  }
  body.fcp-app-root-page .fcp-app-main{
    padding:12px 12px 92px!important;
  }
  body.fcp-app-root-page .fcp-app-bottom-nav{
    position:fixed!important;
    left:10px!important;
    right:10px!important;
    bottom:10px!important;
    z-index:1300!important;
    display:grid!important;
    grid-template-columns:repeat(auto-fit,minmax(52px,1fr))!important;
    gap:4px!important;
    padding:8px!important;
    background:rgba(255,255,255,.96)!important;
    border:1px solid var(--fcp-border)!important;
    border-radius:22px!important;
    box-shadow:0 14px 40px rgba(15,23,42,.18)!important;
    backdrop-filter:blur(14px)!important;
  }
  body.fcp-app-root-page .fcp-app-bottom-nav a{
    min-height:48px!important;
    display:flex!important;
    flex-direction:column!important;
    align-items:center!important;
    justify-content:center!important;
    gap:3px!important;
    border-radius:16px!important;
    color:var(--fcp-muted)!important;
    text-decoration:none!important;
    font-size:10px!important;
    font-weight:800!important;
    padding:6px 2px!important;
    overflow:hidden!important;
  }
  body.fcp-app-root-page .fcp-app-bottom-nav a.is-active{
    background:var(--fcp-blue)!important;
    color:#fff!important;
  }
  body.fcp-app-root-page .fcp-mobile-native-screen{
    display:block!important;
    width:100%!important;
  }
  body.fcp-app-root-page .fcp-app-legacy-content{
    display:none!important;
  }
  body.fcp-app-root-page .fcp-mobile-month-grid{
    gap:4px!important;
  }
  body.fcp-app-root-page .fcp-mobile-month-day{
    min-height:78px!important;
    padding:5px!important;
    border-radius:10px!important;
  }
  body.fcp-app-root-page .fcp-mobile-month-day span{
    font-size:9px!important;
    padding:2px 4px!important;
  }
  body.fcp-app-root-page .fcp-mobile-fab{
    position:fixed!important;
    right:18px!important;
    bottom:92px!important;
    z-index:1400!important;
    width:58px!important;
    height:58px!important;
    border-radius:19px!important;
    border:0!important;
    background:var(--fcp-blue-2)!important;
    color:#fff!important;
    font-size:34px!important;
    font-weight:700!important;
    box-shadow:0 16px 36px rgba(37,99,235,.32)!important;
  }
  body.fcp-app-root-page .fcp-mobile-recorder-fab{
    right:18px!important;
    bottom:158px!important;
  }
}

@media (max-width: 430px){
  body.fcp-app-root-page .fcp-app-main{padding-inline:10px!important;}
  body.fcp-app-root-page .fcp-mobile-block{padding:12px!important;}
  body.fcp-app-root-page .fcp-mobile-task-card{padding:12px!important;gap:10px!important;}
  body.fcp-app-root-page .fcp-mobile-task-card strong{font-size:14px!important;}
  body.fcp-app-root-page .fcp-mobile-month-day{min-height:72px!important;}
  body.fcp-app-root-page .fcp-mobile-task-sheet,
  body.fcp-app-root-page .fcp-mobile-edit-sheet,
  body.fcp-app-root-page .fcp-mobile-ai-sheet,
  body.fcp-app-root-page .fcp-mobile-lead-sheet,
  body.fcp-app-root-page .fcp-mobile-day-sheet{width:calc(100vw - 16px)!important;bottom:8px!important;border-radius:22px!important;padding:16px!important;}
}
