:root {
  --navy: #07162f;
  --navy-2: #0d2447;
  --gold: #d7b56d;
  --gold-2: #f1d999;
  --white: #ffffff;
  --ink: #172033;
  --muted: #6d7584;
  --line: rgba(215, 181, 109, 0.28);
  --soft: #f6f8fb;
  --shadow: 0 24px 60px rgba(4, 12, 28, 0.16);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
}

a { color: inherit; text-decoration: none; }

button, input, select {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 22px;
  padding: 14px clamp(18px, 4vw, 52px);
  color: var(--white);
  background: rgba(7, 22, 47, 0.96);
  border-bottom: 1px solid rgba(215, 181, 109, 0.22);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid rgba(215, 181, 109, 0.6);
}

.main-nav {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.main-nav a {
  padding: 10px 12px;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
}

.main-nav a.active,
.main-nav a:hover {
  color: var(--gold-2);
  background: rgba(255, 255, 255, 0.07);
}

.header-actions,
.hero-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.hidden {
  display: none !important;
}

.session-label {
  max-width: 220px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-alert {
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 1px solid #f3c0c0;
  border-radius: 8px;
  color: #7a1d1d;
  background: #fff1f1;
  font-weight: 800;
}

.gold-button,
.ghost-button,
.icon-button,
.admin-card button {
  border: 0;
  border-radius: 6px;
  min-height: 42px;
  padding: 11px 16px;
  cursor: pointer;
  font-weight: 800;
}

.gold-button {
  color: #08172e;
  background: linear-gradient(135deg, var(--gold-2), var(--gold));
  box-shadow: 0 12px 28px rgba(215, 181, 109, 0.26);
}

.gold-button:disabled {
  cursor: not-allowed;
  color: #6d7584;
  background: #e7e9ee;
  box-shadow: none;
}

.ghost-button {
  color: var(--gold-2);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(215, 181, 109, 0.38);
}

.ghost-button.light {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.34);
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(215, 181, 109, 0.4);
  border-radius: 6px;
  background: transparent;
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: var(--gold-2);
}

.page {
  display: none;
  min-height: calc(100vh - 151px);
  padding: clamp(28px, 5vw, 72px) clamp(18px, 4vw, 64px);
}

.page.active { display: block; }

.hero {
  min-height: calc(100vh - 126px);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.78fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
  margin: calc(clamp(28px, 5vw, 72px) * -1) calc(clamp(18px, 4vw, 64px) * -1) 0;
  padding: clamp(40px, 7vw, 94px) clamp(18px, 4vw, 64px) 48px;
  color: var(--white);
  background:
    linear-gradient(115deg, rgba(7, 22, 47, 0.98) 0%, rgba(9, 31, 65, 0.91) 54%, rgba(7, 22, 47, 0.75) 100%),
    url("evrely-logo.png") center right 12% / min(620px, 70vw) no-repeat;
}

.hero h1 {
  max-width: 820px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(44px, 8vw, 92px);
  line-height: 0.94;
  letter-spacing: 0;
}

.slogan {
  max-width: 640px;
  margin: 24px 0 30px;
  font-size: clamp(19px, 2vw, 27px);
  color: rgba(255, 255, 255, 0.82);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero-panel,
.panel,
.form-card,
.contact-panel {
  min-width: 0;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(215, 181, 109, 0.24);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero-panel {
  padding: 24px;
  color: var(--ink);
}

.hero-logo-wrap {
  display: grid;
  place-items: center;
  min-height: 330px;
  background: linear-gradient(145deg, #eef2f7, #ffffff);
  border: 1px solid rgba(13, 36, 71, 0.08);
  border-radius: 8px;
  overflow: hidden;
}

.hero-logo-wrap img {
  width: min(100%, 360px);
  display: block;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.metric-strip div,
.stats-grid article,
.kpi-grid article,
.status-columns article,
.badge-grid article {
  padding: 16px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid rgba(13, 36, 71, 0.08);
}

.metric-strip span,
.kpi-grid span,
.status-columns span,
.admin-card span,
.badge-grid span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.metric-strip strong,
.kpi-grid strong,
.status-columns strong,
.admin-card strong,
.badge-grid strong {
  display: block;
  margin-top: 6px;
  color: var(--navy);
  font-size: clamp(18px, 2vw, 25px);
}

.section-band {
  margin-top: 34px;
  padding: clamp(24px, 4vw, 44px);
  background: var(--white);
  border: 1px solid rgba(13, 36, 71, 0.08);
  border-radius: 8px;
}

.intro-grid,
.faq-contact,
.referral-band,
.auth-shell,
.dashboard-layout,
.deposit-layout,
.withdraw-layout,
.referral-dashboard {
  display: grid;
  gap: 24px;
  min-width: 0;
}

.intro-grid {
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 1fr);
  align-items: center;
}

h1, h2, h3, p { letter-spacing: 0; }

h1, h2 {
  color: var(--navy);
}

.section-band h2,
.page-heading h1,
.auth-shell h1,
.dashboard-header h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 54px);
  line-height: 1.02;
}

.section-band p,
.auth-shell p,
.muted {
  color: var(--muted);
  line-height: 1.7;
}

.stats-grid,
.kpi-grid,
.admin-grid,
.badge-grid,
.notification-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.stats-grid span {
  color: var(--gold);
  font-size: 34px;
  font-weight: 900;
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(190px, 1fr));
  gap: 16px;
}

.plan-card {
  position: relative;
  overflow: hidden;
  padding: 22px;
  min-height: 280px;
  border-radius: 8px;
  color: var(--white);
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 70%);
  border: 1px solid rgba(215, 181, 109, 0.35);
  box-shadow: var(--shadow);
}

