/* Auth pages — unified modern style for login / register / verify / google_complete.
   Dark theme matching vfun-scan welcome aesthetic: tall centered card, soft
   accent glow, clean typography, accessible focus rings. */

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg, #0b0e15);
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  position: relative;
  overflow-x: hidden;
}

/* Subtle radial accent glow centered behind card. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 720px 560px at 50% 38%, rgba(110, 231, 183, 0.07), transparent 70%);
  z-index: 0;
}

.auth-shell {
  position: relative;
  z-index: 1;
  width: min(480px, 92vw);
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 28px 0;
}

.auth-brand-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.auth-brand-img {
  display: block;
  width: min(260px, 64vw);
  height: auto;
  max-height: 56px;
  object-fit: contain;
}

/* Main card — login / register / verify / register (google_complete) share this. */
.card {
  width: 100%;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 32px 28px 28px;
  box-shadow: 0 24px 60px -28px rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.login, .register, .verify { width: 100%; }

/* Top row: tabs (login ↔ register) + lang selector. */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 14px;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.tabs {
  display: flex;
  gap: 24px;
  align-items: flex-end;
}

.tab {
  position: relative;
  padding: 6px 0;
  border: 0;
  background: transparent;
  text-decoration: none;
  color: rgba(234, 236, 239, 0.6);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  transition: color 0.15s ease;
}

.tab::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -13px;
  height: 2px;
  background: transparent;
  border-radius: 1px;
  transition: background-color 0.18s ease;
}

