/* Care agreement tool (care-agreement/index.html) styles. Loaded after base.css; single source, do not re-inline. */

/* ── Sections ── */
section { padding: 64px 24px; }
.container { max-width: 1080px; margin: 0 auto; }

/* ── Hero ── */
#hero {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding-top: 72px;
  padding-bottom: 72px;
}
#hero h1 {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 20px;
}
#hero p {
  font-size: 17px;
  color: var(--text-secondary);
  max-width: 640px;
  line-height: 1.65;
  margin-bottom: 32px;
}

/* ── About (privacy-grid layout) ── */
#about { background: var(--bg); }

.about-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}
.about-text h2 {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}
.about-lead {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.65;
}
.about-points {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-top: 4px;
}
.about-point {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.feature-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--primary);
}
.about-point-text h3 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}
.about-point-text p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}
.info-note {
  margin-top: 48px;
  padding: 16px 20px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.65;
}
@media (max-width: 720px) {
  .about-inner { grid-template-columns: 1fr; gap: 40px; }
}

/* ── Cover (feature-card grid) ── */
#cover { background: #fff; }
#cover h2 {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
#cover > .container > p {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 40px;
  line-height: 1.65;
}
.cover-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 900px) {
  .cover-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 599px) {
  .cover-grid { grid-template-columns: 1fr; }
}
.feature-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.feature-card h3 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.feature-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ── Process (how to get started) ── */
#process { background: var(--bg); }
#process h2 {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
#process > .container > p {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 40px;
  line-height: 1.65;
}
.proc-num {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #EAF4F3;
  color: var(--primary);
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Example template ── */
#example { background: var(--bg); }
#example h2 {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
#example > .container > p {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 40px;
  line-height: 1.65;
}

.tmpl-card {
  max-width: 680px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 40px;
}
@media (max-width: 599px) { .tmpl-card { padding: 24px; } }

.tmpl-logo {
  margin-bottom: 24px;
}
.tmpl-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 6px;
}
.tmpl-meta {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 28px;
}
.tmpl-section {
  padding: 20px 0;
  border-top: 1px solid var(--border);
}
.tmpl-section:first-of-type { border-top: none; padding-top: 0; }
.tmpl-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.tmpl-subsection-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-top: 16px;
  margin-bottom: 4px;
}
.tmpl-section p {
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 2px;
}
.tmpl-section p:last-child { margin-bottom: 0; }
.tmpl-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tmpl-list li {
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
  padding-left: 14px;
  position: relative;
}
.tmpl-list li::before {
  content: "–";
  position: absolute;
  left: 0;
  color: var(--text-secondary);
}

.tmpl-signatures {
  margin-top: 32px;
  border-top: 1px solid var(--border);
  padding-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.tmpl-sig-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}
@media (max-width: 480px) { .tmpl-sig-row { grid-template-columns: 1fr; gap: 20px; } }
.tmpl-sig-line {
  border-bottom: 1px solid var(--text);
  height: 32px;
  margin-bottom: 6px;
}
.tmpl-sig-label {
  font-size: 12px;
  color: var(--text-secondary);
}
.tmpl-disclaimer {
  max-width: 680px;
  margin: 24px auto 0;
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
  font-style: italic;
}

