*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
}
:root {
  --pulse: #6d5cff;
  --pulse-2: #8b7cff;
  --glow: #3fd6c9;
  --gradient: linear-gradient(135deg, var(--pulse), var(--glow));
  --gradient-soft: linear-gradient(
    135deg,
    rgba(109, 92, 255, 0.16),
    rgba(63, 214, 201, 0.16)
  );
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}
html[data-theme="dark"] {
  --bg: #0a0c10;
  --bg-elevated: #12141c;
  --bg-elevated-2: #181b25;
  --text: #f3f3f6;
  --text-muted: #9097aa;
  --text-faint: #5a6072;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --glass: rgba(18, 20, 28, 0.55);
  --glass-strong: rgba(24, 27, 37, 0.78);
  --shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.55);
  --shadow-sm: 0 12px 30px -10px rgba(0, 0, 0, 0.4);
  --input-bg: rgba(255, 255, 255, 0.04);
  --visual-bg:
    radial-gradient(
      circle at 30% 20%,
      rgba(109, 92, 255, 0.25),
      transparent 55%
    ),
    radial-gradient(
      circle at 80% 80%,
      rgba(63, 214, 201, 0.2),
      transparent 55%
    ),
    #0d0f16;
}
html[data-theme="light"] {
  --bg: #f5f4f1;
  --bg-elevated: #ffffff;
  --bg-elevated-2: #fbfaf8;
  --text: #15161b;
  --text-muted: #5c6070;
  --text-faint: #9a9daa;
  --border: rgba(20, 21, 26, 0.08);
  --border-strong: rgba(20, 21, 26, 0.14);
  --glass: rgba(255, 255, 255, 0.6);
  --glass-strong: rgba(255, 255, 255, 0.85);
  --shadow: 0 30px 60px -20px rgba(20, 21, 30, 0.18);
  --shadow-sm: 0 12px 30px -10px rgba(20, 21, 30, 0.12);
  --input-bg: rgba(20, 21, 26, 0.03);
  --visual-bg:
    radial-gradient(
      circle at 30% 20%,
      rgba(109, 92, 255, 0.18),
      transparent 55%
    ),
    radial-gradient(
      circle at 80% 80%,
      rgba(63, 214, 201, 0.16),
      transparent 55%
    ),
    #efeeea;
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition:
    background 0.4s var(--ease),
    color 0.4s var(--ease);
  min-height: 100vh;
}
h1,
h2,
h3 {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.mono {
  font-family: "JetBrains Mono", monospace;
}
a {
  color: inherit;
  text-decoration: none;
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* topbar */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 32px;
  z-index: 50;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 17px;
}
.logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px -4px rgba(109, 92, 255, 0.55);
}
.logo-mark svg {
  width: 17px;
  height: 17px;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}
.theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--glass);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    border-color 0.2s,
    transform 0.2s;
}
.theme-toggle:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
}
.theme-toggle svg {
  width: 16px;
  height: 16px;
  color: var(--text);
}
.icon-moon {
  display: none;
}
html[data-theme="dark"] .icon-sun {
  display: none;
}
html[data-theme="dark"] .icon-moon {
  display: block;
}
.back-home {
  font-size: 13.5px;
  color: var(--text-muted);
}
.back-home:hover {
  color: var(--text);
}

/* layout */
.auth-wrap {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  min-height: 100vh;
}
.auth-visual {
  position: relative;
  background: var(--visual-bg);
  overflow: hidden;
  padding: 100px 56px 56px;
  display: flex;
  flex-direction: column;
  gap: 34px;
}
.auth-form-side {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 100px 40px 60px;
  position: relative;
}
.toast {
  position: fixed;
  top: 26px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 13px;
  padding: 12px 20px;
  font-size: 13.5px;
  box-shadow: var(--shadow-sm);
  opacity: 0;
  transition: all 0.3s var(--ease);
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 8px;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast svg {
  width: 15px;
  height: 15px;
  color: var(--glow);
  flex: none;
}
@media (max-width: 980px) {
  .auth-wrap {
    grid-template-columns: 1fr;
  }
  .auth-visual {
    display: none;
  }
}

/* visual: headline */
.visual-head {
  position: relative;
  z-index: 2;
}
.visual-head .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--glow);
  margin-bottom: 14px;
}
.visual-head .eyebrow .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--glow);
  box-shadow: 0 0 0 0 rgba(63, 214, 201, 0.6);
  animation: pulseDot 2s infinite;
}
@keyframes pulseDot {
  0% {
    box-shadow: 0 0 0 0 rgba(63, 214, 201, 0.55);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(63, 214, 201, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(63, 214, 201, 0);
  }
}
.visual-head h2 {
  font-size: 28px;
  color: #fff;
}
html[data-theme="light"] .visual-head h2 {
  color: var(--text);
}
.visual-head p {
  color: var(--text-muted);
  font-size: 14.5px;
  margin-top: 8px;
  max-width: 360px;
}

/* stat cards */
.stat-row {
  display: flex;
  gap: 14px;
  position: relative;
  z-index: 2;
}
.stat-card {
  flex: 1;
  background: var(--glass-strong);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}
.stat-card .lbl {
  font-size: 11px;
  color: var(--text-faint);
  font-family: "JetBrains Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}
.stat-card .num {
  font-family: "Space Grotesk", sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: #fff;
}
html[data-theme="light"] .stat-card .num {
  color: var(--text);
}
.stat-card .trend {
  font-size: 11.5px;
  color: var(--glow);
  margin-top: 4px;
}

/* nfc card */
.nfc-stage {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 170px;
}
.nfc-card {
  width: 230px;
  height: 142px;
  border-radius: 18px;
  background: linear-gradient(135deg, #1c1f2b, #0a0b10);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 30px 50px -15px rgba(0, 0, 0, 0.6);
  position: relative;
  padding: 18px;
  transform: rotate(-7deg);
  animation: cardFloat 5s ease-in-out infinite;
}
@keyframes cardFloat {
  0%,
  100% {
    transform: rotate(-7deg) translateY(0);
  }
  50% {
    transform: rotate(-5deg) translateY(-8px);
  }
}
.nfc-card .chip {
  width: 30px;
  height: 22px;
  border-radius: 5px;
  background: linear-gradient(135deg, var(--pulse), var(--glow));
}
.nfc-card .word {
  position: absolute;
  left: 18px;
  bottom: 16px;
  color: #fff;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 14px;
}
.nfc-card .wave {
  position: absolute;
  right: 16px;
  top: 16px;
  color: rgba(255, 255, 255, 0.5);
}
.nfc-card .wave svg {
  width: 20px;
  height: 20px;
}
.nfc-ripple {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 230px;
  height: 142px;
  border-radius: 18px;
  border: 1.5px solid var(--pulse);
  transform: translate(-50%, -50%);
  opacity: 0;
}
.nfc-ripple.r1 {
  animation: cardRipple 3.4s var(--ease) infinite;
}
.nfc-ripple.r2 {
  animation: cardRipple 3.4s var(--ease) infinite;
  animation-delay: 0.5s;
}
@keyframes cardRipple {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1);
  }
  15% {
    opacity: 0.5;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.25);
  }
}

