/**
 * GoTalentia Purchase Guard — modal styles.
 *
 * Uses a fixed overlay + centered card approach.
 * z-index 9999 to float above Elementor / WooCommerce widgets.
 */

/* ------------------------------------------------------------------ */
/* Overlay / body lock                                                 */
/* ------------------------------------------------------------------ */

#gt-guard-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

#gt-guard-overlay.gt-guard-open {
  display: flex;
}

body.gt-guard-body-lock {
  overflow: hidden;
}

/* ------------------------------------------------------------------ */
/* Card                                                                */
/* ------------------------------------------------------------------ */

#gt-guard-card {
  position: relative;
  background: #ffffff;
  border-radius: 12px;
  padding: 32px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
  animation: gt-guard-slide-in 0.18s ease-out;
}

@keyframes gt-guard-slide-in {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ------------------------------------------------------------------ */
/* Close button (X)                                                    */
/* ------------------------------------------------------------------ */

.gt-guard-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: #6b7280;
  padding: 4px 6px;
  border-radius: 4px;
  transition:
    color 0.15s,
    background 0.15s;
}

.gt-guard-close:hover {
  color: #111827;
  background: #f3f4f6;
}

/* ------------------------------------------------------------------ */
/* Typography                                                          */
/* ------------------------------------------------------------------ */

.gt-guard-title {
  margin: 0 0 8px 0;
  font-size: 20px;
  font-weight: 700;
  color: #111827;
  line-height: 1.3;
}

.gt-guard-copy {
  margin: 0 0 20px 0;
  font-size: 15px;
  color: #374151;
  line-height: 1.55;
}

/* ------------------------------------------------------------------ */
/* Form row + input                                                    */
/* ------------------------------------------------------------------ */

.gt-guard-form-row {
  margin-bottom: 20px;
}

.gt-guard-input {
  display: block;
  width: 100%;
  padding: 10px 14px;
  font-size: 15px;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  outline: none;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
  box-sizing: border-box;
  color: #111827;
  background: #fff;
}

.gt-guard-input:focus {
  border-color: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
}

/* ------------------------------------------------------------------ */
/* Action buttons                                                      */
/* ------------------------------------------------------------------ */

.gt-guard-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.gt-guard-btn-primary,
.gt-guard-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 22px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition:
    background 0.15s,
    border-color 0.15s,
    color 0.15s;
  border: 2px solid transparent;
  white-space: nowrap;
  line-height: 1.3;
}

.gt-guard-btn-primary {
  background: #16a34a;
  color: #ffffff;
  border-color: #16a34a;
}

.gt-guard-btn-primary:hover,
.gt-guard-btn-primary:focus {
  background: #15803d;
  border-color: #15803d;
  color: #ffffff;
  text-decoration: none;
}

.gt-guard-btn-secondary {
  background: transparent;
  color: #374151;
  border-color: #d1d5db;
}

.gt-guard-btn-secondary:hover,
.gt-guard-btn-secondary:focus {
  background: #f9fafb;
  border-color: #9ca3af;
  color: #111827;
  text-decoration: none;
}

/* ------------------------------------------------------------------ */
/* Error message                                                       */
/* ------------------------------------------------------------------ */

.gt-guard-error-msg {
  color: #dc2626;
  font-size: 14px;
  margin: -8px 0 16px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.gt-guard-error-msg::before {
  content: "✕";
  display: inline-block;
  font-weight: 700;
  font-size: 12px;
}

/* ------------------------------------------------------------------ */
/* Loading state                                                       */
/* ------------------------------------------------------------------ */

.gt-guard-loading {
  text-align: center;
  padding: 16px 0 8px;
}

.gt-guard-loading p {
  margin: 12px 0 0;
  font-size: 15px;
  color: #374151;
}

.gt-guard-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #e5e7eb;
  border-top-color: #16a34a;
  border-radius: 50%;
  animation: gt-guard-spin 0.7s linear infinite;
  margin: 0 auto;
}

@keyframes gt-guard-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ------------------------------------------------------------------ */
/* Success state                                                       */
/* ------------------------------------------------------------------ */

.gt-guard-success {
  text-align: center;
  padding: 8px 0;
}

.gt-guard-success p {
  margin: 10px 0 0;
  font-size: 15px;
  color: #374151;
}

.gt-guard-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  margin: 0 auto;
}

.gt-guard-icon-ok {
  background: #dcfce7;
  color: #16a34a;
}

/* ------------------------------------------------------------------ */
/* Responsive                                                          */
/* ------------------------------------------------------------------ */

@media (max-width: 540px) {
  #gt-guard-card {
    padding: 24px 20px;
    border-radius: 10px;
    max-width: 90vw;
  }

  .gt-guard-title {
    font-size: 18px;
    padding-right: 24px; /* make room for X button */
  }

  .gt-guard-actions {
    flex-direction: column;
  }

  .gt-guard-btn-primary,
  .gt-guard-btn-secondary {
    width: 100%;
    text-align: center;
  }
}