/* ── Editable template toolbar ── */
.tmpl-toolbar {
  max-width: 680px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  flex-wrap: wrap;
}
.tmpl-edit-hint {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin: 0;
  flex: 1 1 240px;
  min-width: 220px;
}
.tmpl-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}
@media (max-width: 599px) {
  .tmpl-actions {
    width: 100%;
    flex-wrap: wrap;
  }
  .tmpl-actions .tmpl-btn-reset,
  .tmpl-actions .btn-primary {
    flex: 1 1 100%;
    justify-content: center;
  }
}
.tmpl-btn-reset {
  display: inline-flex;
  align-items: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 18px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.tmpl-btn-reset:hover { border-color: var(--primary); color: var(--text); }
button.btn-primary {
  border: none;
  font-family: inherit;
  cursor: pointer;
}

/* Editable affordance — only once JS marks the card */
.tmpl-card.editable [contenteditable] {
  border-radius: 4px;
  transition: background 0.12s;
  outline: none;
}
.tmpl-card.editable [contenteditable]:hover { background: #F1F5F4; }
.tmpl-card.editable [contenteditable]:focus {
  background: #EAF4F3;
  outline: 2px solid #BFE0DC;
  outline-offset: 1px;
}
.tmpl-card.editable [contenteditable]:empty::before {
  content: attr(data-placeholder);
  color: #A1A7AF;
}

/* ── Section builder (edit mode) ── */
.tmpl-card.editable .tmpl-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.tmpl-card.editable .tmpl-section-head .tmpl-section-label {
  margin-bottom: 0;
  flex: 1;
  min-width: 0;
}
.tmpl-card.editable .tmpl-section-body { margin-top: 8px; }
.tmpl-section-ctrls {
  display: flex;
  gap: 3px;
  flex-shrink: 0;
  opacity: 0.45;
  transition: opacity 0.12s;
}
.tmpl-section:hover .tmpl-section-ctrls,
.tmpl-section:focus-within .tmpl-section-ctrls { opacity: 1; }
.tmpl-ctrl-btn {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
  transition: border-color 0.12s, color 0.12s;
}
.tmpl-ctrl-btn:hover { border-color: var(--primary); color: var(--primary); }
.tmpl-ctrl-btn:disabled { opacity: 0.3; cursor: default; }
.tmpl-ctrl-btn.tmpl-ctrl-del:hover { border-color: #C0392B; color: #C0392B; }
/* Larger touch targets on coarse pointers (#6) */
@media (pointer: coarse) {
  .tmpl-ctrl-btn { width: 38px; height: 38px; }
  .tmpl-section-ctrls { gap: 6px; opacity: 1; }
}
.tmpl-add-wrap { margin-top: 20px; }
.tmpl-add-section {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.tmpl-add-section:hover { border-color: var(--primary); color: var(--primary); }
.tmpl-btn-reset { gap: 7px; }
.tmpl-btn-reset svg { flex-shrink: 0; }

/* ── Shared view — opened from a #a=… link (focused, but editable) ── */
html.ca-shared nav,
html.ca-shared footer,
html.ca-shared #hero,
html.ca-shared #about,
html.ca-shared #cover,
html.ca-shared #process,
html.ca-shared #ca-schedule-promo,
html.ca-shared #promo,
html.ca-shared #faq,
html.ca-shared #cta,
html.ca-shared #example > .container > h2,
html.ca-shared #example > .container > p { display: none !important; }
html.ca-shared #example { padding-top: 40px; }
.ca-shared-note {
  max-width: 680px;
  margin: 0 auto 20px;
  padding: 12px 16px;
  background: #EAF4F3;
  border: 1px solid #BFE0DC;
  border-radius: 10px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.55;
}

/* Clean print of the agreement only (popup export is primary; this covers Cmd+P) */
@media print {
  nav, footer, #hero, #about, #cover, #process,
  #ca-schedule-promo, #promo, #faq, #cta,
  .tmpl-toolbar { display: none !important; }
  #example { padding: 0 !important; background: #fff !important; }
  #example > .container > h2,
  #example > .container > p { display: none !important; }
  .tmpl-card {
    border: none !important;
    max-width: none !important;
    padding: 0 !important;
  }
  .tmpl-card.editable [contenteditable] {
    background: none !important;
    outline: none !important;
  }
}

/* ── Care Schedule Promo ── */
#ca-schedule-promo { background: #fff; }
.cs-promo-inner {
  display: flex;
  align-items: center;
  gap: 64px;
}
.cs-promo-text { flex: 1; min-width: 0; }
.cs-promo-text h2 {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}
.cs-promo-text > p {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 460px;
  line-height: 1.65;
  margin-bottom: 28px;
}
.cs-promo-visual { flex-shrink: 0; }
@media (max-width: 800px) {
  .cs-promo-inner { flex-direction: column; gap: 40px; }
  .cs-promo-visual img { width: 100% !important; max-width: 375px; }
}

/* ── Promo (cs-promo layout) ── */
#promo { background: var(--bg); }
.promo-inner {
  display: flex;
  align-items: center;
  gap: 64px;
}
.promo-text { flex: 1; min-width: 0; }
.promo-text h2 {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}
.promo-text > p {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 460px;
  line-height: 1.65;
  margin-bottom: 28px;
}
.promo-visual { flex-shrink: 0; }
@media (max-width: 800px) {
  .promo-inner { flex-direction: column; gap: 40px; }
}

/* ── App carousel ── */
.app-carousel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.app-carousel .phone-frame-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-carousel .phone-frame {
  position: relative;
  width: 200px;
  height: 416px;
  border-radius: 36px;
  border: 7px solid #1C2027;
  background: #fff;
  overflow: hidden;
  box-shadow:
    0 24px 56px rgba(0, 0, 0, 0.16),
    0 4px 12px rgba(0, 0, 0, 0.07);
}

.app-carousel .carousel-arrow {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  padding: 0;
}

.app-carousel .carousel-arrow:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.app-carousel .carousel-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.38s ease;
  pointer-events: none;
}

.app-carousel .carousel-slide.active {
  opacity: 1;
  pointer-events: auto;
}

.app-carousel .carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.app-carousel .carousel-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}

.app-carousel .carousel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: none;
  background: #D1D1C8;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s, transform 0.2s;
  flex-shrink: 0;
}

.app-carousel .carousel-dot.active {
  background: var(--primary);
  transform: scale(1.3);
}

/* ── Shared buttons ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary);
  color: #fff;
  border-radius: 8px;
  padding: 12px 22px;
  font-size: 15px;
  font-weight: 500;
  transition: background 0.15s;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary svg { flex-shrink: 0; }

.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; }
#faq .container { max-width: 760px; }
.ca-faq-block h2 {
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
/* FAQ accordion — every answer stays in the HTML, just collapsed by default */
.ca-faq { margin-top: 20px; border-top: 1px solid var(--border); }
.ca-faq-item { border-bottom: 1px solid var(--border); }
.ca-faq-item > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 2px;
  cursor: pointer;
  list-style: none;
}
.ca-faq-item > summary::-webkit-details-marker { display: none; }
.ca-faq-item > summary::after {
  content: '';
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  margin-bottom: 3px;
  border-right: 1.5px solid var(--text-muted);
  border-bottom: 1.5px solid var(--text-muted);
  transform: rotate(45deg);
  transition: transform 0.18s ease;
}
.ca-faq-item[open] > summary::after { transform: rotate(-135deg); margin: 3px 0 0; }
.ca-faq-item > summary:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 6px;
}
.ca-faq-item h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}
.ca-faq-item > summary:hover h3 { color: var(--primary); }
.ca-faq-item > p {
  margin: 0 0 18px;
  max-width: 68ch;
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
}
