/* ==========================================================================
   HACKERA REWARDS - rewards.css
   App pages only: login, dashboard, tables, legal pages.
   Load AFTER style.css. The landing pages (EN/BG) do not need this file.
   Header, footer, language switcher and buttons live in style.css.
   ========================================================================== */

/* ---------- 1. Tokens (aliases keep existing page markup working) ---------- */

:root {
  --bk-orange: var(--orange);
  --bk-orange-deep: #e03e00;
  --bk-orange-soft: rgba(255, 90, 31, 0.16);

  --bk-bg: #0b0b0c;
  --bk-surface: rgba(255, 255, 255, 0.04);
  --bk-surface-hover: rgba(255, 255, 255, 0.07);
  --bk-border: rgba(255, 255, 255, 0.12);

  --bk-text: #fff;
  --bk-text-muted: rgba(255, 255, 255, 0.6);
  --bk-text-subtle: rgba(255, 255, 255, 0.4);

  --bk-success: #34d399;
  --bk-warning: #fbbf24;
  --bk-danger: #f87171;
  --bk-info: #60a5fa;

  --bk-radius-md: 12px;
  --bk-radius-lg: 16px;
  --bk-radius-xl: 20px;
  --bk-radius-2xl: 24px;

  --bk-shadow-panel: 0 30px 60px rgba(0, 0, 0, 0.45);
  --bk-ease: 0.2s ease;
  --bk-focus-ring: 0 0 0 3px rgba(255, 90, 31, 0.3);
}

/* ---------- 2. Page shell and glow ---------- */

.bk-page {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.bk-glow {
  position: relative;
  isolation: isolate;
}

.bk-glow::before,
.bk-glow::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(70px);
}

.bk-glow::before {
  top: -160px;
  right: -120px;
  width: min(520px, 80vw);
  height: min(520px, 80vw);
  background: radial-gradient(closest-side, rgba(255, 90, 31, 0.28), transparent);
}

.bk-glow::after {
  bottom: -140px;
  left: -120px;
  width: min(420px, 70vw);
  height: min(420px, 70vw);
  background: radial-gradient(closest-side, rgba(224, 62, 0, 0.18), transparent);
}

/* ---------- 3. Buttons ---------- */

.bk-btn-full { width: 100%; }

.bk-btn-sm {
  padding: 9px 16px !important;
  font-size: 12px !important;
}

.bk-btn-danger {
  color: #ff7a45;
  background: rgba(217, 67, 12, 0.2);
  border: 1px solid rgba(217, 67, 12, 0.4);
}

.bk-btn-danger:hover { background: rgba(217, 67, 12, 0.32); }

/* ---------- 4. Login ---------- */

.bk-login {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: calc(100vh - 62px);
  min-height: calc(100svh - 62px);
}

.bk-login-brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 40px 20px 20px;
}

.bk-login-brand .hk-h1 { font-size: clamp(2rem, 4.2vw, 3.2rem); }

.bk-login-brand .hk-h1 em {
  font-style: normal;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.bk-login-form {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 20px 16px 40px;
}

.bk-panel {
  width: 100%;
  max-width: 420px;
  min-width: 0;
  padding: 24px 20px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: var(--bk-shadow-panel);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.bk-panel h2 {
  margin: 16px 0 6px;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.bk-panel > p {
  margin: 0 0 24px;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--bk-text-muted);
}

.bk-feats {
  display: grid;
  gap: 12px;
  max-width: 34rem;
  margin-top: 24px;
}

.bk-feat {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--bk-border);
  border-radius: var(--bk-radius-lg);
  background: var(--bk-surface);
  transition: border-color var(--bk-ease), transform var(--bk-ease), background-color var(--bk-ease);
}

.bk-feat .hk-icon {
  background: var(--bk-orange-soft);
  color: var(--bk-orange);
}

.bk-feat b {
  display: block;
  font-size: 0.92rem;
}

.bk-feat span {
  font-size: 0.8rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.65);
}

/* ---------- 5. Form controls ---------- */

.bk-label {
  display: block;
  margin-bottom: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
}

.bk-input-wrap {
  position: relative;
  min-width: 0;
}

.bk-input,
.bk-search {
  min-width: 0;
  color: #fff;
  font-size: 16px; /* prevents iOS zoom on focus */
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.16);
  transition: border-color var(--bk-ease), box-shadow var(--bk-ease), background-color var(--bk-ease);
}

