/* ================================================================
   KUPR Welcome CSS — Premium Crypto Auth Pages
   Login + Register — Dark Glassmorphism Design
   v1.0 — March 2026
   ================================================================ */

/* --- CSS Variables --- */
:root {
  --kw-bg:            #07070e;
  --kw-card:          rgba(11, 11, 24, 0.94);
  --kw-card-border:   rgba(255, 215, 0, 0.13);
  --kw-gold:          #ffd700;
  --kw-gold-alt:      #ffb700;
  --kw-gold-glow:     rgba(255, 215, 0, 0.18);
  --kw-gold-dim:      rgba(255, 215, 0, 0.08);
  --kw-text:          #eeeef8;
  --kw-text-muted:    rgba(190, 190, 220, 0.55);
  --kw-input-bg:      rgba(255, 255, 255, 0.04);
  --kw-input-border:  rgba(255, 255, 255, 0.09);
  --kw-error:         #ff4d6d;
  --kw-success:       #39d98a;
  --kw-ease:          cubic-bezier(0.4, 0, 0.2, 1);
  --kw-r:             16px;
  --kw-r-sm:          10px;
}

/* --- Hide WoWonder welcome header — we use our own branding --- */
#welcomeheader { display: none !important; }

/* ----------------------------------------------------------------
   Full-page background
   ---------------------------------------------------------------- */
.kw-page {
  min-height: 100vh;
  background: var(--kw-bg);
  background-image:
    radial-gradient(ellipse 80% 55% at 15% 5%,  rgba(90, 50, 200, 0.13) 0%, transparent 60%),
    radial-gradient(ellipse 60% 45% at 85% 95%, rgba(255, 180, 0, 0.07) 0%, transparent 55%);
  position: relative;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Subtle dot grid */
.kw-page::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.055) 1px, transparent 1px);
  background-size: 30px 30px;
  pointer-events: none;
  z-index: 0;
}

/* Glowing blurred orbs */
.kw-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
  animation: kwPulse 7s ease-in-out infinite alternate;
}
.kw-orb-1 {
  width: 500px; height: 500px;
  background: rgba(90, 40, 210, 0.18);
  top: -140px; left: -140px;
}
.kw-orb-2 {
  width: 450px; height: 450px;
  background: rgba(255, 160, 0, 0.07);
  bottom: -130px; right: -130px;
  animation-delay: 3.5s;
}
@keyframes kwPulse {
  from { transform: scale(1) translate(0, 0); }
  to   { transform: scale(1.18) translate(18px, -12px); }
}

/* ----------------------------------------------------------------
   Main wrapper — vertically/horizontally centered
   ---------------------------------------------------------------- */
.kw-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 460px;
  padding: 28px 16px 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: kwFadeIn 0.45s var(--kw-ease) both;
}
@keyframes kwFadeIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ----------------------------------------------------------------
   Brand / Logo area
   ---------------------------------------------------------------- */
.kw-brand {
  text-align: center;
  margin-bottom: 26px;
}
.kw-brand a { display: inline-block; text-decoration: none; }
.kw-brand-logo {
  height: 52px;
  width: auto;
  filter: drop-shadow(0 0 14px rgba(255, 215, 0, 0.28));
}
.kw-brand-tagline {
  display: block;
  font-size: 11px;
  color: var(--kw-text-muted);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-top: 10px;
}

/* ----------------------------------------------------------------
   Glassmorphism Card
   ---------------------------------------------------------------- */
.kw-card {
  width: 100%;
  background: var(--kw-card);
  border: 1px solid var(--kw-card-border);
  border-radius: 20px;
  padding: 36px 32px 28px;
  box-shadow:
    0 28px 72px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 215, 0, 0.07);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
}

.kw-card-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--kw-text);
  margin: 0 0 4px;
  font-family: 'Poppins', sans-serif;
}
.kw-card-sub {
  font-size: 13px;
  color: var(--kw-text-muted);
  margin: 0 0 24px;
}

/* ----------------------------------------------------------------
   Alert / Error
   ---------------------------------------------------------------- */
.kw-card .errors {
  border-radius: var(--kw-r-sm);
  margin-bottom: 16px;
  font-size: 13px;
  padding: 10px 14px;
  display: none;
  line-height: 1.5;
}
.kw-card .errors:not(:empty) { display: block; }

.kw-card .alert-danger {
  background: rgba(255, 77, 109, 0.12) !important;
  border: 1px solid rgba(255, 77, 109, 0.3) !important;
  color: #ff7090 !important;
}
.kw-card .alert-success {
  background: rgba(57, 217, 138, 0.12) !important;
  border: 1px solid rgba(57, 217, 138, 0.3) !important;
  color: #39d98a !important;
}

