@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&display=swap');

/* ── Tokens ─────────────────────────────────────────────────────────────────── */
.pdfgate-wrap {
  --pg-bg:      #fafaf8;
  --pg-surface: #ffffff;
  --pg-ink:     #1a1a18;
  --pg-muted:   #888880;
  --pg-line:    #e8e8e4;
  --pg-accent:  #CBEEFF;
  --pg-accent-h:#1d4ed8;
  --pg-green:   #16a34a;
  --pg-red:     #dc2626;
  --pg-radius:  10px;
  --pg-font:    'DM Sans',sans-serif;
}

.pdfgate-wrap *,
.pdfgate-wrap *::before,
.pdfgate-wrap *::after {
  box-sizing: border-box;
}

/* ── Trigger button ──────────────────────────────────────────────────────────── */
.pdfgate-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: var(--pg-accent);
  color: #073B68 !important;
  font-family: var(--pg-font);
  font-size: 1rem;
  font-weight: 600;
  padding: 20px 40px;
  border: none;
  border-radius: 120px;
  cursor: pointer;
  letter-spacing: 0.01em;
  line-height: 1;
  transition: background 0.18s, transform 0.12s, box-shadow 0.18s;
  text-decoration: none !important;
  box-shadow: 0 1px 3px rgba(37,99,235,0.25);
}
.pdfgate-btn:hover {
  background: #CBEEFF;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(37,99,235,0.3);
}
.pdfgate-btn:active { transform: translateY(0); }
.pdfgate-btn svg { flex-shrink: 0; }

/* ── Overlay ─────────────────────────────────────────────────────────────────── */
.pdfgate-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26,26,24,0.48);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s;
}
.pdfgate-overlay.pg-open {
  opacity: 1;
  pointer-events: all;
}

/* ── Card ────────────────────────────────────────────────────────────────────── */
.pdfgate-card {
  background: var(--pg-surface);
  border: 1px solid var(--pg-line);
  border-radius: var(--pg-radius);
  width: 100%;
  max-width: 430px;
  padding: 40px 36px 36px;
  position: relative;
  box-shadow:
    0 4px 6px rgba(0,0,0,0.04),
    0 10px 40px rgba(0,0,0,0.10),
    0 1px 0 rgba(255,255,255,0.8) inset;
  transform: translateY(18px);
  opacity: 0;
  transition: transform 0.30s cubic-bezier(0.22,1,0.36,1), opacity 0.22s;
}
.pdfgate-overlay.pg-open .pdfgate-card {
  transform: translateY(0);
  opacity: 1;
}

/* ── Close ───────────────────────────────────────────────────────────────────── */
.pdfgate-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 28px; height: 28px;
  border: 1px solid var(--pg-line);
  border-radius: 50%;
  background: none;
  cursor: pointer;
  color: var(--pg-muted);
  font-size: 15px;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.15s, color 0.15s;
  padding: 0;
}
.pdfgate-close:hover { border-color: #bbb; color: var(--pg-ink); }

/* ── Form typography ─────────────────────────────────────────────────────────── */
.pdfgate-eyebrow {
  font-family: var(--pg-font);
  font-size: 0.68rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--pg-accent);
  margin: 0 0 12px;
}
.pdfgate-title {
  font-family: var(--pg-font);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--pg-ink);
  line-height: 1.25;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}
.pdfgate-sub {
  font-family: var(--pg-font);
  font-size: 0.875rem;
  color: var(--pg-muted);
  line-height: 1.6;
  margin: 0 0 24px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--pg-line);
}

/* ── Fields ──────────────────────────────────────────────────────────────────── */
.pdfgate-field { margin-bottom: 14px; }
.pdfgate-field label {
  display: block;
  font-family: var(--pg-font);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--pg-muted);
  margin-bottom: 6px;
}
.pdfgate-field input {
  display: block;
  width: 100%;
  border: 1px solid var(--pg-line);
  border-radius: 6px;
  padding: 11px 13px;
  font-family: var(--pg-font);
  font-size: 0.92rem;
  color: var(--pg-ink);
  background: var(--pg-bg);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
}
.pdfgate-field input::placeholder { color: #c0c0bb; }
.pdfgate-field input:focus {
  border-color: var(--pg-accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.10);
  background: #fff;
}

/* ── Submit ──────────────────────────────────────────────────────────────────── */
.pdfgate-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 8px;
  background: #073B68;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 13px;
  font-family: var(--pg-font);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s, transform 0.12s;
  letter-spacing: 0.01em;
}
.pdfgate-submit:hover { background: #073B68; }
.pdfgate-submit:active { transform: scale(0.99); }
.pdfgate-submit:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.pdfgate-spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: pgSpin 0.65s linear infinite;
  display: none;
  flex-shrink: 0;
}
@keyframes pgSpin { to { transform: rotate(360deg); } }
.pdfgate-submit.pg-loading .pdfgate-spinner { display: block; }
.pdfgate-submit.pg-loading .pdfgate-btn-text { display: none; }

