/* Payges — Custom Checkout Modal
   Matches the site's dark premium aesthetic.
   Colors and fonts pulled from the main theme variables.
*/

/* ── Overlay ── */
#payges-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5,6,8,.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
  padding: 20px;
}
#payges-modal-overlay.pg-open {
  opacity: 1;
  pointer-events: all;
}
body.pg-modal-open {
  overflow: hidden;
}

/* ── Modal container ── */
#payges-modal {
  position: relative;
  background: #111318;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 20px;
  width: 100%;
  max-width: 860px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 40px 120px rgba(0,0,0,.7), 0 0 0 1px rgba(255,255,255,.04) inset;
  animation: pg-modal-in .3s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes pg-modal-in {
  from { transform: scale(.94) translateY(12px); opacity: 0; }
  to   { transform: scale(1)   translateY(0);    opacity: 1; }
}

/* ── Close button ── */
#payges-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: rgba(255,255,255,.5);
  transition: background .2s, color .2s;
  z-index: 10;
  padding: 0;
}
#payges-modal-close:hover {
  background: rgba(255,255,255,.12);
  color: #fff;
}

/* ── Split layout ── */
#payges-modal-inner {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 520px;
}

/* ── LEFT: Plan summary ── */
#payges-modal-left {
  background: linear-gradient(160deg, #0d1620 0%, #0a1218 100%);
  border-radius: 20px 0 0 20px;
  border-right: 1px solid rgba(255,255,255,.07);
  padding: 36px 28px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.pg-modal-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
}
.pg-modal-logo span {
  font-family: 'Figtree', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -.3px;
}
.pg-modal-plan-name {
  font-family: 'Figtree', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #4AACF7;
  margin-bottom: 8px;
}
.pg-modal-price {
  font-family: 'Figtree', sans-serif;
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -.5px;
  margin-bottom: 6px;
  line-height: 1.1;
}
.pg-modal-price span {
  font-size: 15px;
  font-weight: 400;
  color: rgba(255,255,255,.45);
}
.pg-modal-trial {
  font-size: 12.5px;
  color: #00C2A8;
  font-weight: 500;
  margin-bottom: 28px;
  line-height: 1.5;
}
.pg-modal-perks {
  list-style: none;
  padding: 0;
  margin: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pg-modal-perks li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: rgba(255,255,255,.65);
  font-family: 'Figtree', sans-serif;
}
.pg-modal-perks li svg {
  flex-shrink: 0;
}
.pg-modal-secure {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: rgba(255,255,255,.3);
  margin-top: 28px;
  font-family: 'Figtree', sans-serif;
}

/* ── RIGHT: Payment form ── */
#payges-modal-right {
  padding: 40px 40px 36px;
  display: flex;
  flex-direction: column;
}
.pg-modal-heading {
  font-family: 'Figtree', sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -.4px;
  margin: 0 0 6px;
}
.pg-modal-subhead {
  font-size: 14px;
  color: rgba(255,255,255,.45);
  margin: 0 0 28px;
  font-family: 'Figtree', sans-serif;
}

/* ── Form fields ── */
.pg-field-group {
  margin-bottom: 18px;
}
.pg-field-group label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: rgba(255,255,255,.55);
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: 8px;
  font-family: 'Figtree', sans-serif;
}
.pg-field-group input[type="text"],
.pg-field-group input[type="email"],
.pg-field-group input[type="password"] {
  width: 100%;
  background: rgba(255,255,255,.05);
  border: 1.5px solid rgba(255,255,255,.1);
  border-radius: 10px;
  padding: 13px 16px;
  font-size: 15px;
  color: #F5F5F7;
  font-family: 'Figtree', sans-serif;
  transition: border-color .2s, background .2s;
  outline: none;
  box-sizing: border-box;
  -webkit-appearance: none;
}
.pg-field-group input[type="text"]::placeholder,
.pg-field-group input[type="email"]::placeholder,
.pg-field-group input[type="password"]::placeholder {
  color: rgba(255,255,255,.25);
}
.pg-field-group input[type="text"]:focus,
.pg-field-group input[type="email"]:focus,
.pg-field-group input[type="password"]:focus {
  border-color: rgba(74,172,247,.6);
  background: rgba(74,172,247,.05);
}
.pg-field-hint {
  font-size: 11.5px;
  color: rgba(255,255,255,.35);
  margin-top: 6px;
  font-family: 'Figtree', sans-serif;
}

/* Stripe Card Element wrapper */
#pg-card-element {
  background: rgba(255,255,255,.05);
  border: 1.5px solid rgba(255,255,255,.1);
  border-radius: 10px;
  padding: 14px 16px;
  transition: border-color .2s, background .2s;
}
#pg-card-element.StripeElement--focus {
  border-color: rgba(74,172,247,.6);
  background: rgba(74,172,247,.05);
}
#pg-card-element.StripeElement--invalid {
  border-color: rgba(255,85,85,.5);
}

/* ── Error messages ── */
.pg-field-error {
  font-size: 12.5px;
  color: #FF5555;
  margin-top: 6px;
  font-family: 'Figtree', sans-serif;
  display: none;
}
.pg-field-error:not(:empty) { display: block; }

/* ── Submit button ── */
#pg-submit-area {
  margin-top: 22px;
}
#pg-submit-btn {
  width: 100%;
  background: linear-gradient(135deg, #4AACF7 0%, #2176BE 100%);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 15px 24px;
  font-family: 'Figtree', sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity .2s, transform .1s;
  letter-spacing: .01em;
  position: relative;
  overflow: hidden;
}
#pg-submit-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.15) 0%, transparent 60%);
  pointer-events: none;
}
#pg-submit-btn:hover:not(:disabled) {
  opacity: .92;
  transform: translateY(-1px);
}
#pg-submit-btn:active:not(:disabled) {
  transform: translateY(0);
}
#pg-submit-btn:disabled,
#pg-submit-btn.pg-loading {
  opacity: .65;
  cursor: not-allowed;
  transform: none;
}

/* ── Legal text ── */
.pg-modal-legal {
  font-size: 11.5px;
  color: rgba(255,255,255,.28);
  text-align: center;
  margin: 14px 0 0;
  line-height: 1.6;
  font-family: 'Figtree', sans-serif;
}
.pg-modal-legal a {
  color: rgba(255,255,255,.4);
  text-decoration: underline;
}
.pg-modal-legal a:hover { color: rgba(255,255,255,.65); }

/* ── Success state ── */
#payges-form-success {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px 0;
}
.pg-success-icon { margin-bottom: 20px; }
.pg-success-title {
  font-family: 'Figtree', sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  margin: 0 0 10px;
}
.pg-success-msg {
  font-size: 14px;
  color: rgba(255,255,255,.55);
  margin: 0;
  font-family: 'Figtree', sans-serif;
}

/* ── Responsive ── */
@media (max-width: 680px) {
  #payges-modal-inner {
    grid-template-columns: 1fr;
  }
  #payges-modal-left {
    border-radius: 20px 20px 0 0;
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,.07);
    padding: 28px 24px 24px;
  }
  #payges-modal-left .pg-modal-perks,
  #payges-modal-left .pg-modal-secure { display: none; }
  #payges-modal-right { padding: 28px 24px 24px; }
  .pg-modal-heading { font-size: 20px; }
  #payges-modal { max-height: 92vh; }
}
@media (max-width: 400px) {
  #payges-modal-right { padding: 24px 18px 20px; }
}