/* ----------------------------------------------------------------
   Floating-label input fields
   ---------------------------------------------------------------- */
.kw-field {
  position: relative;
  margin-bottom: 16px;
}

.kw-field input,
.kw-field select {
  width: 100%;
  box-sizing: border-box;
  padding: 22px 14px 8px;
  background: var(--kw-input-bg);
  border: 1px solid var(--kw-input-border);
  border-radius: var(--kw-r-sm);
  color: var(--kw-text);
  font-size: 14px;
  font-family: inherit;
  line-height: 1.4;
  outline: none;
  transition: border-color 0.2s var(--kw-ease), box-shadow 0.2s var(--kw-ease);
  -webkit-appearance: none;
  appearance: none;
}

/* Select chevron */
.kw-field select {
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23888899' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
}
.kw-field select option { background: #13132a; color: var(--kw-text); }

/* Floating label */
.kw-field label {
  position: absolute;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  color: var(--kw-text-muted);
  font-size: 13px;
  pointer-events: none;
  transition: all 0.18s var(--kw-ease);
  white-space: nowrap;
}

/* Label floated up: when focused or has content */
.kw-field input:focus ~ label,
.kw-field input:not(:placeholder-shown) ~ label,
.kw-field select:focus ~ label,
.kw-field select.has-val ~ label {
  top: 9px;
  transform: translateY(0);
  font-size: 10px;
  color: var(--kw-gold);
  letter-spacing: 0.04em;
}

/* Focus glow */
.kw-field input:focus,
.kw-field select:focus {
  border-color: rgba(255, 215, 0, 0.38);
  box-shadow: 0 0 0 3px var(--kw-gold-dim);
}

/* Password field with eye toggle */
.kw-field-pw input { padding-right: 44px; }

.kw-eye {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--kw-text-muted);
  line-height: 0;
  transition: color 0.18s;
}
.kw-eye:hover { color: var(--kw-gold); }
.kw-eye svg { width: 17px; height: 17px; }

/* ----------------------------------------------------------------
   Password complexity helper
   ---------------------------------------------------------------- */
.helper-text {
  list-style: none;
  padding: 0;
  margin: 5px 0 0;
  display: none;
}
.helper-text li {
  font-size: 11px;
  color: var(--kw-text-muted);
  padding: 2px 0;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
}
.helper-text li::before {
  content: '○';
  font-size: 9px;
  flex-shrink: 0;
  color: inherit;
}
.helper-text li.valid { color: var(--kw-success); }
.helper-text li.valid::before { content: '●'; }

/* ----------------------------------------------------------------
   Row split: remember + forgot
   ---------------------------------------------------------------- */
.kw-row-split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: -2px 0 18px;
}

.kw-remember {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
}
.kw-remember input[type=checkbox] {
  width: 14px; height: 14px;
  accent-color: var(--kw-gold);
  cursor: pointer;
}
.kw-remember span {
  font-size: 12px;
  color: var(--kw-text-muted);
}

.kw-forgot {
  font-size: 12px;
  color: var(--kw-text-muted);
  text-decoration: none;
  transition: color 0.18s;
}
.kw-forgot:hover { color: var(--kw-gold); }

/* ----------------------------------------------------------------
   Terms checkbox
   ---------------------------------------------------------------- */
.kw-terms {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-bottom: 20px;
}
.kw-terms input[type=checkbox] {
  width: 15px; height: 15px;
  margin-top: 2px;
  accent-color: var(--kw-gold);
  flex-shrink: 0;
  cursor: pointer;
}
.kw-terms label {
  font-size: 12px;
  color: var(--kw-text-muted);
  line-height: 1.55;
  cursor: pointer;
}
.kw-terms label a { color: var(--kw-gold); text-decoration: none; }
.kw-terms label a:hover { text-decoration: underline; }

/* ----------------------------------------------------------------
   Primary CTA button — gold gradient
   ---------------------------------------------------------------- */
.kw-btn-primary {
  display: block;
  width: 100%;
  padding: 14px 20px;
  background: linear-gradient(135deg, #ffd700 0%, #ffaa00 100%);
  color: #050505 !important;
  border: none;
  border-radius: var(--kw-r-sm);
  font-size: 15px;
  font-weight: 700;
  font-family: 'Poppins', sans-serif;
  letter-spacing: 0.025em;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: opacity 0.18s, transform 0.12s;
}
.kw-btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background 0.18s;
}
.kw-btn-primary:hover:not(:disabled)::after { background: rgba(255,255,255,0.1); }
.kw-btn-primary:active:not(:disabled) { transform: scale(0.985); }
.kw-btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }

