/* ──────────────────────────────────────────────────────────────────────────
   ASAKAI AI Readiness Toolkit — Legal Shared Styles
   Included on ALL pages via <link rel="stylesheet" href="legal-shared.css" />
   Depends on design tokens defined in each page's <style> block.
   ────────────────────────────────────────────────────────────────────────── */

/* ── Legal Footer Bar ───────────────────────────────────────────────────── */
/* Slim advisory bar injected above <footer> on every page                  */
.legal-footer-bar {
  background: var(--color-surface, #F4F1EC);
  border-top: 1px solid var(--color-border, #E0DBD2);
  padding: 10px 0;
  font-family: var(--font-body, 'DM Sans', sans-serif);
  font-size: 0.75rem;
  color: var(--color-text-muted, #6B7280);
  line-height: 1.5;
}
.legal-footer-bar .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 5vw, 2.5rem);
}
.legal-footer-bar-text {
  color: var(--color-text-muted, #6B7280);
}
.legal-footer-bar-links {
  display: flex;
  gap: 1rem;
  flex-shrink: 0;
}
.legal-footer-bar-links a {
  color: var(--color-text-muted, #6B7280);
  text-decoration: none;
  font-weight: 500;
  transition: color 180ms cubic-bezier(0.16, 1, 0.3, 1);
}
.legal-footer-bar-links a:hover {
  color: var(--color-gold, #C9A84C);
}
@media (max-width: 640px) {
  .legal-footer-bar .container { flex-direction: column; align-items: flex-start; }
  .legal-footer-bar-links { flex-wrap: wrap; gap: 0.75rem; }
}

/* ── Cookie Consent Banner ──────────────────────────────────────────────── */
/* Fixed bottom banner; shown on first visit if no consent stored            */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: #fff;
  border-top: 1px solid var(--color-border, #E0DBD2);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -4px 24px rgba(30, 37, 51, 0.12);
  padding: 1.25rem clamp(1.25rem, 5vw, 2.5rem);
  font-family: var(--font-body, 'DM Sans', sans-serif);
  font-size: 0.875rem;
  color: var(--color-text, #1E2533);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  transform: translateY(100%);
  transition: transform 320ms cubic-bezier(0.16, 1, 0.3, 1);
}
.cookie-banner.visible {
  transform: translateY(0);
}
.cookie-banner p {
  flex: 1;
  min-width: 240px;
  line-height: 1.6;
  color: var(--color-text-muted, #6B7280);
  margin: 0;
}
.cookie-banner p a {
  color: var(--color-gold, #C9A84C);
  text-decoration: none;
  font-weight: 600;
}
.cookie-banner p a:hover {
  color: var(--color-gold-hover, #B8942E);
}
.cookie-banner-actions {
  display: flex;
  gap: 0.75rem;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.cookie-btn-accept {
  background: var(--color-navy, #1A2639);
  color: #fff;
  border: 2px solid var(--color-navy, #1A2639);
  border-radius: var(--radius-md, 8px);
  padding: 9px 20px;
  font-family: var(--font-body, 'DM Sans', sans-serif);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 180ms cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}
.cookie-btn-accept:hover {
  background: var(--color-navy-mid, #223044);
  border-color: var(--color-navy-mid, #223044);
}
.cookie-btn-reject {
  background: transparent;
  color: var(--color-text-muted, #6B7280);
  border: 2px solid var(--color-border, #E0DBD2);
  border-radius: var(--radius-md, 8px);
  padding: 9px 20px;
  font-family: var(--font-body, 'DM Sans', sans-serif);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 180ms cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}
.cookie-btn-reject:hover {
  border-color: var(--color-gold, #C9A84C);
  color: var(--color-gold, #C9A84C);
}

/* ── Consent Gate Overlay ───────────────────────────────────────────────── */
/* Modal shown before tool use when terms have not been accepted             */
.consent-gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(30, 37, 51, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms cubic-bezier(0.16, 1, 0.3, 1);
}
.consent-gate-overlay.visible {
  opacity: 1;
  pointer-events: all;
}
.consent-gate {
  background: var(--color-bg, #FAFAF7);
  border: 1px solid var(--color-border, #E0DBD2);
  border-radius: var(--radius-xl, 20px);
  padding: 2rem;
  max-width: 540px;
  width: 100%;
  box-shadow: 0 24px 60px rgba(30, 37, 51, 0.2);
  transform: scale(0.96) translateY(8px);
  transition: transform 280ms cubic-bezier(0.16, 1, 0.3, 1);
}
.consent-gate-overlay.visible .consent-gate {
  transform: scale(1) translateY(0);
}
.consent-gate-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 1.5rem;
}
.consent-gate-logo-text {
  font-family: var(--font-body, 'DM Sans', sans-serif);
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-navy, #1A2639);
  letter-spacing: 0.04em;
}
.consent-gate h2 {
  font-family: var(--font-display, 'Instrument Serif', Georgia, serif);
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--color-text, #1E2533);
  margin-bottom: 0.5rem;
  line-height: 1.25;
}
.consent-gate p {
  font-size: 0.9rem;
  color: var(--color-text-muted, #6B7280);
  line-height: 1.65;
  margin-bottom: 1.25rem;
}
.consent-gate-check-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--color-surface, #F4F1EC);
  border: 1px solid var(--color-border, #E0DBD2);
  border-radius: var(--radius-lg, 12px);
  padding: 1rem;
  margin-bottom: 1.25rem;
  cursor: pointer;
  transition: border-color 180ms cubic-bezier(0.16, 1, 0.3, 1);
}
.consent-gate-check-row:hover {
  border-color: var(--color-gold, #C9A84C);
}
.consent-gate-check-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: var(--color-navy, #1A2639);
  cursor: pointer;
}
.consent-gate-check-label {
  font-size: 0.875rem;
  color: var(--color-text, #1E2533);
  line-height: 1.6;
  cursor: pointer;
  user-select: none;
}
.consent-gate-check-label a {
  color: var(--color-gold, #C9A84C);
  font-weight: 600;
  text-decoration: none;
}
.consent-gate-check-label a:hover {
  color: var(--color-gold-hover, #B8942E);
  text-decoration: underline;
}
.consent-gate-btn {
  width: 100%;
  padding: 14px 28px;
  background: var(--color-gold, #C9A84C);
  color: var(--color-navy, #1A2639);
  border: 2px solid var(--color-gold, #C9A84C);
  border-radius: var(--radius-md, 8px);
  font-family: var(--font-body, 'DM Sans', sans-serif);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 180ms cubic-bezier(0.16, 1, 0.3, 1);
  letter-spacing: 0.01em;
}
.consent-gate-btn:hover:not(:disabled) {
  background: var(--color-gold-hover, #B8942E);
  border-color: var(--color-gold-hover, #B8942E);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(30, 37, 51, 0.08);
}
.consent-gate-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}
.consent-gate-note {
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: var(--color-text-muted, #6B7280);
  text-align: center;
  line-height: 1.5;
}

/* ── AI Disclaimer Banner ───────────────────────────────────────────────── */
/* Yellow-tinted banner for AI output areas                                  */
.ai-disclaimer {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: #FFFBEB;
  border: 1px solid #F5D87A;
  border-radius: var(--radius-lg, 12px);
  padding: 0.875rem 1.125rem;
  margin-bottom: 1rem;
  font-family: var(--font-body, 'DM Sans', sans-serif);
  font-size: 0.825rem;
  color: #92680A;
  line-height: 1.6;
}
.ai-disclaimer svg {
  flex-shrink: 0;
  margin-top: 1px;
  color: #D4960F;
}
.ai-disclaimer span {
  flex: 1;
}

/* ── Context Disclaimer ─────────────────────────────────────────────────── */
/* Inline disclaimer for specific modules (e.g. tool-finder)                */
.context-disclaimer {
  background: var(--color-surface, #F4F1EC);
  border: 1px solid var(--color-border, #E0DBD2);
  border-left: 3px solid var(--color-gold, #C9A84C);
  border-radius: 0 var(--radius-md, 8px) var(--radius-md, 8px) 0;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-family: var(--font-body, 'DM Sans', sans-serif);
  font-size: 0.8rem;
  color: var(--color-text-muted, #6B7280);
  line-height: 1.6;
}

/* ── Draft Banner ───────────────────────────────────────────────────────── */
/* Red banner at top of legal pages indicating pending attorney review       */
.draft-banner {
  background: #FEF2F2;
  border-bottom: 2px solid #FECACA;
  padding: 10px 0;
  font-family: var(--font-body, 'DM Sans', sans-serif);
  font-size: 0.8rem;
  font-weight: 600;
  color: #DC2626;
  text-align: center;
  letter-spacing: 0.02em;
}
.draft-banner strong {
  font-weight: 700;
}

/* ── Legal Content Prose ────────────────────────────────────────────────── */
/* Readable prose styling for legal pages (terms, privacy, disclaimer)      */
.legal-content {
  font-family: var(--font-body, 'DM Sans', sans-serif);
  font-size: clamp(0.925rem, 0.9rem + 0.15vw, 1rem);
  color: var(--color-text, #1E2533);
  line-height: 1.75;
  max-width: 780px;
}
.legal-content h1 {
  font-family: var(--font-display, 'Instrument Serif', Georgia, serif);
  font-size: clamp(1.75rem, 1.5rem + 1.5vw, 2.5rem);
  font-weight: 400;
  color: var(--color-text, #1E2533);
  line-height: 1.15;
  margin-bottom: 0.5rem;
}
.legal-content .legal-intro {
  font-size: 1rem;
  color: var(--color-text-muted, #6B7280);
  margin-bottom: 2rem;
  line-height: 1.65;
}
.legal-content h2 {
  font-family: var(--font-body, 'DM Sans', sans-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-text, #1E2533);
  margin-top: 2rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.375rem;
  border-bottom: 1px solid var(--color-border, #E0DBD2);
}
.legal-content h3 {
  font-family: var(--font-body, 'DM Sans', sans-serif);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-text, #1E2533);
  margin-top: 1.25rem;
  margin-bottom: 0.375rem;
}
.legal-content p {
  margin-bottom: 0.875rem;
  color: var(--color-text, #1E2533);
}
.legal-content ul,
.legal-content ol {
  margin: 0.5rem 0 1rem 1.5rem;
  padding: 0;
}
.legal-content li {
  margin-bottom: 0.4rem;
  line-height: 1.7;
}
.legal-content a {
  color: var(--color-gold, #C9A84C);
  text-decoration: none;
  font-weight: 500;
}
.legal-content a:hover {
  color: var(--color-gold-hover, #B8942E);
  text-decoration: underline;
}
.legal-content strong {
  font-weight: 700;
  color: var(--color-text, #1E2533);
}
.legal-meta {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-border, #E0DBD2);
  font-size: 0.8rem;
  color: var(--color-text-muted, #6B7280);
  line-height: 1.6;
}
.legal-nav-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
  padding: 0.75rem 1rem;
  background: var(--color-surface, #F4F1EC);
  border: 1px solid var(--color-border, #E0DBD2);
  border-radius: var(--radius-md, 8px);
  font-size: 0.8rem;
}
.legal-nav-links a {
  color: var(--color-text-muted, #6B7280);
  text-decoration: none;
  font-weight: 600;
  transition: color 180ms cubic-bezier(0.16, 1, 0.3, 1);
}
.legal-nav-links a:hover,
.legal-nav-links a.active {
  color: var(--color-gold, #C9A84C);
}
.legal-section {
  padding: clamp(4rem, 7vw, 6rem) 0 clamp(3rem, 5vw, 4rem);
}

/* ── Responsive adjustments ─────────────────────────────────────────────── */
@media (max-width: 640px) {
  .consent-gate {
    padding: 1.5rem;
    border-radius: var(--radius-lg, 12px);
  }
  .consent-gate h2 {
    font-size: 1.3rem;
  }
  .cookie-banner-actions {
    width: 100%;
    flex-direction: column;
  }
  .cookie-btn-accept,
  .cookie-btn-reject {
    width: 100%;
    text-align: center;
  }
}
