/* ===============================
   fonts
=================================*/

html body {
  font-family: "Manrope", sans-serif;
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: normal;
  cursor: default;
}


/* ===============================
   DESIGN TOKENS (LIGHT)
=================================*/
:root {
  /* Base */
  --bg: #f6f7fb;
  --bg-elev: #ffffff;
  --text: #0f172a;      /* slate-900 */
  --muted: #64748b;     /* slate-500 */

  /* Brand */
  --primary: #4f46e5;   /* indigo-600 */
  --primary-700: #4338ca;
  --primary-800: #3730a3;
  --accent: #3b82f6;    /* blue-500 */

  /* Feedback */
  --success: #16a34a;
  --error: #dc2626;
  --warning: #f59e0b;
  --info: #0284c7;

  /* Surfaces */
  --radius-xs: 6px;
  --radius: 10px;
  --radius-lg: 12px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(2, 6, 23, .06);
  --shadow-md: 0 10px 30px rgba(2, 6, 23, .12);

  /* Opacity helpers */
  --op-4: 0.04;
  --op-6: 0.06;
  --op-8: 0.08;
  --op-12: 0.12;
  --op-16: 0.16;
  --op-24: 0.24;

  /* Gradients */
  --grad-primary: linear-gradient(135deg, var(--primary), var(--accent));
  --grad-soft: linear-gradient(180deg, rgba(79,70,229,.10), rgba(59,130,246,.06));
  --grad-glow: radial-gradient(1200px 500px at 100% -20%, rgba(79,70,229,.18), transparent 60%),
               radial-gradient(1000px 400px at -10% -10%, rgba(59,130,246,.14), transparent 60%);
}

/* ===============================
   DESIGN TOKENS (DARK via class)
=================================*/
html.dark-theme {
  --bg: #042030;        /* deep navy */
  --bg-elev: #112d45;   /* slightly lifted */
  --text: #e6edf7;
  --muted: #9aa4b2;

  --primary: #7c83ff;   /* lighter indigo for dark bg */
  --primary-700: #6a72ff;
  --primary-800: #5b62f5;
  --accent: #60a5fa;

  --success: #22c55e;
  --error: #ef4444;
  --warning: #f59e0b;
  --info: #38bdf8;

  --shadow-sm: 0 2px 12px rgba(0,0,0,.45);
  --shadow-md: 0 18px 40px rgba(0,0,0,.65);

  --grad-primary: linear-gradient(135deg, #7c83ff, #60a5fa);
  --grad-soft: linear-gradient(180deg, rgba(124,131,255,.12), rgba(96,165,250,.10));
  --grad-glow: radial-gradient(1300px 500px at 90% -10%, rgba(124,131,255,.20), transparent 60%),
               radial-gradient(900px 380px at 0% -10%, rgba(56,189,248,.18), transparent 60%);
}

/* ===============================
   GLOBAL
=================================*/
* { box-sizing: border-box; }
html, body { 
    height: auto;
 }
body {
  min-height: 100vh;
  font-family: 'Segoe UI', Roboto, Arial, sans-serif;
  background: var(--bg);
  background-image: var(--grad-glow);
  margin: 0;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.hidden{
    display: none;
}

/* Heading */
h1 {
  text-align: center;
  margin: 0;
  font-size: 2rem;
  color: var(--text);
  padding-top: 15vh;
}

/* ===============================
   NAV / LINKS / THEME TOGGLE
=================================*/
.nav-container {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

a {
  font-weight: 600;
  text-decoration: none;
  background: transparent;
  color: var(--primary);
  padding: 8px 12px;
  border-radius: var(--radius-xs);
  font-size: .95rem;
  transition: background-color .25s, color .25s, transform .15s ease;
}
a:hover {
  background-color: rgba(79, 70, 229, var(--op-8));
  color: var(--primary-800);
  transform: translateY(-1px);
}

#themeToggle {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border-radius: 999px;
  background: var(--bg-elev);
  border: 1px solid rgba(2,6,23,.08);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
#themeToggle:hover {
  background: rgba(2,6,23,.04);
}
html.dark-theme #themeToggle {
  border-color: rgba(255,255,255,.08);
  background: rgba(255,255,255,.04);
}

/* ===============================
   CARDS / GLASS
=================================*/
.card,
#user-info {
  margin: 20px auto;
  padding: 16px 20px;
  background: var(--bg-elev);
  border-radius: var(--radius-lg);
  max-width: 40vw;
  box-shadow: var(--shadow-sm);
  text-align: center;
  font-size: 1rem;
  border: 1px solid rgba(2,6,23,.06);
}
html.dark-theme #user-info,
html.dark-theme .card {
  border-color: rgba(255,255,255,.06);
}

/* Glass card helper */
.glass {
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.35);
  box-shadow: var(--shadow-md);
}
html.dark-theme .glass {
  background: rgba(16,23,42,.55);
  border-color: rgba(255,255,255,.08);
}

