/* CareConnect glass theme for every page under pages/.
   Matches the home page: sky-blue base, blurred pink/white glow, fluted-glass ribs, frosted cards.
   To move the glow, edit the "at X% Y%" positions in body.cc-page::before. */

:root {
  --sky-blue: #0593C6;
  --white: #FCFFFF;
  --hot-pink: #D83995;
  --navy: #062A3D;
}

/* ---------- Page frame ----------
   Every page sits in a rounded box with a thin white margin, like the home page hero.
   The box grows with the page, so long pages scroll inside one continuous frame.
   Tweak --frame-gap (the white margin) and --frame-radius (the corner rounding). */
:root { --frame-gap: .5rem; --frame-radius: 1.75rem; }
@media (min-width: 640px) { :root { --frame-gap: .75rem; } }

/* `overflow: auto` on <html> keeps the body's own clipping (otherwise browsers hand it to the window) */
html { background: var(--white); overflow: auto; }

/* Page scripts hide things with the `hidden` attribute; keep that working on styled elements */
[hidden] { display: none !important; }

body.cc-page {
  position: relative;
  isolation: isolate;
  overflow: hidden; /* clips the glow to the rounded corners */
  overflow: clip;   /* same, without making the body a scroll box (newer browsers) */
  min-height: calc(100svh - 2 * var(--frame-gap));
  margin: var(--frame-gap);
  border-radius: var(--frame-radius);
  padding-bottom: 1px; /* keeps the last section's margin inside the frame */
  background: linear-gradient(180deg, #0a86b8 0%, #0593C6 40%, #0b7fb3 100%);
  color: var(--white);
  font-family: Manrope, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Background glow: layered radial gradients, blurred, slowly drifting.
   Sized to the first screen so it looks the same on short and long pages. */
body.cc-page::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; /* stays inside the frame; the frame's blue shows at the soft edges */
  height: 100vh;
  z-index: -2;
  background:
    radial-gradient(16% 22% at 74% 34%, rgba(252, 255, 255, .85), transparent 70%),
    radial-gradient(26% 40% at 72% 40%, #D83995, transparent 72%),
    radial-gradient(24% 26% at 62% 72%, rgba(255, 110, 120, .7), transparent 70%),
    radial-gradient(22% 50% at 86% 12%, rgba(10, 40, 120, .65), transparent 70%),
    radial-gradient(60% 55% at 4% 100%, rgba(6, 42, 61, .7), transparent 70%),
    radial-gradient(45% 40% at 0% 0%, rgba(6, 42, 61, .35), transparent 70%);
  filter: blur(40px);
  animation: cc-drift 28s ease-in-out infinite alternate;
}
@keyframes cc-drift { to { transform: translate(-3%, 2%) scale(1.04); } }

/* Fluted glass ribs over everything, plus a light navy tint for text contrast */
body.cc-page::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    repeating-linear-gradient(90deg,
      rgba(252, 255, 255, .16) 0px,
      rgba(252, 255, 255, .05) 2px,
      rgba(252, 255, 255, 0) 4px,
      rgba(6, 42, 61, .10) 7px,
      rgba(252, 255, 255, .16) 8px),
    linear-gradient(rgba(6, 42, 61, .18), rgba(6, 42, 61, .18));
}

/* ---------- Glass surfaces ---------- */
.glass {
  background: linear-gradient(135deg, rgba(252, 255, 255, .22), rgba(252, 255, 255, .10));
  border: 1px solid rgba(252, 255, 255, .28);
  box-shadow: 0 24px 60px -28px rgba(6, 42, 61, .55), inset 0 1px 0 rgba(252, 255, 255, .25);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
}
/* A glass card inside another glass panel */
.glass-inner {
  background: linear-gradient(135deg, rgba(252, 255, 255, .20), rgba(252, 255, 255, .08));
  border: 1px solid rgba(252, 255, 255, .30);
}
.glass-pill {
  background: rgba(252, 255, 255, .18);
  border: 1px solid rgba(252, 255, 255, .30);
}
/* Ruler ticks along the bottom of appointment cards */
.ticks {
  height: 14px;
  opacity: .45;
  background: repeating-linear-gradient(90deg, rgba(252, 255, 255, .9) 0 1px, transparent 1px 6px);
  -webkit-mask: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
          mask: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}

/* ---------- Logo ---------- */
.cc-logo { display: inline-flex; align-items: center; gap: .5rem; font-size: 1.125rem; font-weight: 600; letter-spacing: -.01em; color: var(--white); text-decoration: none; border-radius: 999px; }

/* ---------- Buttons ---------- */
.cc-btn, .cc-btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: .375rem;
  border-radius: 999px; font-weight: 600; font-size: .875rem; cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease;
}
.cc-btn { background: var(--white); color: var(--navy); padding: .75rem 1.5rem; border: 0; }
.cc-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 32px -8px rgba(216, 57, 149, .75); }
.cc-btn:disabled { opacity: .6; cursor: wait; transform: none; box-shadow: none; }
.cc-btn-ghost {
  color: var(--white); padding: .5rem 1rem;
  background: rgba(252, 255, 255, .14); border: 1px solid rgba(252, 255, 255, .28);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.cc-btn-ghost:hover { background: rgba(252, 255, 255, .26); }
.cc-btn, .cc-btn-ghost { white-space: nowrap; }
@media (max-width: 420px) {
  .cc-btn-ghost { padding: .45rem .8rem; font-size: .8rem; }
  .cc-logo { font-size: 1rem; }
}

/* ---------- Links ---------- */
.cc-link { color: var(--white); font-weight: 600; text-decoration: none; text-underline-offset: 4px; }
.cc-link:hover { text-decoration: underline; }

/* ---------- Forms ---------- */
.cc-label { display: block; font-size: .875rem; font-weight: 600; }
.cc-field {
  display: block; width: 100%; margin-top: .5rem; padding: .75rem 1rem;
  border-radius: 14px; font: inherit; font-size: 1rem; color: var(--white);
  background: rgba(252, 255, 255, .14); border: 1px solid rgba(252, 255, 255, .32);
  color-scheme: dark; /* white date-picker and select icons */
}
.cc-field::placeholder { color: rgba(252, 255, 255, .55); }
.cc-field:focus { outline: none; border-color: var(--white); box-shadow: 0 0 0 3px rgba(216, 57, 149, .55); }
.cc-field option { color: var(--navy); background: var(--white); }
/* Password field with the show/hide eye button (added by js/theme.js) */
.cc-password { position: relative; margin-top: .5rem; }
.cc-password .cc-field { margin-top: 0; padding-right: 3.25rem; }
.cc-password input::-ms-reveal { display: none; } /* Edge's own eye, so there aren't two */
.cc-eye {
  position: absolute; top: 50%; right: .4rem; transform: translateY(-50%);
  display: flex; align-items: center; justify-content: center;
  width: 2.5rem; height: 2.5rem; border: 0; border-radius: 999px; cursor: pointer;
  color: rgba(252, 255, 255, .75); background: transparent;
  transition: background-color .2s ease, color .2s ease;
}
.cc-eye:hover { color: var(--white); background: rgba(252, 255, 255, .16); }
.cc-eye[aria-pressed="true"] { color: var(--white); }
.cc-eye svg { width: 1.2rem; height: 1.2rem; }
.cc-field-inline { width: auto; margin-top: .25rem; padding: .55rem .9rem; font-size: .9375rem; }

/* ---------- Messages ---------- */
.cc-alert { border-radius: 14px; padding: .75rem 1rem; font-size: .875rem; background: rgba(252, 255, 255, .18); border: 1px solid rgba(252, 255, 255, .35); }
.cc-alert-error { background: rgba(216, 57, 149, .32); border-color: rgba(255, 170, 215, .7); }

/* ---------- Tables ---------- */
.cc-table { width: 100%; text-align: left; font-size: .875rem; border-collapse: collapse; }
.cc-table th { padding: .9rem 1rem; font-size: .75rem; font-weight: 600; color: rgba(252, 255, 255, .7); border-bottom: 1px solid rgba(252, 255, 255, .25); }
.cc-table td { padding: .9rem 1rem; border-bottom: 1px solid rgba(252, 255, 255, .14); }
.cc-table tbody tr:last-child td { border-bottom: 0; }
.cc-table tbody tr:hover td { background: rgba(252, 255, 255, .06); }

/* Status chips */
.cc-chip { display: inline-block; border-radius: 999px; padding: .2rem .65rem; font-size: .75rem; font-weight: 600; white-space: nowrap; border: 1px solid rgba(252, 255, 255, .3); background: rgba(252, 255, 255, .14); }
.cc-chip-completed { background: rgba(252, 255, 255, .85); color: var(--navy); border-color: transparent; }
.cc-chip-no_show { background: rgba(216, 57, 149, .55); border-color: rgba(255, 170, 215, .7); }
.cc-chip-cancelled { opacity: .7; text-decoration: line-through; }

/* Bar for the no-show chart */
.cc-bar { height: .6rem; border-radius: 999px; background: linear-gradient(90deg, rgba(252, 255, 255, .9), var(--hot-pink)); }

/* ---------- Glass pickers (dropdowns + calendar, built by js/theme.js) ---------- */
.cc-picker {
  display: inline-flex; align-items: center; justify-content: space-between; gap: .75rem;
  min-width: 10.5rem; text-align: left; cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease;
}
.cc-picker:hover { background: rgba(252, 255, 255, .22); }
.cc-picker[aria-expanded="true"] { border-color: var(--white); box-shadow: 0 0 0 3px rgba(216, 57, 149, .55); }
.cc-picker.is-empty .cc-picker-text { color: rgba(252, 255, 255, .6); }
.cc-picker-sized { display: grid; }
.cc-picker-sized > span { grid-area: 1 / 1; white-space: nowrap; }
.cc-picker-sizer { visibility: hidden; }
.cc-picker-icon { width: 1rem; height: 1rem; flex: none; opacity: .85; transition: transform .3s cubic-bezier(.22, 1, .36, 1); }
.cc-picker[aria-haspopup="listbox"][aria-expanded="true"] .cc-picker-icon { transform: rotate(180deg); }

.cc-popover {
  position: fixed; z-index: 1000; margin: 0;
  color: var(--white); font-family: Manrope, system-ui, sans-serif;
  background: linear-gradient(135deg, rgba(30, 110, 160, .55), rgba(6, 42, 61, .6));
  border: 1px solid rgba(252, 255, 255, .28); border-radius: 20px;
  box-shadow: 0 24px 60px -20px rgba(6, 42, 61, .75), inset 0 1px 0 rgba(252, 255, 255, .25);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  opacity: 0; transform: translateY(-6px) scale(.98); transform-origin: top center;
  transition: opacity .2s ease, transform .3s cubic-bezier(.22, 1, .36, 1);
}
.cc-popover.is-above { transform-origin: bottom center; transform: translateY(6px) scale(.98); }
.cc-popover.is-open { opacity: 1; transform: none; }

/* Dropdown list */
.cc-listbox { list-style: none; padding: .375rem; max-height: 16rem; overflow-y: auto; outline: none; }
.cc-option {
  display: flex; align-items: center; justify-content: space-between; gap: 1.25rem;
  padding: .6rem .85rem; border-radius: 12px; font-size: .9375rem; cursor: pointer;
}
.cc-option.is-active { background: rgba(252, 255, 255, .16); }
.cc-option[aria-selected="true"] { font-weight: 600; }
.cc-option[aria-selected="true"]::after {
  content: ""; width: .9rem; height: .9rem; flex: none; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M16.7 5.3a1 1 0 0 1 0 1.4l-8 8a1 1 0 0 1-1.4 0l-4-4a1 1 0 1 1 1.4-1.4L8 12.6l7.3-7.3a1 1 0 0 1 1.4 0Z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M16.7 5.3a1 1 0 0 1 0 1.4l-8 8a1 1 0 0 1-1.4 0l-4-4a1 1 0 1 1 1.4-1.4L8 12.6l7.3-7.3a1 1 0 0 1 1.4 0Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Calendar */
.cc-calendar { width: 18.5rem; padding: .9rem; }
.cc-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.cc-cal-title { margin: 0; font-size: .95rem; font-weight: 600; }
.cc-cal-nav, .cc-cal-foot button, .cc-cal-day {
  border: 0; background: transparent; color: var(--white); font: inherit; cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.cc-cal-nav { display: flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; border-radius: 999px; }
.cc-cal-nav:hover, .cc-cal-foot button:hover, .cc-cal-day:hover { background: rgba(252, 255, 255, .16); }
.cc-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cc-cal-dow { padding: .25rem 0 .45rem; text-align: center; font-size: .7rem; color: rgba(252, 255, 255, .6); }
.cc-cal-day { aspect-ratio: 1; border-radius: 999px; font-size: .85rem; }
.cc-cal-day.is-today { box-shadow: inset 0 0 0 1px rgba(252, 255, 255, .65); }
.cc-cal-day.is-selected, .cc-cal-day.is-selected:hover { background: var(--white); color: var(--navy); font-weight: 700; }
.cc-cal-foot { display: flex; justify-content: space-between; margin-top: .6rem; padding-top: .6rem; border-top: 1px solid rgba(252, 255, 255, .18); }
.cc-cal-foot button { padding: .35rem .75rem; border-radius: 999px; font-size: .8rem; font-weight: 600; }
.cc-popover button:focus-visible { outline: 2px solid var(--white); outline-offset: 1px; }

/* ---------- Focus ---------- */
.cc-page a:focus-visible, .cc-page button:focus-visible { outline: 2px solid var(--white); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  body.cc-page::before { animation: none; }
  .cc-btn, .cc-btn-ghost, .cc-popover, .cc-picker-icon { transition: none; }
  .cc-btn:hover { transform: none; }
}