.bk-input {
  display: block;
  width: 100%;
  min-height: 46px;
  padding: 13px 14px;
  border-radius: var(--bk-radius-md);
}

.bk-input-wrap:has(.bk-eye) .bk-input { padding-right: 44px; }

.bk-input::placeholder,
.bk-search::placeholder {
  color: rgba(255, 255, 255, 0.45);
  opacity: 1;
}

.bk-input:hover { border-color: rgba(255, 255, 255, 0.28); }

.bk-input:focus,
.bk-search:focus {
  outline: 0;
  border-color: var(--bk-orange);
  box-shadow: var(--bk-focus-ring);
}

.bk-input[aria-invalid="true"],
.bk-input.is-invalid {
  border-color: var(--bk-danger);
  box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.12);
}

.bk-eye {
  position: absolute;
  top: 50%;
  right: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.7);
  font-size: 15px;
  transform: translateY(-50%);
}

.bk-eye:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

/* ---------- 6. Feedback messages ---------- */

.bk-error,
.bk-success,
.bk-warning,
.bk-info,
.bk-message {
  padding: 12px 14px;
  border: 1px solid var(--bk-border);
  border-radius: var(--bk-radius-md);
  font-size: 0.84rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.bk-error {
  display: none;
  color: #ff9a7a;
  background: rgba(217, 67, 12, 0.15);
  border-color: rgba(217, 67, 12, 0.35);
  text-align: center;
}

.bk-error.show {
  display: block;
  animation: bkShake 0.35s;
}

.bk-success { color: #6ee7b7; background: rgba(52, 211, 153, 0.1); border-color: rgba(52, 211, 153, 0.3); }
.bk-warning { color: #fcd34d; background: rgba(251, 191, 36, 0.1); border-color: rgba(251, 191, 36, 0.3); }
.bk-info    { color: #93c5fd; background: rgba(96, 165, 250, 0.1); border-color: rgba(96, 165, 250, 0.3); }
.bk-message { color: rgba(255, 255, 255, 0.85); background: rgba(255, 255, 255, 0.05); }

@keyframes bkShake {
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.bk-foot-note {
  margin-top: 20px;
  text-align: center;
  font: 11px/1.6 var(--font-mono);
  color: var(--bk-text-subtle);
}

/* ---------- 7. Loading states ---------- */

.bk-spin {
  display: inline-block;
  vertical-align: middle;
}

.bk-spin.go { animation: bkSpin 0.8s linear infinite; }

@keyframes bkSpin {
  to { transform: rotate(360deg); }
}

.bk-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.bk-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: var(--bk-orange);
  border-radius: 50%;
  animation: bkSpin 0.7s linear infinite;
}

.bk-skeleton {
  min-height: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 25%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.04) 75%);
  background-size: 200% 100%;
  animation: bkSkeleton 1.5s ease-in-out infinite;
}

@keyframes bkSkeleton {
  to { background-position: -200% 0; }
}

/* ---------- 8. Dashboard ---------- */

.bk-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.bk-top .hk-title {
  margin-top: 12px;
  color: #fff;
}

.bk-live-dot {
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bk-success);
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6);
  animation: bkPulse 2s infinite;
}