/* ===============================
   BUTTONS
=================================*/
button {
  appearance: none;
  background: var(--grad-primary);
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  margin: 5px;
  font-size: .95rem;
  transition: transform .15s ease, box-shadow .15s ease, filter .2s ease;
  box-shadow: 0 10px 24px rgba(79,70,229,.26);
}
button:hover { transform: translateY(-2px); filter: brightness(1.03); }
button:active { transform: translateY(0); filter: brightness(.98); }
button:disabled { opacity: .6; cursor: not-allowed; filter: grayscale(.15); }

/* Variants */
.btn-secondary {
  background: linear-gradient(135deg, #64748b, #475569);
  box-shadow: 0 8px 18px rgba(71,85,105,.25);
}
.btn-ghost {
  background: transparent;
  color: var(--primary);
  border: 1px solid rgba(79,70,229,.35);
  box-shadow: none;
}
.btn-ghost:hover { background: rgba(79,70,229,.08); }

/* ===============================
   LAYOUT HELPERS (opacity / gradients)
=================================*/
.surface-op-6  { background-color: rgba(255,255,255, var(--op-6)); }
.surface-op-8  { background-color: rgba(255,255,255, var(--op-8)); }
.surface-op-12 { background-color: rgba(255,255,255, var(--op-12)); }
.surface-op-16 { background-color: rgba(255,255,255, var(--op-16)); }
.surface-op-24 { background-color: rgba(255,255,255, var(--op-24)); }
html.dark-theme .surface-op-6  { background-color: rgba(16,23,42, var(--op-6)); }
html.dark-theme .surface-op-8  { background-color: rgba(16,23,42, var(--op-8)); }
html.dark-theme .surface-op-12 { background-color: rgba(16,23,42, var(--op-12)); }
html.dark-theme .surface-op-16 { background-color: rgba(16,23,42, var(--op-16)); }
html.dark-theme .surface-op-24 { background-color: rgba(16,23,42, var(--op-24)); }

.bg-grad-primary { background: var(--grad-primary); color: #fff; }
.bg-grad-soft    { background: var(--grad-soft); }

/* ===============================
   FORMS
=================================*/
input[type="text"],
input[type="password"],
input[type="email"],
input[type="tel"],
input[type="number"] {
  width: 100%;
  padding: 11px 12px;
  margin: 8px 0 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: .95rem;
  transition: border-color .2s, box-shadow .2s, background-color .2s, color .2s;
  background-color: rgba(255,255,255,.92);
  color: var(--text);
}
input::placeholder { color: #9ca3af; }
input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(79,70,229,.18);
  background-color: #fff;
}

/* Dark form look */
html.dark-theme input[type="text"],
html.dark-theme input[type="password"],
html.dark-theme input[type="email"],
html.dark-theme input[type="tel"],
html.dark-theme input[type="number"] {
  background-color: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.14);
  color: #e7ecf5;
}
html.dark-theme input::placeholder { color: #9aa4b2; }
html.dark-theme input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(124,131,255,.22);
  background-color: rgba(255,255,255,.10);
}

.modal-info-text {
    display: block;
    margin-top: 10px;
  font-size: .82rem;
  color: var(--muted);
}

/* ===============================
   MODALS
=================================*/
.modal {
    min-height: 100vh;
    height: fit-content;
  display: none;
  position: absolute;
  z-index: 999;
  inset: 0;
  animation: overlayIn .28s ease;
  /* background: rgba(2,6,23,.55);
  backdrop-filter: blur(3px); */
  padding-top: 30vh;
}

.modal-bg{
  display: none;
  height: 100vh;
  width: 100vw;
  top: 0;
  position: fixed;
background: rgba(2,6,23,.55);
backdrop-filter: blur(3px);
z-index: 2;
}

.modal h2{
    text-align: center;
}

.store-modal{
    padding-top: 5vh;
}

.modal-content {
  background: var(--bg-elev);
  margin: auto;
  padding: 22px 18px;
  border-radius: 14px;
  width: 100%;
  max-width: 500px;
  box-shadow: var(--shadow-md);
  animation: modalIn .22s ease;
  border: 1px solid rgba(2,6,23,.06);
}
.modal-content form{
    display: grid;
}

.payments-modal{
    max-width: 730px;
}
.keys-modal{
    max-width: 900px;
}

.table .links img {
  image-rendering: pixelated;
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 8px;
}

.row-ref-reward { background: rgba(76, 175, 80, 0.06); }
.row-bonus { background: rgba(33, 150, 243, 0.06); }
.small { font-size: 12px; }
.tag { display:inline-block; padding:0 6px; border-radius:6px; background:rgba(0,0,0,.06); font-size:12px; }


.modal-content h2{
    margin-top: 0;
}
html.dark-theme .modal-content {
  border-color: rgba(255,255,255,.06);
}

.modal-content.glass {
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.35);
}
html.dark-theme .modal-content.glass {
  background: rgba(16,23,42,.55);
  border-color: rgba(255,255,255,.10);
}

.ref-modal{
  padding-top: 10vh;
  position: sticky;
}

