:root {
  color-scheme: dark;
  --bg: #07070a;
  --surface: rgba(19, 19, 25, 0.84);
  --surface-strong: #16161d;
  --line: rgba(255, 255, 255, 0.1);
  --text: #f7f4ef;
  --muted: #a8a5b0;
  --accent: #ff7043;
  --accent-2: #ffb36a;
  --violet: #7b61ff;
  --green: #50d890;
  --red: #ff6b75;
  --yellow: #ffd166;
  --radius: 22px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 70% 5%, rgba(123, 97, 255, 0.14), transparent 32rem),
    radial-gradient(circle at 0% 70%, rgba(255, 112, 67, 0.1), transparent 28rem),
    var(--bg);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

.ambient {
  position: fixed;
  border-radius: 999px;
  filter: blur(90px);
  pointer-events: none;
  z-index: -1;
}

.ambient-one {
  width: 18rem;
  height: 18rem;
  right: -7rem;
  top: 18%;
  background: rgba(255, 112, 67, 0.12);
}

.ambient-two {
  width: 22rem;
  height: 22rem;
  left: -12rem;
  bottom: 8%;
  background: rgba(123, 97, 255, 0.12);
}

.site-header {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--violet));
  color: #fff;
  font-weight: 900;
  box-shadow: 0 10px 30px rgba(123, 97, 255, 0.25);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  letter-spacing: -0.02em;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.72rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-user {
  color: var(--muted);
  font-size: 0.9rem;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.guest-layout {
  min-height: calc(100vh - 190px);
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  align-items: center;
  gap: clamp(36px, 7vw, 96px);
  padding: 42px 0 80px;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--accent-2);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1,
h2 {
  letter-spacing: -0.035em;
}

.hero-copy h1 {
  max-width: 780px;
  margin-bottom: 22px;
  font-size: clamp(2.8rem, 6.6vw, 6.3rem);
  line-height: 0.94;
}

.hero-lead {
  max-width: 680px;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.75;
}

.feature-row {
  margin-top: 52px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.feature-row article {
  min-height: 168px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.025);
}

.feature-row article > span {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 900;
}

.feature-row h2 {
  margin: 30px 0 8px;
  font-size: 1rem;
}

.feature-row p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.auth-card,
.panel {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.auth-card {
  padding: 10px;
  border-radius: 28px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  border-radius: 16px;
  background: #0d0d12;
}

.auth-tab {
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.auth-tab.active {
  background: var(--surface-strong);
  color: var(--text);
}

.auth-form {
  padding: 30px 22px 22px;
  display: grid;
  gap: 18px;
}

.auth-form h2 {
  margin-bottom: 0;
  font-size: 1.8rem;
}

label {
  display: grid;
  gap: 8px;
  color: #d9d6df;
  font-size: 0.84rem;
  font-weight: 650;
}

label small,
.muted {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 400;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: none;
  padding: 13px 14px;
  background: #0c0c10;
  color: var(--text);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

input:focus,
select:focus {
  border-color: rgba(255, 112, 67, 0.7);
  box-shadow: 0 0 0 4px rgba(255, 112, 67, 0.1);
}

.button {
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 11px 16px;
  color: var(--text);
  font-weight: 750;
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease, border-color 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.button-primary {
  background: linear-gradient(135deg, var(--accent), #e95736);
  color: white;
  box-shadow: 0 10px 26px rgba(255, 112, 67, 0.2);
}

.button-ghost {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.035);
}

.button-danger {
  border-color: rgba(255, 107, 117, 0.3);
  background: rgba(255, 107, 117, 0.1);
  color: #ff9da4;
}

.button-success {
  border-color: rgba(80, 216, 144, 0.3);
  background: rgba(80, 216, 144, 0.12);
  color: #8cebb8;
}

.button-small {
  padding: 8px 11px;
  font-size: 0.78rem;
}

.button-wide {
  width: 100%;
}

.app-shell {
  padding: 48px 0 90px;
}

.page-heading,
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.page-heading {
  margin-bottom: 34px;
}

.page-heading h1 {
  margin-bottom: 0;
  font-size: clamp(2.2rem, 5vw, 4.2rem);
}

.status-pill,
.tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.tag.success,
.status-pill.active {
  border-color: rgba(80, 216, 144, 0.25);
  background: rgba(80, 216, 144, 0.09);
  color: #8cebb8;
}

.tag.warning {
  border-color: rgba(255, 209, 102, 0.24);
  background: rgba(255, 209, 102, 0.08);
  color: var(--yellow);
}

.tag.danger {
  border-color: rgba(255, 107, 117, 0.25);
  background: rgba(255, 107, 117, 0.08);
  color: #ff9da4;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 22px;
}

.panel {
  margin-bottom: 22px;
  padding: clamp(20px, 4vw, 30px);
  border-radius: var(--radius);
}

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

.panel-heading h2 {
  margin: 0;
  font-size: 1.5rem;
}

.price-tag {
  color: var(--accent-2);
  font-size: 1.1rem;
  font-weight: 850;
}

.subscription-state {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.025);
}

.subscription-state strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.12rem;
}

.subscription-state p {
  margin-bottom: 16px;
  color: var(--muted);
  line-height: 1.55;
}

.payment-steps {
  display: grid;
  gap: 12px;
}

.payment-detail {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
}

.payment-detail span {
  color: var(--muted);
  font-size: 0.78rem;
}

.payment-detail strong {
  display: block;
  margin-top: 3px;
}

.proof-form {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

.upload-box {
  min-height: 216px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 16px;
  padding: 24px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.02);
  text-align: center;
}

.upload-box input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.upload-box label {
  cursor: pointer;
}

.upload-box label::before {
  content: "↑";
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: rgba(123, 97, 255, 0.15);
  color: #b4a7ff;
  font-size: 1.5rem;
}

.upload-box label strong,
.upload-box label span {
  display: block;
}

.upload-box label span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 400;
}

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

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--violet), var(--accent));
  transition: width 240ms ease;
}