.plan-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(215, 181, 109, 0.22), transparent 46%);
  pointer-events: none;
}

.plan-card h3,
.plan-card p,
.plan-card dl,
.plan-card a {
  position: relative;
}

.plan-card h3 {
  margin: 0 0 14px;
  color: var(--gold-2);
  font-size: 24px;
}

.plan-card p {
  margin: 0 0 18px;
  color: rgba(255, 255, 255, 0.75);
}

.plan-card dl {
  display: grid;
  gap: 10px;
  margin: 0 0 22px;
}

.plan-card div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding-bottom: 8px;
}

.plan-card dt { color: rgba(255, 255, 255, 0.65); }
.plan-card dd { margin: 0; font-weight: 900; }

.tier-list {
  display: grid;
  gap: 12px;
}

.tier-list div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 18px;
  border-radius: 8px;
  background: var(--soft);
  border: 1px solid rgba(13, 36, 71, 0.08);
}

details {
  padding: 18px 0;
  border-bottom: 1px solid rgba(13, 36, 71, 0.1);
}

summary {
  cursor: pointer;
  color: var(--navy);
  font-weight: 900;
}

.faq-contact,
.referral-band {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.55fr);
}

.contact-panel,
.panel,
.form-card {
  padding: clamp(20px, 3vw, 30px);
}

.auth-page {
  background:
    linear-gradient(115deg, rgba(7, 22, 47, 0.96), rgba(7, 22, 47, 0.84)),
    url("evrely-logo.png") right center / 560px no-repeat;
}

.auth-shell {
  max-width: 1100px;
  margin: 0 auto;
  grid-template-columns: minmax(0, 0.86fr) minmax(320px, 0.62fr);
  align-items: center;
  color: var(--white);
}

.auth-shell h1,
.auth-shell .eyebrow {
  color: var(--gold-2);
}

.auth-shell p {
  color: rgba(255, 255, 255, 0.78);
}

.form-card {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--navy);
  font-weight: 800;
}

label span {
  color: var(--muted);
  font-size: 12px;
}

