/* =====================================================================
   Reusable opt-in popup (free Discord + premium / trading course)
   Used on login, landing, and anywhere the [data-optin-open] buttons live.
   ===================================================================== */

/* Lock scroll on the body (the scroll container) so its scrollbar-gutter:stable
   keeps the gutter reserved and the page doesn't shift when the popup opens. */
body.optin-locked{ overflow: hidden; }

.optin-modal{
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000000;
  background: rgba(0,0,0,.85);
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
}
.optin-modal.active{ display: flex; }

.optin-card{
  position: relative;
  width: 470px;
  max-width: 100%;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: #0d0d0f;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 16px;
  box-shadow: 0 20px 80px rgba(0,0,0,.6);
  padding: 36px 32px 30px;
  box-sizing: border-box;
}

.optin-close{
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.08);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  transition: background .15s;
}
.optin-close:hover{ background: rgba(255,255,255,.18); }

.optin-form{
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  text-align: left;
}
.optin-head{ text-align: center; margin-bottom: 4px; }
.optin-title{ font-size: 21px; font-weight: 800; color: #fff; margin: 0 0 6px; line-height: 1.3; }
.optin-sub{ font-size: 13.5px; color: rgba(255,255,255,.55); margin: 0; line-height: 1.5; }

.optin-field{ display: flex; flex-direction: column; gap: 6px; }
.optin-label{ font-size: 13px; font-weight: 600; color: rgba(255,255,255,.82); }
.optin-req{ color: #ff5147; }

.optin-input{
  width: 100%;
  padding: 13px 15px;
  font-size: 15px;
  color: #fff;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 12px;
  outline: none;
  box-sizing: border-box;
  transition: border-color .15s, background .15s;
}
.optin-input::placeholder{ color: rgba(255,255,255,.38); }
.optin-input:focus{ border-color: rgba(255,81,71,.65); background: rgba(255,255,255,.08); }

.optin-phone-row{ display: flex; gap: 8px; }
.optin-phone-num{ flex: 1; min-width: 0; }

.optin-err{ color: #ff6b6b; font-size: 12px; margin: 2px 0 0; display: none; }

.optin-submit{
  margin-top: 6px;
  width: 100%;
  padding: 15px;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  border: none;
  border-radius: 12px;
  background: linear-gradient(180deg, #ff5147 0%, #e0332a 100%);
  cursor: pointer;
  transition: opacity .15s, transform .1s;
}
.optin-submit:hover{ opacity: .92; }
.optin-submit:active{ transform: scale(.98); }
.optin-submit:disabled{ opacity: .6; cursor: default; }

/* Free Discord variant uses the Discord blurple for its button */
.optin-modal--free .optin-submit{ background: linear-gradient(180deg, #5865F2 0%, #4752c4 100%); }

.optin-legal{ font-size: 11px; color: rgba(255,255,255,.4); text-align: center; margin: 4px 0 0; line-height: 1.5; }
.optin-legal a{ color: rgba(255,255,255,.6); text-decoration: underline; }

@media (max-width: 600px){
  .optin-card{ width: 100%; max-height: calc(100vh - 24px); padding: 32px 22px 26px; }
}