.tab:hover { color: #fff; }
.tab.active { color: #fff; font-weight: 600; }
.tab.active::after { background: var(--accent, #6ee7b7); }
.tab.disabled { opacity: 0.4; pointer-events: none; }

/* Verify page header (instead of tabs). */
.verify-head { padding-bottom: 4px; }
.verify-title {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.005em;
}
.verify-sub {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: rgba(234, 236, 239, 0.65);
}
.verify-sub b {
  color: #fff;
  font-weight: 600;
}

/* Lang switcher — minimal, top-right of card. */
.lang-form {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  color: rgba(234, 236, 239, 0.55);
  transition: color 0.15s ease;
}
.lang-form:hover, .lang-form:focus-within { color: var(--accent, #6ee7b7); }

.lang-icon {
  position: relative;
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  opacity: 0.85;
}
.lang-icon::before {
  content: "";
  position: absolute;
  top: -1.5px;
  bottom: -1.5px;
  left: 4px;
  right: 4px;
  border-left: 1px solid currentColor;
  border-right: 1px solid currentColor;
  border-radius: 50%;
  opacity: 0.65;
}
.lang-icon::after {
  content: "";
  position: absolute;
  top: 5.5px;
  left: 2px;
  right: 2px;
  border-top: 1px solid currentColor;
  opacity: 0.65;
}

.lang-select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-width: 34px;
  height: 22px;
  padding: 0 9px 2px 0;
  border-bottom: 1.5px solid currentColor;
}
.lang-select-wrap::after {
  content: "";
  position: absolute;
  right: 0;
  top: 6px;
  width: 4px;
  height: 4px;
  border-right: 1.3px solid currentColor;
  border-bottom: 1.3px solid currentColor;
  transform: rotate(45deg);
  pointer-events: none;
  opacity: 0.9;
}
.lang-current {
  min-width: 21px;
  font-size: 12px;
  line-height: 1;
  text-align: right;
  pointer-events: none;
}
.lang-select {
  position: absolute;
  inset: -7px -6px -7px -6px;
  width: calc(100% + 12px);
  height: calc(100% + 14px);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font-size: 13px;
  cursor: pointer;
  opacity: 0;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}
.lang-select:focus { outline: none; }

/* Input rows — common across login/register. */
.login .row, .register .row, .verify .row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 14px 0;
}

.login input, .register input, .verify input {
  width: 100%;
  padding: 13px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.32);
  color: var(--text, #eaecef);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.4;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.login input::placeholder,
.register input::placeholder,
.verify input::placeholder {
  color: rgba(234, 236, 239, 0.4);
}
.login input:focus,
.register input:focus,
.verify input:focus,
.login input:focus-visible,
.register input:focus-visible,
.verify input:focus-visible {
  outline: none;
  border-color: var(--accent, #6ee7b7);
  box-shadow: 0 0 0 3px rgba(110, 231, 183, 0.15);
  background: rgba(0, 0, 0, 0.4);
}
.login input:-webkit-autofill,
.register input:-webkit-autofill,
.verify input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px rgba(0, 0, 0, 0.32) inset !important;
  -webkit-text-fill-color: inherit !important;
  caret-color: inherit;
  transition: background-color 9999s ease-in-out 0s;
}

/* Verify code input — bigger, monospace, centered with letter spacing. */
.verify input.code-input {
  padding: 16px 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 14px;
  text-align: center;
  padding-left: 22px;
}
.verify input.code-input::placeholder { letter-spacing: 14px; }

/* Primary submit button (.btn) — full-width accent. */
.login .btn, .register .btn, .verify .btn {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 0;
  background: var(--accent, #6ee7b7);
  color: #0b1117;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  margin-top: 4px;
}
.login .btn:hover, .register .btn:hover, .verify .btn:hover {
  filter: brightness(1.06);
  box-shadow: 0 8px 20px -8px rgba(110, 231, 183, 0.4);
  transform: translateY(-1px);
}
.login .btn:active, .register .btn:active, .verify .btn:active {
  transform: translateY(0);
}

/* Google sign-in button — official branding. */
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #dadce0;
  background: #ffffff;
  color: #1f1f1f;
  font-family: 'Google Sans', 'Roboto', system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.2px;
  text-decoration: none;
  margin-top: 12px;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
}
.btn-google:hover {
  background: #f8f9fa;
  box-shadow: 0 1px 3px rgba(60, 64, 67, 0.18);
}
.btn-google:active { background: #f1f3f4; }
.btn-google svg { flex: 0 0 18px; }

/* Divider "or" between primary form and Google button. */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 0;
  color: rgba(234, 236, 239, 0.4);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

/* Error / success messages. */
.err {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 122, 122, 0.08);
  border: 1px solid rgba(255, 122, 122, 0.25);
  color: #ffb4b4;
  font-size: 13px;
  line-height: 1.4;
}
.ok {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(110, 231, 183, 0.08);
  border: 1px solid rgba(110, 231, 183, 0.25);
  color: #b7f7cb;
  font-size: 13px;
  line-height: 1.4;
}

.meta {
  margin-top: 16px;
  font-size: 12px;
  color: rgba(234, 236, 239, 0.55);
  text-align: center;
  line-height: 1.5;
}

/* Renew block on /login page (account renewal flow). */
.renew {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.renew h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}
.renew p {
  margin: 6px 0 0;
  font-size: 12.5px;
  color: rgba(234, 236, 239, 0.6);
  line-height: 1.5;
}

/* Verify footer (resend / back to register). */
.verify-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.verify-resend {
  background: none;
  border: 0;
  padding: 4px 8px;
  color: var(--accent, #6ee7b7);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}
.verify-resend:hover { text-decoration: underline; }
.verify-back {
  font-size: 12.5px;
  color: rgba(234, 236, 239, 0.5);
  text-decoration: none;
}
.verify-back:hover { color: rgba(234, 236, 239, 0.9); }

/* Google account badge on /auth/google/complete. */
.google-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
  color: rgba(234, 236, 239, 0.85);
}
.google-badge svg { flex: 0 0 16px; }

/* Responsive tweaks. */
@media (max-width: 520px) {
  .auth-shell { padding: 14px 0; gap: 18px; }
  .card { padding: 24px 20px 22px; border-radius: 14px; }
  .topbar { flex-wrap: wrap; gap: 10px; }
  .tabs { gap: 18px; }
  .tab { font-size: 13.5px; }
  .auth-brand-img { max-height: 48px; }
}
