/* ==========================================================================
   trust-gate.css — The "request documents" dialog and its triggers.
   js/trust-gate.js builds the dialog as <dialog class="hp trust-gate"> in
   <body class="home">, so the tokens and the buttons come from css/home.css.
   ========================================================================== */

/* ----- Triggers ----- */

button[data-doc-request] { display: inline; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; color: var(--blue); font: 500 16px/1.4 var(--text); font-family: inherit; text-align: left; text-decoration: underline; text-decoration-color: rgba(61, 75, 202, 0.3); text-underline-offset: 5px; text-decoration-thickness: 1.5px; cursor: pointer; -webkit-appearance: none; appearance: none; transition: text-decoration-color 150ms; }
button[data-doc-request]:hover { text-decoration-color: currentColor; }
/* Lock glyph. The mask takes the colour of the text. */
button[data-doc-request]::before { content: ""; display: inline-block; width: 0.8em; height: 0.9em; margin-right: 0.4em; vertical-align: -0.06em; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 18'%3E%3Cpath fill-rule='evenodd' d='M4 7V5a4 4 0 0 1 8 0v2h1a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1zm2 0h4V5a2 2 0 0 0-4 0v2z'/%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 16 18'%3E%3Cpath fill-rule='evenodd' d='M4 7V5a4 4 0 0 1 8 0v2h1a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1zm2 0h4V5a2 2 0 0 0-4 0v2z'/%3E%3C/svg%3E") center / contain no-repeat; }

/* ----- Dialog ----- */

.trust-gate { box-sizing: border-box; width: calc(100% - 32px); max-width: 560px; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); margin: auto; padding: clamp(24px, 4vw, 40px); overflow: hidden auto; overscroll-behavior: contain; border: 0; border-radius: 28px; background: var(--surface); color: var(--ink); font-family: var(--text); font-size: 16px; line-height: 1.5; box-shadow: 0 2px 4px rgba(15, 22, 56, 0.06), 0 40px 80px -24px rgba(43, 54, 163, 0.38); }
/* `.hp` sets display: block. Keep the closed dialog out of the page. */
.trust-gate:not([open]) { display: none; }
.trust-gate::backdrop { background: rgba(15, 22, 56, 0.55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.trust-gate [hidden] { display: none; }

.trust-gate .tg-title { font: 600 clamp(26px, 6vw, 30px)/1.1 var(--display); letter-spacing: -0.025em; color: var(--ink); }
.trust-gate .tg-title:focus { outline: none; }
.trust-gate .tg-intro { margin-top: 10px; font-size: 16px; color: var(--ink-soft); overflow-wrap: anywhere; }
.trust-gate .tg-intro b { font-weight: 600; color: var(--ink); }

/* ----- Fields ----- */

.trust-gate .tg-field, .trust-gate .tg-docs { min-width: 0; margin: 20px 0 0; padding: 0; border: 0; }
.trust-gate .tg-label { display: block; margin: 0 0 6px; padding: 0; font: 500 14.5px/1.4 var(--text); color: var(--ink); }
.trust-gate .tg-hint { font-weight: 400; color: var(--ink-mute); }

.trust-gate input:not([type="checkbox"]), .trust-gate textarea { display: block; width: 100%; min-height: 48px; margin: 0; padding: 11px 14px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); color: var(--ink); font: 400 16px/1.5 var(--text); -webkit-appearance: none; appearance: none; transition: border-color 150ms; }
.trust-gate textarea { min-height: 96px; resize: vertical; }
.trust-gate input:not([type="checkbox"]):hover, .trust-gate textarea:hover { border-color: var(--ink-mute); }
.trust-gate input:not([type="checkbox"]):focus-visible, .trust-gate textarea:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; border-color: var(--blue); border-radius: 12px; }
.trust-gate input[aria-invalid="true"], .trust-gate textarea[aria-invalid="true"] { border-color: #B42318; }

/* ----- Checkbox rows ----- */

.trust-gate .tg-check { display: flex; align-items: flex-start; gap: 12px; min-height: 44px; margin: 0; padding: 10px 0; font: 400 16px/1.5 var(--text); color: var(--ink); cursor: pointer; }
.trust-gate .tg-check input { flex: none; width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--blue); cursor: pointer; }
.trust-gate .tg-check input:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
.trust-gate .tg-check input[aria-invalid="true"] { outline: 2px solid #B42318; outline-offset: 2px; border-radius: 4px; }
.trust-gate .tg-docs .tg-check + .tg-check { border-top: 1px solid var(--line); }
.trust-gate .tg-field > .tg-check { font-size: 15px; color: var(--ink-soft); }

/* ----- Errors ----- */

.trust-gate .tg-error { margin-top: 6px; font-size: 14px; line-height: 1.4; font-weight: 500; color: #B42318; }
.trust-gate .tg-fail { margin-top: 20px; padding: 12px 14px; border-radius: 12px; background: #FEECEA; }

/* Honeypot: off screen, not display: none, so that bots still fill it in. */
.trust-gate .tg-trap { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ----- Actions ----- */

.trust-gate .tg-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.trust-gate .btn { border: 0; cursor: pointer; -webkit-appearance: none; appearance: none; }
.trust-gate .btn:focus-visible { border-radius: 999px; }
.trust-gate .btn:disabled { opacity: 0.6; cursor: default; transform: none; }

@media (max-width: 480px) {
  .trust-gate .tg-actions { flex-direction: column; }
  .trust-gate .tg-actions .btn { width: 100%; }
}

@media (prefers-reduced-motion: no-preference) {
  .trust-gate[open] { animation: trust-gate-in 250ms var(--ease-out); }
  .trust-gate[open]::backdrop { animation: trust-gate-fade 250ms var(--ease-out); }
  @keyframes trust-gate-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } }
  @keyframes trust-gate-fade { from { opacity: 0; } }
}