.form-hint {
  margin: -4px 0 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

input,
select {
  min-width: 0;
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  color: var(--ink);
  background: #fbfcfe;
  border: 1px solid rgba(13, 36, 71, 0.14);
  border-radius: 6px;
  outline-color: var(--gold);
}

.text-link {
  color: var(--navy-2);
  font-weight: 800;
  text-decoration: underline;
  text-decoration-color: var(--gold);
}

.link-button {
  width: max-content;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.dashboard-header,
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  margin-bottom: 26px;
}

.kpi-grid {
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  margin-bottom: 22px;
}

.dashboard-layout {
  grid-template-columns: minmax(320px, 0.8fr) minmax(0, 1.2fr);
}

.notifications-panel {
  margin-top: 22px;
}

.notification-list {
  display: grid;
  gap: 10px;
}

.notification-list article {
  display: grid;
  gap: 4px;
  padding: 14px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid rgba(13, 36, 71, 0.08);
}

.notification-list article.unread {
  background: #fff8e7;
  border-color: rgba(215, 181, 109, 0.42);
}

.notification-list strong {
  color: var(--navy);
}

.notification-list span,
.notification-list small {
  color: var(--muted);
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
}

.panel h2 {
  margin: 0 0 18px;
  color: var(--navy);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--navy);
  background: rgba(215, 181, 109, 0.18);
  font-size: 12px;
  font-weight: 900;
}

.countdown {
  margin-bottom: 22px;
  color: var(--navy);
  font-size: clamp(34px, 6vw, 60px);
  font-weight: 900;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}

th, td {
  padding: 14px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(13, 36, 71, 0.09);
  white-space: nowrap;
}

th {
  color: var(--navy);
  font-size: 13px;
  text-transform: uppercase;
}

td {
  color: #334155;
}

.rules ul,
.process-list {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.9;
}

.deposit-layout {
  grid-template-columns: minmax(320px, 0.9fr) minmax(260px, 0.45fr) minmax(320px, 0.8fr);
}

.warning {
  margin-bottom: 18px;
  padding: 14px;
  color: #5a3a00;
  background: #fff6dc;
  border: 1px solid rgba(215, 181, 109, 0.45);
  border-radius: 6px;
  font-weight: 900;
}

.copy-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  min-width: 0;
}

.icon-button {
  color: var(--white);
  background: var(--navy-2);
}

.qr-panel {
  text-align: center;
}

#qrImage {
  width: 220px;
  height: 220px;
  max-width: 100%;
  object-fit: contain;
  background: #ffffff;
  border: 12px solid #fff;
  box-shadow: inset 0 0 0 1px rgba(13, 36, 71, 0.08), 0 12px 34px rgba(4, 12, 28, 0.12);
}

.withdraw-layout {
  grid-template-columns: minmax(300px, 0.55fr) minmax(0, 1fr);
}

.status-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.referral-dashboard {
  grid-template-columns: minmax(320px, 0.85fr) minmax(320px, 1fr);
}

.referral-dashboard .panel:last-child {
  grid-column: 1 / -1;
}

.progress-wrap {
  margin-top: 24px;
}

.progress-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
  color: var(--navy);
  font-weight: 900;
}

.progress-bar {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6eaf0;
}

.progress-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-2));
}

.badge-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-grid {
  grid-template-columns: repeat(4, minmax(180px, 1fr));
}

.admin-card {
  display: grid;
  gap: 14px;
  padding: 22px;
  border-radius: 8px;
  background: var(--white);
  border: 1px solid rgba(13, 36, 71, 0.08);
  box-shadow: 0 16px 36px rgba(4, 12, 28, 0.08);
}

.admin-card button {
  color: var(--navy);
  background: rgba(215, 181, 109, 0.18);
  border: 1px solid rgba(215, 181, 109, 0.35);
}

.admin-review-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  margin-top: 24px;
}

.admin-actions {
  display: flex;
  gap: 8px;
}

.user-actions {
  flex-wrap: wrap;
  min-width: 210px;
}

