:root {
  --bg-image: url("/assets/bg-desktop.jpg");
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.78);
  --card: rgba(31, 33, 56, 0.42);
  --card-strong: rgba(31, 33, 56, 0.62);
  --border: rgba(255, 255, 255, 0.24);
  --shadow: rgba(42, 36, 86, 0.38);
  --accent: #cbb8ff;
  --accent-2: #f8c4de;
  --error: #ffd0d0;
}

@media (max-width: 767px) {
  :root {
    --bg-image: url("/assets/bg-mobile.jpg");
  }
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: ui-rounded, "SF Pro Rounded", "HarmonyOS Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  background: #1f1f3b;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  background-image: var(--bg-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.34), transparent 30%),
    linear-gradient(135deg, rgba(54, 51, 112, 0.58), rgba(245, 170, 215, 0.25));
  backdrop-filter: blur(1.2px);
}

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

button,
input {
  font: inherit;
}

.auth-shell,
.home-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.glass-card {
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: 0 24px 80px var(--shadow);
  backdrop-filter: blur(22px) saturate(1.2);
  -webkit-backdrop-filter: blur(22px) saturate(1.2);
}

.auth-card,
.home-card {
  width: min(92vw, 460px);
  border-radius: 32px;
  padding: 30px;
  text-align: center;
}

.site-logo,
.home-logo {
  width: 104px;
  height: 104px;
  object-fit: cover;
  border-radius: 28px;
  border: 2px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 16px 40px rgba(70, 54, 125, 0.38);
}

.home-logo {
  width: 92px;
  height: 92px;
}

.eyebrow {
  margin: 18px 0 8px;
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.22em;
  font-weight: 800;
}

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

h1 {
  margin-bottom: 10px;
  font-size: clamp(32px, 7vw, 44px);
  letter-spacing: -0.04em;
}

h2 {
  margin-bottom: 0;
  font-size: 26px;
}

h3 {
  margin-bottom: 8px;
}

.muted {
  color: var(--muted);
  line-height: 1.65;
}

.access-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 18px 0 22px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.88);
  font-size: 14px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #9effc1;
  box-shadow: 0 0 18px #9effc1;
}

.login-form {
  display: grid;
  gap: 12px;
  text-align: left;
}

.login-form label {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.86);
}

.login-form input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  outline: none;
  border-radius: 18px;
  padding: 15px 16px;
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
}

.login-form input::placeholder {
  color: rgba(255, 255, 255, 0.58);
}

.login-form input:focus {
  border-color: rgba(255, 255, 255, 0.72);
  box-shadow: 0 0 0 4px rgba(203, 184, 255, 0.25);
}

.error-message {
  margin: -4px 0 0;
  color: var(--error);
  font-size: 14px;
}


.turnstile-wrap {
  display: grid;
  justify-items: center;
  gap: 8px;
  min-height: 74px;
  margin: 2px 0 0;
  padding: 10px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.turnstile-hint {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  text-align: center;
}


.primary-button,
.secondary-button,
.menu-button,
.text-button,
.icon-button {
  border: 0;
  cursor: pointer;
}

.primary-button {
  width: 100%;
  margin-top: 8px;
  padding: 15px 18px;
  border-radius: 18px;
  color: #2d2146;
  font-weight: 800;
  background: linear-gradient(135deg, #fff, var(--accent), var(--accent-2));
  box-shadow: 0 16px 38px rgba(248, 196, 222, 0.28);
}

.button-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 24px;
}

.menu-button {
  min-height: 104px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  border-radius: 24px;
  padding: 16px;
  text-align: left;
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.22);
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.menu-button:hover,
.menu-button:focus-visible {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.23);
  border-color: rgba(255, 255, 255, 0.42);
}

.menu-button span {
  font-size: 18px;
  font-weight: 800;
}

.menu-button small {
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.45;
}

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

.menu-button.disabled:hover {
  transform: none;
  background: rgba(255, 255, 255, 0.15);
}

.logout-form {
  margin-top: 22px;
}

.text-button {
  padding: 8px 12px;
  color: rgba(255, 255, 255, 0.72);
  background: transparent;
}

.text-button:hover {
  color: #fff;
}

.modal,
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
}

.modal.open,
.lightbox.open {
  display: block;
}

.modal-backdrop,
.lightbox {
  background: rgba(14, 15, 34, 0.74);
  backdrop-filter: blur(10px);
}

.modal-panel {
  position: fixed;
  left: 50%;
  top: 50%;
  width: min(92vw, 900px);
  max-height: min(86vh, 760px);
  overflow: auto;
  transform: translate(-50%, -50%);
  border-radius: 30px;
  padding: 24px;
  background: var(--card-strong);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.icon-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  font-size: 28px;
  line-height: 1;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.24);
}

.wallpaper-list {
  display: grid;
  gap: 16px;
}

.wallpaper-item {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 18px;
  align-items: center;
  padding: 14px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.wallpaper-item img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  border-radius: 18px;
}

.wallpaper-info p {
  color: var(--muted);
  line-height: 1.6;
}

.wallpaper-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 86px;
  padding: 11px 14px;
  border-radius: 999px;
  color: #2d2146;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.9);
}

.lightbox {
  z-index: 30;
  place-items: center;
  padding: 24px;
}

.lightbox.open {
  display: grid;
}

.lightbox img {
  max-width: min(96vw, 1400px);
  max-height: 92vh;
  object-fit: contain;
  border-radius: 20px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.lightbox-close {
  position: fixed;
  right: 22px;
  top: 22px;
  z-index: 31;
}

@media (max-width: 767px) {
  .auth-shell,
  .home-shell {
    padding: 18px;
    align-items: end;
  }

  .auth-card,
  .home-card {
    width: 100%;
    border-radius: 28px;
    padding: 24px;
  }

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

  .menu-button {
    min-height: 86px;
  }

  .modal-panel {
    width: calc(100vw - 28px);
    padding: 18px;
    border-radius: 24px;
  }

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

  .wallpaper-item img {
    height: 220px;
  }
}