.pdfgate-error {
  font-family: var(--pg-font);
  font-size: 0.8rem;
  color: var(--pg-red);
  margin-top: 10px;
  text-align: center;
  min-height: 18px;
}

/* ── Success ─────────────────────────────────────────────────────────────────── */
.pdfgate-success-view {
  text-align: center;
  padding: 10px 0;
}
.pdfgate-success-view[hidden] { display: none; }
.pdfgate-success-icon {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 18px;
  font-size: 20px;
  color: var(--pg-green);
  font-weight: 700;
}
.pdfgate-success-view h3 {
  font-family: var(--pg-font);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--pg-ink);
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}
.pdfgate-success-msg {
  font-family: var(--pg-font);
  font-size: 0.875rem;
  color: var(--pg-muted);
  line-height: 1.6;
  margin: 0 0 22px;
}
.pdfgate-dl-again {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--pg-font);
  font-size: 0.875rem;
  font-weight: 600;
  color: #073B68;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
}
.pdfgate-dl-again:hover { color: #073B68;}

/* ── Responsive ──────────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .pdfgate-card { padding: 32px 24px 28px; }
  .pdfgate-title { font-size: 1.25rem; }
}

/* ── Phone field ─────────────────────────────────────────────────────────────── */
.pdfgate-phone-wrap {
  display: flex;
  align-items: stretch;
  gap: 0;
  border: 1px solid var(--pg-line);
  border-radius: 6px;
  background: var(--pg-bg);
  overflow: visible;
  position: relative;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.pdfgate-phone-wrap:focus-within {
  border-color: var(--pg-accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.10);
}

/* Country code trigger button */
.pdfgate-cc-trigger {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 10px 0 12px;
  background: none;
  border: none;
  border-right: 1px solid var(--pg-line);
  cursor: pointer;
  white-space: nowrap;
  color: var(--pg-ink);
  font-family: var(--pg-font);
  font-size: 0.88rem;
  font-weight: 500;
  flex-shrink: 0;
  transition: background 0.12s;
  border-radius: 6px 0 0 6px;
  min-width: 82px;
}
.pdfgate-cc-trigger:hover { background: rgba(0,0,0,0.03); }
.pdfgate-cc-flag  { font-size: 1.1rem; line-height: 1; }
.pdfgate-cc-dial  { font-size: 0.82rem; color: var(--pg-muted); }
.pdfgate-cc-chevron { color: var(--pg-muted); flex-shrink: 0; transition: transform 0.18s; }
.pdfgate-cc-trigger[aria-expanded="true"] .pdfgate-cc-chevron { transform: rotate(180deg); }

/* Phone number input */
.pdfgate-input-phone {
  flex: 1;
  min-width: 0;
  border: none !important;
  border-radius: 0 6px 6px 0 !important;
  padding: 11px 13px !important;
  font-family: var(--pg-font) !important;
  font-size: 0.92rem !important;
  color: var(--pg-ink) !important;
  background: transparent !important;
  outline: none !important;
  box-shadow: none !important;
}
.pdfgate-input-phone::placeholder { color: #c0c0bb; }

/* Dropdown */
.pdfgate-cc-dropdown {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  z-index: 99999;
  width: 280px;
  background: var(--pg-surface);
  border: 1px solid var(--pg-line);
  border-radius: 8px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
  overflow: hidden;
}
.pdfgate-cc-dropdown[hidden] { display: none; }

.pdfgate-cc-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--pg-line);
  color: var(--pg-muted);
}
.pdfgate-cc-search {
  flex: 1;
  border: none;
  outline: none;
  font-family: var(--pg-font);
  font-size: 0.85rem;
  color: var(--pg-ink);
  background: transparent;
  padding: 0;
}
.pdfgate-cc-search::placeholder { color: #c0c0bb; }

.pdfgate-cc-list {
  list-style: none;
  margin: 0;
  padding: 4px 0;
  max-height: 220px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.pdfgate-cc-list::-webkit-scrollbar { width: 4px; }
.pdfgate-cc-list::-webkit-scrollbar-track { background: transparent; }
.pdfgate-cc-list::-webkit-scrollbar-thumb { background: var(--pg-line); border-radius: 2px; }

.pdfgate-cc-option {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 13px;
  cursor: pointer;
  transition: background 0.1s;
  font-size: 0.875rem;
  color: var(--pg-ink);
}
.pdfgate-cc-option:hover,
.pdfgate-cc-option:focus,
.pdfgate-cc-option.pg-selected { background: rgba(37,99,235,0.07); outline: none; }
.pdfgate-cc-option-flag { font-size: 1.05rem; flex-shrink: 0; }
.pdfgate-cc-option-name { flex: 1; font-family: var(--pg-font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pdfgate-cc-option-dial { font-family: var(--pg-font); font-size: 0.78rem; color: var(--pg-muted); flex-shrink: 0; }

.pdfgate-cc-no-results {
  padding: 16px 13px;
  font-size: 0.85rem;
  color: var(--pg-muted);
  text-align: center;
}
