/* ╔══════════════════════════════════════════════════╗
   ║  HumiLead · Gate Modal v1.1                        ║
   ║  Mobile optimized · spinner · validation            ║
   ╚══════════════════════════════════════════════════╝ */

.hl-overlay {
  position: fixed; inset: 0; z-index: 99999;
  background: rgba(8, 8, 10, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  animation: hlFadeIn 0.2s ease;
}
@keyframes hlFadeIn { from { opacity: 0; } to { opacity: 1; } }

.hl-modal {
  position: relative;
  background: #1a1a22;
  border: 1px solid rgba(200, 155, 60, 0.25);
  border-radius: 16px;
  padding: 32px 28px 28px;
  width: 100%; max-width: 400px;
  text-align: center;
  color: #f4f4f5;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
  animation: hlSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes hlSlideUp {
  from { opacity: 0; transform: translateY(24px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.hl-modal-close {
  position: absolute; top: 10px; right: 14px;
  background: none; border: none; color: #6b6b75;
  font-size: 22px; cursor: pointer; padding: 6px 8px; line-height: 1;
  border-radius: 6px; transition: color 0.15s, background 0.15s;
}
.hl-modal-close:hover { color: #f4f4f5; background: rgba(255,255,255,0.06); }

.hl-modal-icon {
  width: 48px; height: 48px; margin: 0 auto 16px;
  border-radius: 12px; background: rgba(200, 155, 60, 0.12);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
}

.hl-modal-title {
  font-size: 20px; font-weight: 700; margin: 0 0 8px;
  color: #c89b3c; letter-spacing: -0.01em;
}
.hl-modal-desc {
  font-size: 14px; color: #9ca3af; margin: 0 0 20px; line-height: 1.6;
}

/* Input with validation */
.hl-modal-field { position: relative; margin-bottom: 4px; }
.hl-modal-input {
  width: 100%; padding: 10px 40px 10px 14px; border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px; font-size: 15px; background: #111116;
  color: #f4f4f5; box-sizing: border-box; margin-bottom: 2px;
  outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
.hl-modal-input:focus {
  border-color: #c89b3c;
  box-shadow: 0 0 0 3px rgba(200,155,60,0.12);
}
.hl-modal-input.hl-input-error {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239,68,68,0.1);
}

.hl-modal-input-status {
  position: absolute; right: 12px; top: 11px;
  font-size: 14px; pointer-events: none;
}
.hl-modal-input-status.is-valid   { color: #22c55e; }
.hl-modal-input-status.is-invalid { color: #ef4444; font-size: 12px; right: 12px; top: 4px; width: auto; white-space: nowrap; }

/* Spinner */
@keyframes hlSpin { to { transform: rotate(360deg); } }
.hl-spinner {
  display: inline-block; width: 16px; height: 16px; border: 2px solid rgba(0,0,0,0.2);
  border-top-color: #0c0c10; border-radius: 50%;
  animation: hlSpin 0.6s linear infinite;
  vertical-align: middle; margin-right: 6px;
}

/* Button */
.hl-modal-btn {
  width: 100%; padding: 11px; border: none; border-radius: 8px;
  font-size: 15px; font-weight: 600; cursor: pointer;
  background: #c89b3c; color: #0c0c10;
  transition: background 0.2s, transform 0.1s, opacity 0.2s;
  margin-top: 8px;
}
.hl-modal-btn:hover { background: #d4a84b; }
.hl-modal-btn:active { transform: scale(0.98); }
.hl-modal-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Success state */
.hl-modal-success {
  text-align: center; padding: 8px 0 0;
  animation: hlSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.hl-modal-success-check {
  width: 52px; height: 52px; margin: 0 auto 14px;
  border-radius: 50%; background: rgba(34,197,94,0.12);
  color: #22c55e; font-size: 28px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  animation: hlCheckPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes hlCheckPop {
  from { transform: scale(0); }
  to   { transform: scale(1); }
}
.hl-modal-success-text {
  font-size: 16px; font-weight: 600; color: #22c55e; margin-bottom: 12px;
}
.hl-modal-download-link {
  display: inline-block; padding: 8px 20px; border-radius: 8px;
  font-size: 14px; font-weight: 600; text-decoration: none;
  background: rgba(200,155,60,0.12); color: #c89b3c;
  border: 1px solid rgba(200,155,60,0.25);
  transition: background 0.2s;
}
.hl-modal-download-link:hover {
  background: rgba(200,155,60,0.2);
}

/* Error */
.hl-modal-error {
  color: #ef4444; font-size: 13px; margin-top: 8px;
  animation: hlFadeIn 0.2s ease;
}

/* Turnstile */
.hl-turnstile { margin-bottom: 12px; display: flex; justify-content: center; }

/* Mobile */
@media (max-width: 480px) {
  .hl-modal {
    padding: 24px 20px 20px;
    border-radius: 16px 16px 0 0;
    max-width: 100%;
    position: fixed; bottom: 0; left: 0; right: 0;
    animation: hlSlideUpMobile 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }
  @keyframes hlSlideUpMobile {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
  }
  .hl-overlay { align-items: flex-end; padding: 0; }
  .hl-modal-title { font-size: 18px; }
  .hl-modal-desc  { font-size: 13px; }
}

/* ═══════════════════════════════════════════════════
   Gate Templates — 4 visual presets
   ═══════════════════════════════════════════════════ */

/* minimal: white bg, subtle */
.hl-modal.tmpl-minimal {
  background: #fff; color: #334155; border-color: #e2e8f0;
}
.hl-modal.tmpl-minimal .hl-modal-title { color: #1e293b; }
.hl-modal.tmpl-minimal .hl-modal-desc { color: #64748b; }
.hl-modal.tmpl-minimal .hl-modal-input { background: #f8fafc; border-color: #e2e8f0; color: #334155; }
.hl-modal.tmpl-minimal .hl-modal-input:focus { border-color: #c89b3c; }
.hl-modal.tmpl-minimal .hl-modal-close { color: #94a3b8; }
.hl-modal.tmpl-minimal .hl-modal-close:hover { color: #1e293b; }

/* bold: large CTA, gradient */
.hl-modal.tmpl-bold .hl-modal-title { font-size: 24px; }
.hl-modal.tmpl-bold .hl-modal-btn {
  background: linear-gradient(135deg, #c89b3c, #e8b84d);
  font-size: 17px; padding: 14px; box-shadow: 0 4px 16px rgba(200,155,60,0.3);
}

/* image: with header image */
.hl-modal.tmpl-image .hl-modal-icon { display: none; }
.tmpl-image-header {
  width: calc(100% + 56px); margin: -32px -28px 16px;
  border-radius: 16px 16px 0 0; overflow: hidden;
}
.tmpl-image-header img { width: 100%; height: auto; display: block; }

/* Inline gate styles */
.hl-inline-gate {
  border: 1px solid rgba(200,155,60,0.2);
  border-radius: 12px; padding: 20px;
  background: #1a1a22; color: #f4f4f5;
  font-family: -apple-system, sans-serif; max-width: 500px; margin: 16px 0;
}
.hl-inline-title { font-size: 16px; font-weight: 700; margin-bottom: 12px; color: #c89b3c; }
.hl-inline-field { display: flex; gap: 8px; }
.hl-inline-input { flex: 1; padding: 10px; border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; background: #111116; color: #f4f4f5; font-size: 14px; }
.hl-inline-btn { padding: 10px 20px; border: none; border-radius: 8px; background: #c89b3c; color: #0c0c10; font-weight: 600; cursor: pointer; white-space: nowrap; }
.hl-inline-msg { margin-top: 8px; font-size: 13px; }

/* Banner gate */
.hl-banner-gate {
  position: fixed; top: 0; left: 0; right: 0; z-index: 99998;
  background: #1a1a22; border-bottom: 1px solid rgba(200,155,60,0.2);
  padding: 12px 16px; display: flex; align-items: center; gap: 12px;
  font-family: -apple-system, sans-serif; color: #f4f4f5;
}
.hl-banner-title { font-size: 14px; font-weight: 600; }
.hl-banner-field { display: flex; gap: 8px; margin-left: auto; }
.hl-banner-input { padding: 6px 10px; border: 1px solid rgba(255,255,255,0.1); border-radius: 6px; background: #111116; color: #f4f4f5; font-size: 13px; width: 180px; }
.hl-banner-btn { padding: 6px 14px; border: none; border-radius: 6px; background: #c89b3c; color: #0c0c10; font-weight: 600; cursor: pointer; font-size: 13px; }
.hl-banner-close { background: none; border: none; color: #6b6b75; font-size: 18px; cursor: pointer; }

/* Inline gate success state */
.hl-inline-gate.hl-success { border-color: rgba(16,185,129,0.25); }
.hl-inline-success {
  display: flex; align-items: center; gap: 8px; padding: 4px 0;
  font-size: 14px; color: #22c55e;
}
.hl-inline-download-link {
  margin-left: 4px; padding: 5px 14px; border-radius: 6px;
  font-size: 13px; font-weight: 600; text-decoration: none;
  background: rgba(200,155,60,0.12); color: #c89b3c;
  border: 1px solid rgba(200,155,60,0.25);
  transition: background 0.2s;
}
.hl-inline-download-link:hover { background: rgba(200,155,60,0.2); }

/* Two-step progress */
.hl-two-step-progress { height: 3px; background: rgba(255,255,255,0.08); border-radius: 2px; margin-bottom: 12px; }
.hl-two-step-progress-bar { height: 100%; background: #c89b3c; border-radius: 2px; transition: width 0.3s ease; }

/* Gate trigger button (modal open) */
.hl-gate-btn {
  display: inline-block; padding: 12px 32px; border: none; border-radius: 8px;
  font-size: 15px; font-weight: 600; cursor: pointer;
  background: linear-gradient(135deg, #c89b3c, #d4a84b);
  color: #0c0c10; letter-spacing: 0.02em;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 2px 8px rgba(200,155,60,0.2);
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.4; text-decoration: none;
}
.hl-gate-btn:hover {
  background: linear-gradient(135deg, #d4a84b, #e8b84d);
  box-shadow: 0 2px 6px rgba(0,0,0,0.15), 0 4px 16px rgba(200,155,60,0.35);
  transform: translateY(-1px);
}
.hl-gate-btn:active { transform: scale(0.98) translateY(0); }
.hl-gate-btn.tmpl-minimal { background: #fff; color: #334155; border: 1px solid #e2e8f0; }
.hl-gate-btn.tmpl-minimal:hover { background: #f8fafc; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.hl-gate-btn.tmpl-bold { font-size: 17px; padding: 14px 36px; background: linear-gradient(135deg, #c89b3c, #e8b84d); box-shadow: 0 4px 16px rgba(200,155,60,0.3); }
.hl-gate-btn.tmpl-image { padding-left: 48px; position: relative; }
.hl-gate-btn.tmpl-image::before { content: '📥'; position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 18px; }
