/* ===== shared.css — Common styles for all pages ===== */

:root {
  color-scheme: light;
  --ink: #07111c;
  --muted: rgba(7, 17, 28, 0.68);
  --line: rgba(255, 255, 255, 0.62);
  --glass: rgba(255, 255, 255, 0.26);
  --blue-start: #0575E6;
  --blue-end: #021B79;
  --brand: linear-gradient(135deg, var(--blue-start), var(--blue-end));
  --shadow: 0 24px 80px rgba(24, 76, 118, 0.2);
  --blur: 6px;
}

/* Reset */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  overflow-x: hidden;
  /* Base background — pages override this */
  background: linear-gradient(180deg, #cfe6ff 0%, #eef7ff 44%, #d9efff 100%);
}

button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

/* Page transitions */
body {
  opacity: 0;
  transition: opacity 420ms cubic-bezier(.22,1,.36,1);
}
body.page-ready { opacity: 1; }
body.page-leaving { opacity: 0; }

/* Glass */
.glass {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(255,255,255,0.58), rgba(255,255,255,0.22)), var(--glass);
  box-shadow: inset 1px 1px 0 rgba(255,255,255,0.9), inset -1px -1px 0 rgba(255,255,255,0.26), var(--shadow);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(100%);
  backdrop-filter: blur(var(--blur)) saturate(100%);
}
/* Shell */
.shell {
  width: min(1280px, calc(100% - 44px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 0 64px;
  transform: translateY(12px) scale(0.995);
  transition: transform 520ms cubic-bezier(.22,1,.36,1);
}
body.page-ready .shell { transform: translateY(0) scale(1); }
body.page-leaving .shell { transform: translateY(-14px); }

/* Header */
header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  padding: 10px 2px 50px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 70px;
  font-weight: 950;
  white-space: nowrap;
  justify-self: start;
}

.mark {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: block;
  flex: 0 0 auto;
}

.mark img, .mark svg { width: 100%; height: 100%; display: block; }

.brand-logo {
  width: 255px;
  max-width: 30vw;
  height: auto;
  display: block;
  overflow: visible;
}

.brand-copy { display: grid; gap: 4px; line-height: 1; }

.brand-name {
  font-size: 28px;
  font-weight: 950;
  letter-spacing: 0;
  background: linear-gradient(135deg, #0b8cff 0%, #075bdb 48%, #021b79 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-subtitle {
  font-size: 13px;
  font-weight: 950;
  color: rgba(2, 27, 121, 0.72);
  letter-spacing: 0.5px;
}
/* Nav */
nav {
  display: flex;
  gap: 8px;
  padding: 8px;
  border-radius: 999px;
}

nav a {
  min-width: 100px;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

nav a.active, nav a:hover {
  color: var(--ink);
  background: rgba(255,255,255,0.4);
}

/* Auth Area */
.auth-area {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  justify-self: end;
}

.auth-btn, .logout-btn, .auth-submit {
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-weight: 900;
}

.auth-btn {
  border-radius: 999px;
  padding: 12px 18px;
  color: #fff;
  background: var(--brand);
  box-shadow: 0 14px 34px rgba(5, 117, 230, 0.22);
  white-space: nowrap;
}

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 999px;
  padding: 6px 6px 6px 16px;
  color: rgba(7,17,28,0.82);
  font-weight: 900;
  white-space: nowrap;
  font-size: 14px;
}

.user-name {
  line-height: 1;
}

.logout-btn {
  border-radius: 999px;
  padding: 7px 14px;
  color: #fff;
  font-size: 12px;
  background: var(--brand);
}
/* Auth Overlay & Form */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  place-items: center;
  padding: 22px;
  background: rgba(188, 215, 241, 0.36);
  backdrop-filter: blur(10px);
}

.auth-overlay.visible { display: grid; }

.auth-card {
  position: relative;
  width: min(420px, 100%);
  border-radius: 32px;
  padding: 28px;
  color: var(--ink);
  box-shadow: 0 28px 80px rgba(2, 27, 121, 0.2);
}

.auth-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(7, 17, 28, 0.06);
  color: rgba(7, 17, 28, 0.5);
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.auth-close:hover {
  background: rgba(7, 17, 28, 0.12);
  color: var(--ink);
}

.auth-card h2 { margin: 0 0 8px; font-size: 28px; line-height: 1.2; }
.auth-card p { margin: 0 0 20px; color: rgba(7,17,28,0.62); font-weight: 700; line-height: 1.7; }

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.24);
  margin-bottom: 16px;
}

