/* === CELEBRATE BAR === */
.celebrate-bar {
  position: relative;
  z-index: 120;
  width: 100%;
  background: linear-gradient(90deg, #0f172a 0%, #1d4ed8 48%, #7c3aed 100%);
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  overflow: hidden;
}

.celebrate-bar::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
      circle at 14% 50%,
      rgba(255, 255, 255, 0.26),
      transparent 24%
    ),
    radial-gradient(
      circle at 84% 50%,
      rgba(255, 255, 255, 0.16),
      transparent 22%
    );
}
.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100vw;
}
.celebrate-inner {
  position: relative;
  z-index: 1;
  width: min(1220px, calc(100% - 40px));
  min-height: 42px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

.celebrate-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.celebrate-title {
  flex: 0 0 auto;
  font-weight: 900;
  letter-spacing: -0.2px;
  white-space: nowrap;
}

.celebrate-desc {
  min-width: 0;
  color: rgba(255, 255, 255, 0.82);
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.celebrate-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
  transition: 0.18s ease;
}

.celebrate-link:hover {
  transform: translateY(-1px);
  color: #0f172a;
}

/* === AUTH PAGE LAYOUT === */
.auth-page {
  min-height: calc(100vh - 68px - 42px - 73px);
  padding: 28px 0;
  display: flex;
  align-items: center;
  background: radial-gradient(
      circle at 12% 10%,
      rgba(37, 99, 235, 0.08),
      transparent 30%
    ),
    radial-gradient(circle at 88% 18%, rgba(15, 23, 42, 0.045), transparent 26%),
    linear-gradient(180deg, #fff 0%, #f8fafc 100%);
  border-bottom: 1px solid var(--line);
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(360px, 480px);
  justify-content: center;
  gap: 28px;
  align-items: stretch;
}

/* === AUTH CARD === */
.auth-card,
.qr-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.auth-card-top {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.auth-card-title h1 {
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.5px;
  color: var(--text);
}

.auth-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #dcfce7;
  color: #15803d;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.auth-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #16a34a;
}

.auth-body {
  padding: 22px;
}

/* === FORM PANELS === */
.form-panel {
  display: none;
  animation: fadeIn 0.22s ease both;
}

.form-panel.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.panel-hint {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  margin: -4px 0 16px;
  line-height: 1.7;
}

.panel-switch {
  color: var(--primary);
  font-weight: 700;
  cursor: pointer;
}

/* === LOGIN MODE TOGGLE === */
.login-mode {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 5px;
  border-radius: 13px;
  background: #f1f5f9;
  margin-bottom: 16px;
}

.mode-btn {
  border: 0;
  background: transparent;
  border-radius: 10px;
  padding: 8px 10px;
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: 0.18s ease;
}

.mode-btn.active {
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow-soft);
}

.login-section {
  display: none;
}

.login-section.active {
  display: block;
}

/* === FORM ELEMENTS === */
.form-group {
  margin-bottom: 14px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 126px;
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
}

.form-row .form-group {
  margin-bottom: 0;
}

.form-group label {
  display: block;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 6px;
}

.input-wrap input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 0 13px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  font-family: inherit;
  transition: 0.18s ease;
  display: block;
}

.input-wrap input:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

.input-wrap input::placeholder {
  color: #94a3b8;
}

/* === CODE BUTTON === */
.code-btn {
  height: 42px;
  margin-bottom: 0;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  transition: 0.18s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.code-btn:hover:not(:disabled) {
  border-color: #bfdbfe;
  background: var(--primary-soft);
}

.code-btn:disabled {
  cursor: not-allowed;
  color: var(--muted);
  background: #f8fafc;
  border-color: var(--line);
}

/* === CODE LOGIN TIP === */
.code-login-tip {
  margin: 2px 0 14px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--primary-soft);
  border: 1px solid #bfdbfe;
  color: var(--text-soft);
  font-size: 12.5px;
  line-height: 1.65;
  font-weight: 650;
}

.code-login-tip a {
  color: var(--primary);
  font-weight: 800;
}

/* === FORM HELPER & AGREEMENT === */
.form-helper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 2px 0 16px;
  color: var(--muted);
  font-size: 13px;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.check input {
  width: 15px;
  height: 15px;
  accent-color: var(--text);
}

