/* Client Authorization & Service Agreement: agreement box + signature box.
   Loaded after styles.css on start.html and agreement.html. */
.lang-es { display: none; }
html[lang^="es"] .lang-es { display: revert; }
html[lang^="es"] .lang-en { display: none; }

.agreement-tools { font-size: 0.9rem; margin: 1rem 0 0.5rem; }
.agreement-tools a { font-weight: 600; white-space: nowrap; }
.agreement-scroll {
  max-height: 22rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  border: 1px solid var(--line-strong, #c9c2b6);
  border-radius: 6px;
  background: #fbfaf7;
  padding: 0.9rem 1rem;
}
.agreement-scroll:focus-visible { outline: 3px solid var(--clay, #b5653a); outline-offset: 2px; }
.agreement-text h3 { font-size: 1rem; margin: 1.1rem 0 0.35rem; }
.agreement-text h3:first-child { margin-top: 0; }
.agreement-text p, .agreement-text li { font-size: 0.9rem; line-height: 1.5; }
.agreement-text ul { padding-left: 1.1rem; margin: 0.3rem 0 0.6rem; }
.agreement-text, .agreement-page { overflow-wrap: break-word; }

/* Signature: the label sits directly on the box, and the whole box is the input. */
.sig-block { margin-top: 1.3rem; display: grid; gap: 0.9rem; }
@media (min-width: 600px) { .sig-block { grid-template-columns: 1fr auto; align-items: start; } }
.sig-field .sig-label { font-weight: 700; cursor: pointer; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
/* Hide a stale error as soon as the person signs or checks the box (CSS only; validation code untouched). */
.sig-field.is-error:has(.sig-input:not(:placeholder-shown)) .error-msg,
[data-field="authAgree"].is-error:has(input:checked) .error-msg { display: none; }
.sig-field.is-error:has(.sig-input:not(:placeholder-shown)) .sig-input { border-color: var(--clay, #b5653a); }
.sig-box { position: relative; }
.sig-box .sig-x {
  position: absolute; left: 0.85rem; top: 50%; transform: translateY(-50%);
  font-size: 1.1rem; color: var(--muted, #6b6257); pointer-events: none;
}
.loa .sig-box input.sig-input {
  display: block; width: 100%; box-sizing: border-box;
  min-height: 4.25rem;
  padding: 0.6rem 0.9rem 0.6rem 2.4rem;
  font-family: var(--font-serif, Georgia, serif);
  font-style: italic;
  font-size: 1.5rem;          /* >= 16px so iPhone/iPad do not zoom on focus */
  line-height: 1.2;
  color: var(--ink, #1f1a14);
  background: #fffdf6;
  border: 2px dashed var(--clay, #b5653a);
  border-radius: 8px;
  cursor: text;
  -webkit-appearance: none; appearance: none;
  touch-action: manipulation;
}
.loa .sig-box input.sig-input::placeholder {
  font-family: inherit; font-style: normal; font-size: 1.05rem;
  color: var(--clay-deep, #8a4a28); opacity: 1;
}
.loa .sig-box input.sig-input:focus {
  outline: none; border-style: solid; background: #fff;
  box-shadow: 0 0 0 3px rgba(181, 101, 58, 0.25);
}
.sig-field.is-error .sig-input { border-color: var(--error, #b3261e); border-style: solid; }
.sig-date { min-width: 9rem; }
.sig-date #loa-date { font-size: 1rem; padding-top: 0.3rem; }

/* Standalone agreement page */
.agreement-page { max-width: 46rem; margin: 0 auto; padding: 1.5rem 1.1rem 3rem; }
.agreement-page h1 { font-size: 1.6rem; margin-bottom: 0.3rem; }
.agreement-page h2 { font-size: 1.1rem; margin: 1.4rem 0 0.4rem; }
.agreement-page p, .agreement-page li { line-height: 1.55; }
.agreement-page .agreement-meta { color: var(--muted, #6b6257); font-size: 0.92rem; }
.agreement-page .print-row { display: flex; gap: 0.6rem; flex-wrap: wrap; margin: 0.8rem 0 1.2rem; }
@media print {
  .site-header, .print-row, .skip { display: none !important; }
  .agreement-page { padding: 0; max-width: none; }
  a { color: inherit; text-decoration: none; }
}