.progress-wrap p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

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

.list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.list-item h3 {
  margin: 0 0 5px;
  overflow: hidden;
  font-size: 0.95rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.list-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}

.overview-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}

.overview-card span {
  color: var(--muted);
  font-size: 0.78rem;
}

.overview-card strong {
  display: block;
  margin-top: 10px;
  font-size: 2rem;
}

.inline-filter {
  display: flex;
  grid-template-columns: auto 170px;
  align-items: center;
  gap: 10px;
}

.inline-filter select {
  width: 170px;
  padding: 9px 12px;
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.admin-table th,
.admin-table td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.admin-table th {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.admin-table td.actions {
  display: flex;
  gap: 7px;
}

.admin-table td.subscription-actions {
  align-items: center;
}

.access-days-input {
  width: 82px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 0.78rem;
}

.empty-state {
  padding: 30px 18px;
  border: 1px dashed var(--line);
  border-radius: 15px;
  color: var(--muted);
  text-align: center;
}

.toast-region {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 20;
  display: grid;
  gap: 10px;
}

.toast {
  width: min(380px, calc(100vw - 40px));
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #1a1a21;
  box-shadow: var(--shadow);
  animation: toast-in 180ms ease-out;
}

.toast.error {
  border-color: rgba(255, 107, 117, 0.35);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 36px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px 24px;
  color: var(--muted);
  font-size: 0.76rem;
}

footer nav {
  display: flex;
  gap: 16px;
}

.legal-page {
  max-width: 780px;
  margin: 50px auto 90px;
  padding: clamp(22px, 5vw, 48px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  line-height: 1.7;
}

.legal-page h1 {
  font-size: clamp(2.2rem, 5vw, 4rem);
}

.legal-page h2 {
  margin-top: 30px;
}

.legal-page p,
.legal-page li {
  color: var(--muted);
}

.hidden {
  display: none !important;
}

@media (max-width: 920px) {
  .guest-layout,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .guest-layout {
    align-items: start;
    padding-top: 70px;
  }

  .auth-card {
    width: min(100%, 540px);
  }

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

@media (max-width: 640px) {
  .site-header,
  main,
  footer {
    width: min(100% - 22px, 1180px);
  }

  .site-header {
    min-height: 76px;
  }

  .brand small,
  .header-user {
    display: none;
  }

  .hero-copy h1 {
    font-size: clamp(2.65rem, 14vw, 4rem);
  }

  .feature-row {
    grid-template-columns: 1fr;
    margin-top: 34px;
  }

  .feature-row article {
    min-height: auto;
  }

  .feature-row h2 {
    margin-top: 12px;
  }

  .page-heading,
  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .page-heading {
    margin-bottom: 24px;
  }

  .overview-grid {
    grid-template-columns: 1fr 1fr;
  }

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

  .list-actions {
    justify-content: flex-start;
  }

  .inline-filter {
    width: 100%;
    justify-content: space-between;
  }

  .inline-filter select {
    width: min(58vw, 190px);
  }
}
