/* ╔══════════════════════════════════════════════════╗
   ║  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; }
}
