
:root {
  --bg: #0b1020;
  --surface: #131b30;
  --surface-light: #19233c;
  --text: #f4f7ff;
  --muted: #9ca9c5;
  --primary: #8175ff;
  --primary-light: #b3aaff;
  --border: rgba(255,255,255,.1);
  --success: #46d6a0;
  --danger: #ff7885;
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(ellipse at 50% -10%, rgba(98,83,255,.18), transparent 48%),
    var(--bg);
  font-family: "DM Sans", sans-serif;
  line-height: 1.6;
}

button, input, textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  opacity: .6;
  cursor: not-allowed;
}

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

.hidden {
  display: none !important;
}

.topbar {
  width: min(1160px, 92%);
  min-height: 78px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.7px;
}

.brand-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 13px;
  background: linear-gradient(135deg, #a69aff, #6554e8);
  box-shadow: 0 7px 25px rgba(129,117,255,.27);
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 0;
}

.header-user {
  max-width: 220px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--primary-light);
  outline-offset: 3px;
}

.btn-primary {
  color: white;
  background: linear-gradient(135deg, #897dff, #6756eb);
  box-shadow: 0 7px 22px rgba(103,86,235,.19);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #9a90ff, #7869f5);
}

.btn-outline {
  color: var(--text);
  background: rgba(255,255,255,.025);
  border-color: var(--border);
}

.btn-outline:hover {
  background: rgba(255,255,255,.07);
  border-color: rgba(166,157,255,.35);
}

.hero {
  width: min(850px, 92%);
  margin: auto;
  padding: 92px 0 72px;
  text-align: center;
}

.eyebrow {
  display: inline-block;
  color: var(--primary-light);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2.3px;
  text-transform: uppercase;
}

.hero h1 {
  margin: 18px 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(42px, 7vw, 76px);
  line-height: 1.08;
  letter-spacing: -3px;
}

.hero h1 span {
  color: var(--primary-light);
}

.hero > p {
  max-width: 530px;
  margin: 0 auto 27px;
  color: var(--muted);
  font-size: 17px;
}

.hero-note {
  margin-top: 20px;
  color: var(--muted);
  font-size: 12px;
}

.features {
  width: min(1050px, 92%);
  margin: 0 auto 76px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 17px;
}

.feature-card {
  min-width: 0;
  padding: 25px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(25,35,60,.94), rgba(19,27,48,.88));
  transition: transform .2s ease, border-color .2s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: rgba(166,157,255,.38);
}

.feature-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  border-radius: 15px;
  background: rgba(129,117,255,.14);
  font-size: 23px;
}

.feature-card h2,
.admin-panel h3 {
  margin: 0 0 8px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 19px;
}

.feature-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.account-section {
  width: min(1000px, 92%);
  margin: 0 auto 75px;
  padding: clamp(18px, 4vw, 34px);
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(19,27,48,.88);
  box-shadow: 0 24px 80px rgba(0,0,0,.12);
}

.section-heading {
  margin-bottom: 22px;
}

.section-heading h2 {
  margin: 8px 0 4px;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(23px, 4vw, 31px);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.section-heading p {
  margin: 6px 0 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 24px 0;
}

.stat-card {
  min-width: 0;
  padding: 19px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-light);
}

.stat-label {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.stat-card strong {
  display: block;
  margin-top: 5px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 28px;
}

.status-message {
  margin: 20px 0;
  padding: 15px 17px;
  border: 1px solid rgba(129,117,255,.26);
  border-radius: 13px;
  background: rgba(129,117,255,.09);
  color: #d6d1ff;
  overflow-wrap: anywhere;
}

.admin-section,
.resources-section,
.payment-section {
  margin-top: 32px;
  padding-top: 27px;
  border-top: 1px solid var(--border);
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0;
}

.admin-panel {
  min-width: 0;
  margin-top: 18px;
  padding: clamp(16px, 3vw, 24px);
  border: 1px solid var(--border);
  border-radius: 17px;
  background: rgba(7,12,27,.38);
}

.admin-panel h3 {
  margin-bottom: 18px;
}

form {
  display: grid;
  gap: 10px;
}

label {
  margin-top: 7px;
  color: #e6eaff;
  font-size: 13px;
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  min-width: 0;
  padding: 12px 13px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 11px;
  background: #0d1427;
  color: var(--text);
}

input::placeholder,
textarea::placeholder {
  color: #71809f;
}

input[type="file"] {
  padding: 10px;
  font-size: 13px;
}

input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: #293453;
  color: white;
  cursor: pointer;
}