.helper-links {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.helper-links a {
  color: var(--primary);
  font-weight: 700;
}

.helper-divider {
  width: 1px;
  height: 12px;
  background: var(--line-dark);
  display: inline-block;
}

.agreement {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 16px;
}

.agreement a {
  color: var(--primary);
  font-weight: 700;
  cursor: pointer;
}

.back-row {
  display: flex;
  justify-content: center;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

/* === QR CARD === */
.qr-card {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.qr-card-top {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.qr-card-top strong {
  font-size: 20px;
  letter-spacing: -0.4px;
}

.qr-card-top span {
  color: #15803d;
  background: #dcfce7;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.qr-card-body {
  flex: 1;
  padding: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.qr-box {
  width: 246px;
  max-width: 100%;
  aspect-ratio: 1/1;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(90deg, #0f172a 10px, transparent 10px) 0 0 / 28px
      28px,
    linear-gradient(#0f172a 10px, transparent 10px) 0 0 / 28px 28px, #fff;
  padding: 18px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  position: relative;
  overflow: hidden;
}

.qr-box::before {
  content: "";
  position: absolute;
  inset: 18px;
  background: linear-gradient(90deg, #fff 14px, transparent 14px) 0 0 / 28px
      28px,
    linear-gradient(#fff 14px, transparent 14px) 0 0 / 28px 28px;
  opacity: 0.96;
}

.qr-corner {
  position: absolute;
  width: 58px;
  height: 58px;
  border: 12px solid #0f172a;
  background: #fff;
  z-index: 2;
}

.qr-corner::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  background: #0f172a;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.qr-corner.tl {
  left: 26px;
  top: 26px;
}
.qr-corner.tr {
  right: 26px;
  top: 26px;
}
.qr-corner.bl {
  left: 26px;
  bottom: 26px;
}

.qr-logo {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 58px;
  height: 58px;
  transform: translate(-50%, -50%);
  border-radius: 16px;
  background: #22c55e;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 900;
  z-index: 4;
  border: 6px solid #fff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.16);
}

.qr-text {
  margin-top: 20px;
  text-align: center;
}

.qr-text h3 {
  font-size: 18px;
  color: var(--text);
  letter-spacing: -0.4px;
  margin-bottom: 6px;
}

.qr-text p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.qr-tips {
  margin-top: 14px;
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.qr-tips span {
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
}

/* === TOAST === */
.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  z-index: 999;
  transform: translateX(-50%) translateY(16px);
  background: #0f172a;
  color: #fff;
  border-radius: 999px;
  padding: 10px 20px;
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.2);
  font-size: 14px;
  font-weight: 650;
  opacity: 0;
  pointer-events: none;
  transition: 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast-success {
  background: #16a34a;
}

.toast-waring {
  background: #dc2626;
}

/* === RESPONSIVE: TABLET === */
@media (max-width: 1060px) {
  .auth-layout {
    grid-template-columns: 1fr;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
  }

  .auth-page {
    align-items: flex-start;
  }

  .qr-card {
    display: none;
  }
}

/* === RESPONSIVE: MOBILE === */
@media (max-width: 720px) {
  .auth-page {
    min-height: auto;
    padding: 28px 0;
  }

  .auth-card-top {
    align-items: flex-start;
    flex-direction: column;
  }

  .auth-body {
    padding: 18px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .code-btn {
    width: 100%;
  }

  .form-helper {
    align-items: flex-start;
    flex-direction: column;
  }

  .helper-links {
    width: 100%;
    justify-content: space-between;
  }

  .celebrate-bar {
    overflow: visible;
  }

  .celebrate-inner {
    width: min(100% - 20px, 1180px);
    min-height: auto;
    padding: 8px 0 9px;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    justify-content: center;
    gap: 5px 8px;
    font-size: 12px;
    line-height: 1.38;
    white-space: normal;
    text-align: left;
  }

  .celebrate-badge {
    padding: 3px 8px;
    font-size: 11px;
  }
  .celebrate-title {
    min-width: 0;
    white-space: normal;
    line-height: 1.38;
    font-size: 12px;
  }
  .celebrate-desc {
    grid-column: 1 / -1;
    width: 100%;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    font-size: 11.5px;
    line-height: 1.45;
    text-align: center;
  }
  .celebrate-link {
    display: none;
  }
}

/* === RESPONSIVE: SHORT VIEWPORT === */
@media (max-height: 780px) and (min-width: 1061px) {
  .auth-page {
    padding: 20px 0;
  }
  .auth-body {
    padding: 17px 22px 18px;
  }
  .form-group {
    margin-bottom: 10px;
  }
  .form-row {
    margin-bottom: 10px;
  }
  .auth-card-top,
  .qr-card-top {
    padding: 14px 20px;
  }
  .qr-card-body {
    padding: 20px;
  }
  .qr-box {
    width: 220px;
  }
  .qr-text {
    margin-top: 16px;
  }
  .qr-tips {
    margin-top: 10px;
  }
}