.admin-actions button {
  min-height: 34px;
  padding: 8px 10px;
  color: var(--navy);
  background: rgba(215, 181, 109, 0.18);
  border: 1px solid rgba(215, 181, 109, 0.35);
  border-radius: 6px;
  cursor: pointer;
  font-weight: 800;
  white-space: nowrap;
}

.admin-actions button:last-child {
  color: #7a1d1d;
  background: #fff1f1;
  border-color: #f3c0c0;
}

.notification-grid {
  grid-template-columns: repeat(7, minmax(120px, 1fr));
}

.notification-grid span {
  padding: 14px;
  border-radius: 6px;
  color: var(--navy);
  background: var(--soft);
  border: 1px solid rgba(13, 36, 71, 0.08);
  font-weight: 800;
}

.announcement-form {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(260px, 1fr) auto;
  align-items: end;
  gap: 14px;
  margin-top: 18px;
}

.announcement-form textarea {
  resize: vertical;
  min-height: 74px;
}

.legal-page {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(246, 248, 251, 0.95)),
    radial-gradient(circle at 80% 0%, rgba(215, 181, 109, 0.18), transparent 34%);
}

.legal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 18px;
}

.legal-panel {
  padding: clamp(20px, 3vw, 30px);
}

.legal-panel p {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.7;
}

.legal-panel p:last-child {
  margin-bottom: 0;
}

.warning-panel {
  border-color: rgba(215, 181, 109, 0.58);
  background: #fff8e7;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 28px clamp(18px, 4vw, 52px);
  color: rgba(255, 255, 255, 0.8);
  background: var(--navy);
}

.site-footer strong {
  color: var(--gold-2);
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  transform: translateY(120px);
  max-width: min(360px, calc(100vw - 36px));
  padding: 14px 18px;
  color: var(--navy);
  background: var(--gold-2);
  border-radius: 6px;
  box-shadow: var(--shadow);
  font-weight: 900;
  transition: transform 0.25s ease;
}

.toast.show {
  transform: translateY(0);
}

@media (max-width: 1180px) {
  .plan-grid,
  .admin-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .deposit-layout,
  .notification-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .qr-panel {
    grid-row: span 2;
  }
}

@media (max-width: 880px) {
  .site-header {
    grid-template-columns: auto auto;
  }

  .menu-toggle {
    display: block;
    justify-self: end;
  }

  .main-nav,
  .header-actions {
    display: none;
    grid-column: 1 / -1;
  }

  .site-header.open .main-nav,
  .site-header.open .header-actions {
    display: grid;
    justify-content: stretch;
  }

  .main-nav {
    gap: 4px;
  }

  .header-actions {
    grid-template-columns: 1fr 1fr;
  }

  .hero,
  .intro-grid,
  .faq-contact,
  .referral-band,
  .auth-shell,
  .dashboard-layout,
  .deposit-layout,
  .withdraw-layout,
  .referral-dashboard {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 54px;
  }

  .hero-panel {
    display: none;
  }

  .kpi-grid,
  .stats-grid,
  .status-columns,
  .badge-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-header,
  .page-heading {
    display: grid;
    align-items: start;
  }

  .qr-panel {
    grid-row: auto;
  }

  .site-footer {
    display: grid;
  }
}

@media (max-width: 560px) {
  .page {
    padding-inline: 14px;
  }

  .hero {
    margin-inline: -14px;
    padding-inline: 18px;
  }

  .hero-actions,
  .header-actions,
  .copy-field {
    grid-template-columns: minmax(0, 1fr);
    display: grid;
  }

  .plan-grid,
  .kpi-grid,
  .stats-grid,
  .status-columns,
  .badge-grid,
  .admin-grid,
  .notification-grid,
  .announcement-form,
  .metric-strip {
    grid-template-columns: 1fr;
  }

  .tier-list div,
  .progress-top {
    display: grid;
  }

  .gold-button,
  .ghost-button,
  .icon-button {
    width: 100%;
    text-align: center;
  }
}