textarea {
  resize: vertical;
}

form .btn {
  width: fit-content;
  max-width: 100%;
  margin-top: 10px;
}

.field-help {
  margin: 5px 0 12px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.resource-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
  margin: 18px 0 24px;
}

.resource-item {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface-light);
  overflow-wrap: anywhere;
}

.resource-item h3 {
  margin: 0 0 8px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 17px;
  line-height: 1.4;
}

.resource-item p {
  margin: 6px 0;
  color: var(--muted);
  font-size: 13px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.resource-item .btn {
  margin-top: 12px;
}

.resource-price {
  color: var(--success) !important;
  font-weight: 700;
}

.empty-state {
  grid-column: 1 / -1;
  margin: 0;
  padding: 22px;
  border: 1px dashed var(--border);
  border-radius: 14px;
  color: var(--muted);
  text-align: center;
}

.payment-card {
  max-width: 520px;
  margin: 0 auto;
  padding: clamp(17px, 4vw, 28px);
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface-light);
}

.payment-amount {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.payment-amount span {
  color: var(--muted);
  font-size: 14px;
}

.payment-amount strong {
  color: var(--success);
  font-family: "Space Grotesk", sans-serif;
  font-size: 30px;
}

.qr-placeholder,
.qr-preview {
  display: grid;
  place-items: center;
  width: 100%;
  margin: 16px auto;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: #fff;
  color: #172033;
  text-align: center;
}

.qr-placeholder > span {
  font-size: 48px;
}

.qr-placeholder p {
  max-width: 300px;
  margin: 6px auto;
  color: #5a6475;
  font-size: 13px;
}

.qr-preview img {
  display: block;
  width: 100%;
  max-width: 300px;
  max-height: 340px;
  object-fit: contain;
}

.payment-section .field-help {
  line-height: 1.6;
}

footer {
  padding: 26px 16px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

footer p {
  margin: 5px 0;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100;
  width: max-content;
  max-width: calc(100% - 40px);
  padding: 13px 17px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #202b45;
  color: var(--text);
  box-shadow: 0 12px 40px rgba(0,0,0,.35);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity .2s ease, transform .2s ease;
  overflow-wrap: anywhere;
}

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

@media (max-width: 760px) {
  .topbar {
    width: 92%;
    min-height: 70px;
  }

  .brand {
    gap: 8px;
    font-size: 19px;
  }

  .brand-icon {
    width: 35px;
    height: 35px;
    border-radius: 11px;
  }

  .header-user {
    display: none;
  }

  .topbar .btn {
    min-height: 39px;
    padding: 8px 11px;
    font-size: 12px;
  }

  .hero {
    padding: 70px 0 55px;
  }

  .hero h1 {
    font-size: clamp(39px, 10vw, 62px);
    letter-spacing: -1.8px;
  }

  .hero > p {
    font-size: 15px;
  }

  .features {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 55px;
  }

  .feature-card {
    padding: 21px;
  }

  .account-section {
    width: 94%;
    border-radius: 18px;
  }

  .resource-list {
    grid-template-columns: 1fr;
  }

  .admin-tabs .btn {
    flex: 1 1 140px;
  }

  .form .btn {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .brand {
    font-size: 17px;
  }

  .topbar .btn {
    padding: 8px;
    font-size: 11px;
  }

  .hero {
    padding-top: 58px;
  }

  .hero h1 {
    font-size: 39px;
  }

  .dashboard-stats {
    gap: 9px;
  }

  .stat-card {
    padding: 13px;
  }

  .stat-card strong {
    font-size: 24px;
  }

  .admin-tabs {
    display: grid;
    grid-template-columns: 1fr;
  }

  .admin-tabs .btn {
    width: 100%;
  }

  form .btn {
    width: 100%;
  }

  .payment-amount strong {
    font-size: 26px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