.close {
  color: #9ca3af;
  float: right;
  font-size: 26px;
  font-weight: 700;
  transition: color .2s, transform .15s;
  line-height: 1;
}
.close:hover,
.close:focus {
  color: var(--primary);
  cursor: pointer;
  transform: scale(1.06);
}

/* ===============================
   MESSAGES
=================================*/
#registerMessage,
#paymentStatusResult {
  margin-top: 10px;
  font-size: .9rem;
  text-align: center;
  color: var(--muted);
}

.mono-block {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  white-space: pre-wrap;
  word-break: break-word;
  background: rgba(2,6,23,.04);
  border: 1px dashed rgba(2,6,23,.12);
  padding: 12px;
  border-radius: var(--radius);
  text-align: left;
}
html.dark-theme .mono-block {
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.10);
}

/* ===============================
   Balance
=================================*/

.balance-div{
margin:10px; 
}

.checkOnTop{
    z-index: 1000;
}

/* ===============================
   TOASTS
=================================*/
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  min-width: 250px;
  padding: 14px 16px;
  border-radius: 10px;
  color: white;
  font-size: 14px;
  box-shadow: var(--shadow-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #1f2937; /* default neutral toast */
  animation: toastIn .28s ease, toastOut .32s ease 4.6s forwards;
}
.toast-success { background: linear-gradient(135deg, #16a34a, #22c55e); }
.toast-error   { background: linear-gradient(135deg, #dc2626, #ef4444); }
.toast-info    { background: linear-gradient(135deg, #0284c7, #38bdf8); }
.toast-warning { background: linear-gradient(135deg, #f59e0b, #fbbf24); color: #111; }

.toast .close-btn {
  background: none;
  border: none;
  color: inherit;
  font-size: 18px;
  cursor: pointer;
  margin-left: 10px;
  line-height: 1;
  opacity: .9;
}
.toast .close-btn:hover { opacity: 1; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(12px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(12px); }
}

/* ===============================
   TABLE: My Payments
=================================*/
.table-wrap {
  overflow: auto;
  border-radius: var(--radius);
  background: var(--bg-elev);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(2,6,23,.06);
}
html.dark-theme .table-wrap {
  border-color: rgba(255,255,255,.06);
}
.table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}
.table th, .table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(2,6,23,.06);
  font-size: .95rem;
}
html.dark-theme .table th,
html.dark-theme .table td {
  border-bottom-color: rgba(255,255,255,.08);
}
.table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(2,6,23,.04), rgba(2,6,23,0));
  font-weight: 700;
}
html.dark-theme .table thead th {
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,0));
}
.table tbody tr:hover {
  background: rgba(59,130,246,.08);
}
html.dark-theme .table tbody tr:hover {
  background: rgba(96,165,250,.12);
}
.table .mono {

  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: .9rem;
}
.table a{
font-size: 10px;
}

#refLink{
    cursor: pointer;
}

/* Empty / error states */
#myKeysList .empty,
#myKeysList .error {
  padding: 12px;
  border-radius: var(--radius);
  background: rgba(2,6,23,.04);
  border: 1px dashed rgba(2,6,23,.12);
  text-align: center;
  color: var(--muted);
}
html.dark-theme #myKeysList .empty,
html.dark-theme #myKeysList .error {
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.10);
}

/* Empty / error states */
#myPaymentsList .empty,
#myPaymentsList .error {
  padding: 12px;
  border-radius: var(--radius);
  background: rgba(2,6,23,.04);
  border: 1px dashed rgba(2,6,23,.12);
  text-align: center;
  color: var(--muted);
}
html.dark-theme #myPaymentsList .empty,
html.dark-theme #myPaymentsList .error {
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.10);
}

.key-wrap { display:flex; align-items:center; gap:.5rem; flex-wrap:wrap; }
.key-value { user-select: all; cursor: pointer; word-break: break-all; padding:.25rem .5rem; border-radius:.5rem; background:rgba(0,0,0,.05); }
.copy-key { white-space: nowrap; }


/* ===============================
   MISC
=================================*/
.logout-container { text-align: center; margin-top: 16px; }

/* Motion prefs */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* Responsive */
@media (max-width: 640px) {
  body{
    min-height: none;
  }
  .nav-container {
    justify-content: center;
    position: absolute;
  }
  h1 { 
    padding-top:  20vh;
     font-size: 1.7rem; 
    }
  .modal { 
    position: fixed;
    padding-top: 25vh; 
  }
  .modal-content{
    width: 80%;
  }
  .close{
    color: #a72b55;
    font-size: 35px;
  }
  .card, #user-info {
    max-width: 80vw;
  }
  .store-modal{
    padding-top: 2vh;
    position: absolute;
  }
  .modal-content-mob{
    width: 90%;
  }
}

/* ===============================
   ANIMATIONS
=================================*/
@keyframes overlayIn {
  from { opacity: 0; backdrop-filter: blur(0px); }
  to   { opacity: 1; backdrop-filter: blur(3px); }
}
@keyframes modalIn {
  from { transform: translateY(18px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}


