/**
 * Bestqash brand system — logo-aligned navy → cobalt + mint
 * Loaded site-wide via functions.php head injection.
 */
:root {
  --me-navy: #0a1b3d;
  --me-navy-2: #122852;
  --me-blue: #0b5fff;
  --me-blue-deep: #0947cc;
  --me-sky: #3b9bff;
  --me-mint: #00e8a0;
  --me-mint-dark: #00b87c;
  --me-ink: #0b1220;
  --me-muted: #5b6b86;
  --me-line: #d8e2f0;
  --me-surface: #f0f4fa;
  --me-white: #ffffff;
  --me-grad: linear-gradient(135deg, #0a1b3d 0%, #0b5fff 55%, #3b9bff 100%);
  --me-grad-btn: linear-gradient(135deg, #0b5fff 0%, #0947cc 100%);
  --me-grad-mint: linear-gradient(135deg, #00e8a0 0%, #00b87c 100%);
  --me-shadow: 0 12px 40px rgba(10, 27, 61, 0.12);
  --me-radius: 14px;
  --me-font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --me-display: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  /* Bridge legacy page variables to Bestqash */
  --primary-color: #0b5fff;
  --secondary-color: #122852;
  --accent-color: #00e8a0;
  --success-color: #00b87c;
  --light-bg: #f0f4fa;
  --border-color: #d8e2f0;
  --text-muted: #5b6b86;
  --primary-gradient: linear-gradient(135deg, #0a1b3d 0%, #0b5fff 55%, #3b9bff 100%);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--me-font);
  color: var(--me-ink);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .me-display {
  font-family: var(--me-display);
  letter-spacing: -0.02em;
}

/* Shared chrome */
.mobile-header {
  background: var(--me-grad) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 24px rgba(10, 27, 61, 0.25) !important;
}

.sidebar {
  background: linear-gradient(180deg, var(--me-navy) 0%, #0d2248 100%) !important;
}

.sidebar .brand {
  color: #fff !important;
}

.sidebar a:hover,
.sidebar button:hover,
.sidebar a.active,
.sidebar .active > a {
  background: rgba(11, 95, 255, 0.28) !important;
  color: var(--me-mint) !important;
}

.sidebar a:hover i,
.sidebar a.active i {
  color: var(--me-mint) !important;
}

.footer a {
  color: var(--me-blue) !important;
}

/* Primary buttons — catch Bootstrap + custom */
.btn-primary,
button.btn-primary,
a.btn-primary {
  background: var(--me-grad-btn) !important;
  border-color: transparent !important;
  border-radius: 10px;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: 0 8px 20px rgba(11, 95, 255, 0.28);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btn-primary:hover,
button.btn-primary:hover,
a.btn-primary:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(11, 95, 255, 0.35);
  background: var(--me-grad-btn) !important;
  border-color: transparent !important;
}

.btn-primary:focus,
.btn-primary:active {
  background: var(--me-blue-deep) !important;
  border-color: transparent !important;
  box-shadow: 0 0 0 3px rgba(11, 95, 255, 0.25) !important;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--me-blue) !important;
  box-shadow: 0 0 0 3px rgba(11, 95, 255, 0.15) !important;
}

.form-check-input:checked {
  background-color: var(--me-blue) !important;
  border-color: var(--me-blue) !important;
}

a:not(.btn):not(.nav-link):not(.dropdown-item) {
  /* leave page-specific link colors alone by default */
}

.text-primary {
  color: var(--me-blue) !important;
}

.bg-primary {
  background-color: var(--me-blue) !important;
}

/* Subtle page atmosphere for auth-style containers */
.form-container,
.auth-card,
.login-card {
  border: 1px solid rgba(11, 95, 255, 0.08);
  box-shadow: var(--me-shadow) !important;
  border-radius: var(--me-radius) !important;
}

/* Welcome / alert banners often hard-coded blue */
.welcome-banner-force-align,
.alert-primary {
  background: var(--me-grad) !important;
  border: none !important;
}

/* Soft mint success pulse for earned amounts */
.me-earn,
.earnings-highlight,
.balance-highlight {
  color: var(--me-mint-dark);
}

@keyframes meRise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.me-rise {
  animation: meRise 0.55s ease both;
}

/* Marketing / nav brand lockup */
.navbar-brand {
  font-family: var(--me-display) !important;
  font-weight: 800 !important;
  background: var(--me-grad) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
}
.navbar-brand img {
  -webkit-text-fill-color: initial;
}

/* Payment / activation brand name */
.site-name,
.cm-brand-row .site-name {
  color: var(--me-blue) !important;
  font-family: var(--me-display) !important;
  font-weight: 800 !important;
}

/* ========== Auth pages — login, register, password reset ========== */
body.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding: max(1rem, env(safe-area-inset-top, 0px))
           max(1rem, env(safe-area-inset-right, 0px))
           max(1rem, env(safe-area-inset-bottom, 0px))
           max(1rem, env(safe-area-inset-left, 0px));
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  box-sizing: border-box;
  font-family: 'Outfit', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(11, 95, 255, 0.28), transparent 55%),
    radial-gradient(900px 500px at 100% 10%, rgba(0, 232, 160, 0.18), transparent 50%),
    linear-gradient(165deg, #0a1b3d 0%, #122852 42%, #f0f4fa 42.1%, #f0f4fa 100%);
}

body.auth-page .form-container {
  width: 100%;
  max-width: 450px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(10, 27, 61, 0.18);
  padding: 2rem 2.5rem;
  border: 1px solid rgba(11, 95, 255, 0.1);
  box-sizing: border-box;
  animation: meRise 0.55s ease both;
}

body.auth-page.auth-register .form-container {
  max-width: 550px;
}

body.auth-page .brand-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 1rem;
}

body.auth-page .brand-logo img {
  height: 40px;
  max-width: 100%;
}

body.auth-page .brand-logo span {
  font-family: 'Syne', 'Outfit', system-ui, sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--me-navy);
}

body.auth-page .form-container h2 {
  font-family: 'Syne', 'Outfit', system-ui, sans-serif;
  color: var(--me-blue);
  font-weight: 700;
  font-size: 1.5rem;
}

body.auth-page .auth-row-split {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

body.auth-page .input-group {
  flex-wrap: nowrap;
}

body.auth-page .input-group > .form-control {
  min-width: 0;
}

body.auth-page .select2-container {
  width: 100% !important;
  max-width: 100%;
}

body.auth-page #country_code {
  max-width: 6.5rem;
  flex: 0 0 auto;
  font-size: 0.9rem;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

body.auth-page .form-control,
body.auth-page .form-select,
body.auth-page .btn {
  font-size: 1rem;
}

@media (max-width: 768px) {
  body.auth-page {
    align-items: flex-start;
    padding-top: 1rem;
    padding-bottom: 1rem;
    background:
      radial-gradient(700px 360px at 50% -5%, rgba(11, 95, 255, 0.22), transparent 62%),
      linear-gradient(180deg, #0a1b3d 0%, #122852 14%, #f0f4fa 14%, #f0f4fa 100%);
  }

  body.auth-page .form-container {
    padding: 1.5rem 1.25rem;
    border-radius: 14px;
  }

  body.auth-page .brand-logo span {
    font-size: 1.45rem;
  }

  body.auth-page .form-container h2 {
    font-size: 1.3rem;
  }
}

@media (max-width: 576px) {
  body.auth-page .form-container {
    padding: 1.25rem 1rem;
  }

  body.auth-page .auth-row-split {
    flex-direction: column;
    align-items: stretch !important;
  }

  body.auth-page .auth-row-split a {
    align-self: flex-start;
    font-size: 0.95rem;
  }

  body.auth-page #country_code {
    max-width: 5.5rem;
    font-size: 0.82rem;
  }

  body.auth-page .input-group-text {
    padding-left: 0.65rem;
    padding-right: 0.65rem;
  }

  body.auth-page .btn-primary {
    padding: 0.7rem 1rem;
    min-height: 48px;
  }
}

@media (max-width: 380px) {
  body.auth-page {
    padding-left: 0.65rem;
    padding-right: 0.65rem;
  }

  body.auth-page .form-container {
    padding: 1.1rem 0.85rem;
  }

  body.auth-page .brand-logo img {
    height: 34px;
  }

  body.auth-page .brand-logo span {
    font-size: 1.25rem;
  }
}