/* recent taps */
.recent-panel {
  position: relative;
  z-index: 2;
  background: var(--glass-strong);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.recent-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-family: "JetBrains Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  margin-bottom: 14px;
}
.recent-head .live {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--glow);
  box-shadow: 0 0 0 0 rgba(63, 214, 201, 0.6);
  animation: pulseDot 2s infinite;
}
.tap-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tap-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 4px;
  border-radius: 10px;
  animation: rowIn 0.5s var(--ease);
}
@keyframes rowIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.tap-row .ic {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--gradient-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.tap-row .ic svg {
  width: 14px;
  height: 14px;
  color: var(--pulse);
}
.tap-row .info {
  flex: 1;
  min-width: 0;
}
.tap-row .name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
html[data-theme="light"] .tap-row .name {
  color: var(--text);
}
.tap-row .meta {
  font-size: 11px;
  color: var(--text-faint);
}
.tap-row .time {
  font-size: 11px;
  color: var(--text-faint);
  font-family: "JetBrains Mono", monospace;
  flex: none;
}

/* form side */
.form-card {
  width: 100%;
  max-width: 400px;
}
.form-head {
  margin-bottom: 30px;
}
.form-head h1 {
  font-size: 28px;
  margin-bottom: 8px;
}
.form-head p {
  color: var(--text-muted);
  font-size: 14.5px;
}
.view {
  display: none;
}
.view.active {
  display: block;
  animation: viewIn 0.45s var(--ease);
}
@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.field {
  margin-bottom: 16px;
}
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 7px;
}
.input-wrap {
  position: relative;
}
.input-wrap svg.lic {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-faint);
}
.field input {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  padding: 13px 14px 13px 40px;
  font-size: 14.5px;
  color: var(--text);
  outline: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
  font-family: "Inter", sans-serif;
}
.field input:focus {
  border-color: var(--pulse);
  box-shadow: 0 0 0 3px rgba(109, 92, 255, 0.15);
}
.field input::placeholder {
  color: var(--text-faint);
}
.toggle-eye {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  cursor: pointer;
  color: var(--text-faint);
  background: none;
  border: none;
}
.toggle-eye svg {
  width: 18px;
  height: 18px;
}

.row-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 18px 0;
  font-size: 13.5px;
}
.remember {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
}
.remember input {
  width: 15px;
  height: 15px;
  accent-color: var(--pulse);
}
.link-accent {
  color: var(--pulse);
  font-weight: 600;
}
.link-accent:hover {
  text-decoration: underline;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13.5px;
  border-radius: 14px;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition:
    transform 0.25s var(--ease),
    box-shadow 0.25s var(--ease),
    filter 0.2s;
}
.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 14px 30px -10px rgba(109, 92, 255, 0.55);
}
.btn-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
}
.btn-google {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text);
  margin-top: 12px;
}
.btn-google:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}
.gmark {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    var(--pulse),
    var(--glow),
    var(--pulse-2),
    var(--pulse)
  );
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  font-family: "Space Grotesk", sans-serif;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0;
  color: var(--text-faint);
  font-size: 12.5px;
}
.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-strong);
}

.switch-text {
  text-align: center;
  margin-top: 24px;
  font-size: 13.5px;
  color: var(--text-muted);
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 18px;
  cursor: pointer;
}
.back-link svg {
  width: 14px;
  height: 14px;
}
.back-link:hover {
  color: var(--text);
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 18px 0;
  font-size: 12.5px;
  color: var(--text-muted);
}
.checkbox-row input {
  margin-top: 2px;
  width: 14px;
  height: 14px;
  accent-color: var(--pulse);
  flex: none;
}

.success-box {
  text-align: center;
  padding: 16px 0;
}
.success-icon {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--gradient-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
}
.success-icon svg {
  width: 26px;
  height: 26px;
  color: var(--glow);
}
.resend {
  font-size: 13px;
  color: var(--text-faint);
  margin-top: 18px;
}