@keyframes bkPulse {
  70%  { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

.bk-updated {
  font: 11.5px var(--font-mono);
  color: var(--bk-text-subtle);
}

.bk-stats,
.bk-channels {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.bk-stat {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--bk-border);
  border-radius: var(--bk-radius-xl);
  background: var(--bk-surface);
  transition: border-color var(--bk-ease), transform var(--bk-ease), background-color var(--bk-ease);
}

.bk-stat small {
  display: block;
  margin-top: 10px;
  font-size: 12px;
  color: var(--bk-text-muted);
}

.bk-stat strong {
  display: block;
  margin-top: 14px;
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.bk-stat.accent strong {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.bk-chan {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 14px 16px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: var(--bk-radius-lg);
  background: rgba(255, 255, 255, 0.02);
}

.bk-chan > * { min-width: 0; }

.bk-chan b {
  display: block;
  font-size: 0.88rem;
}

.bk-chan span {
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.6);
  overflow-wrap: anywhere;
}

/* ---------- 9. Tables and badges ---------- */

.bk-table-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--bk-border);
  border-radius: var(--bk-radius-xl);
  background: rgba(255, 255, 255, 0.03);
}

.bk-table-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.bk-table-head h3 {
  margin: 0;
  font-size: 1.05rem;
}

.bk-search {
  width: 100%;
  padding: 9px 14px;
  border-radius: var(--radius-pill);
  border-color: rgba(255, 255, 255, 0.14);
}

.bk-table-scroll {
  width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

.bk-table {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
  font-size: 0.9rem;
  color: #fff;
}

.bk-table th {
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: left;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.65);
}

.bk-table td {
  padding: 12px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  vertical-align: middle;
}

.bk-table tbody tr { transition: background-color var(--bk-ease); }
.bk-table tbody tr:hover { background: rgba(255, 255, 255, 0.03); }

.bk-id {
  font: 12px var(--font-mono);
  color: var(--bk-orange);
  overflow-wrap: anywhere;
}

.bk-amt {
  font-weight: 600;
  color: var(--bk-success);
  white-space: nowrap;
}

.bk-date {
  font-size: 12.5px;
  color: var(--bk-text-muted);
  white-space: nowrap;
}

.bk-empty {
  padding: 24px 16px !important;
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
}

.bk-empty.err { color: #ff9a7a; }

.bk-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(52, 211, 153, 0.15);
  color: #6ee7b7;
  font: 600 11px/1.5 var(--font-mono);
}

.bk-badge.warn    { background: rgba(251, 191, 36, 0.15); color: #fcd34d; }
.bk-badge.bad     { background: rgba(248, 113, 113, 0.15); color: #fca5a5; }
.bk-badge.info    { background: rgba(96, 165, 250, 0.15); color: #93c5fd; }
.bk-badge.neutral { background: rgba(255, 255, 255, 0.09); color: rgba(255, 255, 255, 0.8); }

/* ---------- 10. Legal and information pages ---------- */

.lg {
  padding: 44px 0 64px;
  background: var(--paper);
}

.lg-in {
  width: 100%;
  max-width: 46rem;
  margin-inline: auto;
}

.lg h1 {
  margin: 0 0 18px;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.lg h2 {
  margin: 34px 0 8px;
  font-size: 1.15rem;
}

.lg p,
.lg li {
  color: #3a3a3f;
  font-size: 0.98rem;
  line-height: 1.7;
}

.lg ul { padding-left: 20px; }

/* Text links only; buttons keep their own styles. */
.lg p a:not(.hk-btn),
.lg li a:not(.hk-btn),
.lg-in > a:not(.hk-btn) {
  color: var(--orange-deep);
  text-underline-offset: 3px;
}

.lg p a:not(.hk-btn):hover,
.lg li a:not(.hk-btn):hover,
.lg-in > a:not(.hk-btn):hover { text-decoration-thickness: 2px; }

.lg-note {
  padding: 14px 16px;
  border: 1px solid #ffd58a;
  border-radius: 14px;
  background: #fff7e6;
  color: #6b4a00 !important;
  font-size: 0.88rem !important;
}

.todo {
  padding: 0 4px;
  border-radius: 4px;
  background: #fff3cd;
  color: #7a4b00;
  font: 0.9em var(--font-mono);
}

/* ---------- 11. Tablet (640px+) ---------- */

@media (min-width: 480px) {
  .bk-stats,
  .bk-channels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 640px) {
  .bk-panel { padding: 32px; }
  .bk-stat { padding: 22px; }
  .bk-top { align-items: flex-end; margin-bottom: 32px; }
  .bk-table-head { padding: 18px 22px; }
  .bk-search { width: 220px; }
  .bk-table th { padding: 14px 22px; }
  .bk-table td { padding: 16px 22px; }
  .bk-empty { padding: 36px !important; }
  .lg { padding: 64px 0 96px; }
}

/* ---------- 12. Desktop (900px+) ---------- */

@media (min-width: 900px) {
  .bk-login { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }

  .bk-login-brand {
    padding: 72px 24px 72px max(24px, calc((100vw - 72rem) / 2 + 24px));
  }

  .bk-feats { margin-top: 36px; }

  .bk-stats,
  .bk-channels { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---------- 13. Hover, motion ---------- */

@media (hover: hover) and (pointer: fine) {
  .bk-feat:hover {
    border-color: var(--bk-orange);
    background: var(--bk-surface-hover);
    transform: translateX(4px);
  }

  .bk-stat:hover {
    border-color: var(--bk-orange);
    background: var(--bk-surface-hover);
    transform: translateY(-3px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .bk-live-dot,
  .bk-spin.go,
  .bk-error.show,
  .bk-skeleton { animation: none !important; }
}