.auth-tab {
  border: 0;
  border-radius: 999px;
  padding: 10px 12px;
  background: transparent;
  color: rgba(7,17,28,0.62);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.auth-tab.active {
  color: #fff;
  background: var(--brand);
  box-shadow: 0 12px 26px rgba(5, 117, 230, 0.22);
}

.auth-form { display: grid; gap: 12px; }

.auth-input {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: 18px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.24);
  color: var(--ink);
  outline: none;
  font: inherit;
  font-weight: 800;
}
.auth-input::placeholder { color: rgba(7,17,28,0.45); }

.auth-submit {
  border-radius: 999px;
  padding: 14px 18px;
  color: #fff;
  background: var(--brand);
  box-shadow: 0 16px 34px rgba(5, 117, 230, 0.24);
}

.auth-message {
  min-height: 22px;
  color: rgba(7,17,28,0.7);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.6;
}

/* QR Float */
.qr-float {
  position: fixed !important;
  right: 24px;
  bottom: 24px;
  z-index: 9999;
  width: 180px;
  border-radius: 22px;
  padding: 14px;
  text-align: center;
  font-weight: 850;
  font-size: 13px;
  color: rgba(7,17,28,0.7);
  background: linear-gradient(145deg, rgba(255,255,255,0.54), rgba(255,255,255,0.22)), rgba(255,255,255,0.26);
  border: 1px solid rgba(255,255,255,0.58);
  box-shadow: 0 12px 40px rgba(26,102,178,0.1);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.qr-float img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  display: block;
  border-radius: 14px;
  margin-bottom: 8px;
}

/* Responsive — shared breakpoints */
@media (max-width: 1100px) {
  .shell { width: min(100% - 32px, 960px); }
}

@media (max-width: 768px) {
  .shell { width: min(100% - 24px, 720px); padding-top: 14px; }
  header {
    grid-template-columns: 1fr auto;
    padding-bottom: 16px;
    gap: 10px;
  }
  nav {
    position: fixed;
    bottom: 12px;
    left: 16px;
    right: 16px;
    z-index: 9000;
    display: flex;
    justify-content: center;
    gap: 4px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    border-radius: 22px;
    border: 1px solid rgba(255,255,255,0.6);
    background: rgba(255,255,255,0.82);
    -webkit-backdrop-filter: blur(16px) saturate(120%);
    backdrop-filter: blur(16px) saturate(120%);
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
  }
  nav a {
    flex: 1;
    min-width: 0;
    min-height: 44px;
    font-size: 14px;
    font-weight: 800;
  }
  nav a.active {
    background: var(--brand);
    color: #fff;
  }
  .brand-logo { max-width: 140px; }
  .qr-float {
    width: 52px;
    height: 52px;
    padding: 0;
    border-radius: 50%;
    bottom: 80px;
    right: 14px;
    display: grid;
    place-items: center;
    overflow: hidden;
  }
  .qr-float img {
    width: 36px;
    height: 36px;
    margin: 0;
    border-radius: 8px;
  }
  .qr-float span { display: none; }
  .qr-float.expanded {
    width: 140px;
    height: auto;
    border-radius: 18px;
    padding: 12px;
  }
  .qr-float.expanded img {
    width: 100%;
    height: auto;
    margin-bottom: 6px;
    border-radius: 10px;
  }
  .qr-float.expanded span { display: block; font-size: 11px; }
  .shell { padding-bottom: 90px; }
}

@media (max-width: 480px) {
  .shell { width: calc(100% - 16px); }
}

@media (prefers-reduced-motion: reduce) {
  body, .shell {
    opacity: 1;
    transform: none;
    filter: none;
    transition: none;
    animation: none;
  }
}
