/* Service agreement documents — online + print/PDF */

.agreement-shell {
  max-width: 900px;
  margin: 0 auto;
}

.agreement-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding: 1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: calc(var(--header-h) + 0.5rem);
  z-index: 50;
}

.agreement-toolbar .left,
.agreement-toolbar .right {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}

.agreement-toolbar .meta {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
}

.agreement-doc {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  box-shadow: var(--shadow);
  padding: clamp(1.25rem, 3vw, 2.5rem);
  color: var(--ink);
}

.agreement-letterhead {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
  padding-bottom: 1.15rem;
  border-bottom: 3px solid #3582ac;
  margin-bottom: 1.35rem;
}

.agreement-letterhead img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

.agreement-letterhead .co h1 {
  margin: 0 0 0.2rem;
  font-size: clamp(1.15rem, 2.6vw, 1.45rem);
  color: var(--navy);
  letter-spacing: -0.01em;
}

.agreement-letterhead .co p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.agreement-letterhead .badge {
  text-align: right;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #3582ac;
  border: 1px solid color-mix(in srgb, #3582ac 40%, var(--line));
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  background: color-mix(in srgb, #3582ac 10%, transparent);
}

.agreement-title {
  text-align: center;
  margin: 0.5rem 0 1.35rem;
}

.agreement-title h2 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.25rem, 3vw, 1.65rem);
  color: var(--navy);
}

.agreement-title p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.agreement-section {
  margin: 0 0 1.25rem;
}

.agreement-section h3 {
  margin: 0 0 0.55rem;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #1e3a8a;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.35rem;
}

[data-theme="dark"] .agreement-section h3 {
  color: var(--steel-light);
}

.agreement-section p,
.agreement-section li {
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.6;
}

.agreement-section ul,
.agreement-section ol {
  margin: 0.35rem 0 0.6rem;
  padding-left: 1.2rem;
}

.agreement-section li {
  margin-bottom: 0.3rem;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 700px) {
  .field-grid {
    grid-template-columns: 1fr 1fr;
  }

  .field-grid .full {
    grid-column: 1 / -1;
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.field label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  font: inherit;
  font-size: 0.95rem;
  min-height: 44px;
}

.field textarea {
  min-height: 96px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: 2px solid color-mix(in srgb, #3582ac 55%, transparent);
  border-color: #3582ac;
}

.money-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 700px) {
  .money-row {
    grid-template-columns: repeat(3, 1fr);
  }
}

.notice {
  background: color-mix(in srgb, #3582ac 10%, var(--surface));
  border: 1px solid color-mix(in srgb, #3582ac 28%, var(--line));
  border-radius: 12px;
  padding: 0.9rem 1rem;
  color: var(--ink);
  font-size: 0.92rem;
  margin: 0.75rem 0;
}

.sig-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 0.5rem;
}

@media (min-width: 700px) {
  .sig-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.sig-block {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
  background: var(--surface);
}

.sig-block h4 {
  margin: 0 0 0.85rem;
  color: var(--navy);
  font-size: 0.95rem;
}

.sig-line {
  border-bottom: 1.5px solid var(--ink);
  min-height: 42px;
  margin: 1.1rem 0 0.35rem;
}

.sig-meta {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.75rem;
}

.sig-meta .field input {
  background: var(--card);
}

.agreement-footer-note {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
}

.agreements-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 700px) {
  .agreements-list {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 1000px) {
  .agreements-list {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

.agreement-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 100%;
}

.agreement-card h3 {
  margin: 0;
  color: var(--navy);
  font-size: 1.1rem;
}

.agreement-card p {
  margin: 0;
  color: var(--muted);
  flex: 1;
  font-size: 0.95rem;
}

.agreement-card .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.clause {
  margin-bottom: 0.65rem;
}

.clause strong {
  color: var(--navy);
}

/* ========== Print / PDF ========== */
@media print {
  :root,
  [data-theme="light"],
  [data-theme="dark"] {
    --navy: #0f2744;
    --ink: #111;
    --muted: #444;
    --line: #ccc;
    --surface: #f7f7f7;
    --white: #fff;
    --card: #fff;
    --header-bg: #fff;
    color-scheme: light;
  }

  body {
    background: #fff !important;
    color: #111 !important;
  }

  .site-header,
  .site-footer,
  .page-hero,
  .agreement-toolbar,
  .theme-toggle,
  .nav-toggle,
  .no-print {
    display: none !important;
  }

  .section {
    padding: 0 !important;
  }

  .container {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .agreement-doc {
    border: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
  }

  .agreement-letterhead {
    border-bottom: 2.5pt solid #3582ac !important;
  }

  .agreement-section h3 {
    color: #1e3a8a !important;
    break-after: avoid;
  }

  .agreement-section,
  .sig-block,
  .field {
    break-inside: avoid;
  }

  .field input,
  .field textarea,
  .field select {
    border: 0 !important;
    border-bottom: 1px solid #333 !important;
    border-radius: 0 !important;
    background: transparent !important;
    padding: 0.2rem 0 !important;
    color: #000 !important;
    box-shadow: none !important;
  }

  .field textarea {
    border: 1px solid #999 !important;
    min-height: 70px;
    padding: 0.4rem !important;
  }

  .sig-block {
    background: #fff !important;
  }

  a {
    color: #000 !important;
    text-decoration: none !important;
  }

  @page {
    size: Letter;
    margin: 0.6in 0.65in;
  }
}

/* Dark mode for agreements */
html[data-theme="dark"] .agreement-doc,
html.theme-dark .agreement-doc {
  background: #132033;
  border-color: #2a3d55;
  color: #e8eef5;
}
html[data-theme="dark"] .agreement-toolbar,
html.theme-dark .agreement-toolbar {
  background: #132033;
  border-color: #2a3d55;
}
html[data-theme="dark"] .field input,
html[data-theme="dark"] .field textarea,
html[data-theme="dark"] .field select,
html.theme-dark .field input,
html.theme-dark .field textarea,
html.theme-dark .field select {
  background: #0b1522;
  color: #e8eef5;
  border-color: #2a3d55;
}
html[data-theme="dark"] .agreement-section h3,
html.theme-dark .agreement-section h3 {
  color: #7ec0e0;
}