/* WoWonder btn-loading state */
.kw-btn-primary.btn-loading { color: transparent !important; }
.kw-btn-primary.btn-loading::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 20px; height: 20px;
  border: 2.5px solid rgba(0,0,0,0.25);
  border-top-color: #000;
  border-radius: 50%;
  animation: kwSpin 0.7s linear infinite;
}
@keyframes kwSpin { to { transform: translate(-50%, -50%) rotate(360deg); } }

/* ----------------------------------------------------------------
   Divider
   ---------------------------------------------------------------- */
.kw-divider {
  position: relative;
  text-align: center;
  margin: 20px 0 16px;
}
.kw-divider::before {
  content: '';
  position: absolute;
  top: 50%; left: 0; right: 0;
  height: 1px;
  background: rgba(255,255,255,0.07);
}
.kw-divider span {
  position: relative;
  padding: 0 12px;
  background: var(--kw-card);
  /* fallback for non-backdrop-filter browsers */
  background: rgb(11,11,22);
  font-size: 11px;
  color: var(--kw-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

/* ----------------------------------------------------------------
   Social login icons — small circles in a row
   ---------------------------------------------------------------- */
.kw-social-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 4px;
}

.kw-social-btn {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  padding: 0 !important;
  border-radius: 50% !important;
  background: rgba(255,255,255,0.06) !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  overflow: hidden !important;
  text-decoration: none !important;
  transition: transform 0.15s, box-shadow 0.15s !important;
  box-sizing: border-box !important;
}
.kw-social-btn:hover {
  transform: translateY(-2px) scale(1.05) !important;
  box-shadow: 0 5px 14px rgba(0,0,0,0.35) !important;
}
.kw-social-btn svg {
  width: 20px !important;
  height: 20px !important;
  flex-shrink: 0 !important;
}

/* Google One Tap */
#buttonDiv { display: flex; justify-content: center; margin-top: 10px; }

/* ----------------------------------------------------------------
   Switch link (Login ↔ Register)
   ---------------------------------------------------------------- */
.kw-switch {
  text-align: center;
  margin: 18px 0 4px;
  font-size: 13px;
  color: var(--kw-text-muted);
}
.kw-switch a {
  color: var(--kw-gold);
  text-decoration: none;
  font-weight: 600;
}
.kw-switch a:hover { text-decoration: underline; }

/* ----------------------------------------------------------------
   App download badges
   ---------------------------------------------------------------- */
.kw-apps {
  text-align: center;
  margin-top: 16px;
}
.kw-apps p {
  font-size: 12px;
  color: var(--kw-text-muted);
  margin: 0 0 8px;
}
.kw-apps a { display: inline-block; margin: 0 4px; }
.kw-apps img { height: 30px; width: auto; opacity: 0.75; transition: opacity 0.15s; }
.kw-apps img:hover { opacity: 1; }

/* ----------------------------------------------------------------
   Footer
   ---------------------------------------------------------------- */
.kw-footer-wrap {
  width: 100%;
  margin-top: 22px;
}
.welcome-footer {
  text-align: center !important;
  font-size: 11px !important;
  color: rgba(150, 150, 180, 0.45) !important;
  line-height: 2 !important;
}
.welcome-footer a {
  color: rgba(170, 170, 200, 0.5) !important;
  text-decoration: none !important;
}
.welcome-footer a:hover { color: var(--kw-gold) !important; }
.welcome-footer .lang a { color: rgba(170,170,200,0.5) !important; }

/* ----------------------------------------------------------------
   Hide/neutralise legacy WoWonder welcome elements
   ---------------------------------------------------------------- */
.kw-page .login_left_combo_parent { display: none !important; }
.kw-page .random_users             { display: none !important; }
.kw-page > .login                  { background: transparent !important; }

/* Suppress WoWonder's welcome page body styles leaking */
body.page-welcome .login { all: unset; }

/* ----------------------------------------------------------------
   Autofill styling (Chrome/Safari)
   ---------------------------------------------------------------- */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 40px rgba(11, 11, 30, 0.99) inset !important;
  -webkit-text-fill-color: var(--kw-text) !important;
  caret-color: var(--kw-text);
  transition: background-color 9999s ease;
}

/* ----------------------------------------------------------------
   Mobile responsive
   ---------------------------------------------------------------- */
@media (max-width: 480px) {
  .kw-wrapper {
    padding: 18px 12px 36px;
  }
  .kw-card {
    padding: 28px 18px 22px;
    border-radius: 16px;
  }
  .kw-brand-logo { height: 44px; }
  .kw-orb { display: none; }

  /* Tighter field spacing on small screens */
  .kw-field { margin-bottom: 13px; }
}

@media (max-width: 360px) {
  .kw-card { padding: 22px 14px 18px; }
  .kw-card-title { font-size: 19px; }
}
