/* =========================================================
   MC Vault — Auth Pages (Login / Sign Up)
   Matches the existing site theme: matte black, dark-gray
   glass card, white text, soft Minecraft-green (#55FF55) glow.
   ========================================================= */

:root {
  --bg: #0A0A0B;
  --card: #141416;
  --card-border: rgba(255, 255, 255, 0.08);
  --text: #FFFFFF;
  --text-dim: #CFCFCF;
  --text-muted: #8A8A8E;
  --green: #55FF55;
  --green-soft: #7CFF7C;
  --green-hover: #44DD44;
  --error: #FF5C5C;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

/* Subtle noise texture — same as homepage, static & cheap */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

/* ---------- Top brand bar ---------- */
.auth-topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 24px 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.brand img { width: 32px; height: 32px; border-radius: 9px; }
.brand .green { color: var(--green); }

/* ---------- Page shell ---------- */
.auth-shell {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px 60px;
}

/* Ambient green glow behind the card — static gradient, subtle pulse */
.auth-glow {
  position: absolute;
  top: 18%;
  left: 50%;
  width: 720px;
  height: 720px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(85,255,85,0.14) 0%, rgba(85,255,85,0) 65%);
  animation: glowPulse 7s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}
@keyframes glowPulse {
  0%, 100% { opacity: 0.7; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.08); }
}

/* ---------- Floating particles (pure CSS, GPU-cheap) ---------- */
.particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.particle {
  position: absolute;
  bottom: -40px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  opacity: 0;
  box-shadow: 0 0 10px rgba(85,255,85,0.8);
  animation-name: floatUp;
  animation-timing-function: ease-in;
  animation-iteration-count: infinite;
  will-change: transform, opacity;
}
@keyframes floatUp {
  0%   { transform: translateY(0) translateX(0); opacity: 0; }
  10%  { opacity: 0.8; }
  90%  { opacity: 0.4; }
  100% { transform: translateY(-820px) translateX(var(--drift, 30px)); opacity: 0; }
}
/* Distribute particles across the width with varied size/speed/delay */
.particle:nth-child(1)  { left: 6%;  width: 4px; height: 4px; animation-duration: 14s; animation-delay: 0s;  --drift: 20px; }
.particle:nth-child(2)  { left: 16%; width: 6px; height: 6px; animation-duration: 18s; animation-delay: 2s;  --drift: -30px; }
.particle:nth-child(3)  { left: 27%; width: 3px; height: 3px; animation-duration: 12s; animation-delay: 4s;  --drift: 15px; }
.particle:nth-child(4)  { left: 38%; width: 5px; height: 5px; animation-duration: 20s; animation-delay: 1s;  --drift: -18px; }
.particle:nth-child(5)  { left: 49%; width: 4px; height: 4px; animation-duration: 15s; animation-delay: 6s;  --drift: 25px; }
.particle:nth-child(6)  { left: 61%; width: 6px; height: 6px; animation-duration: 19s; animation-delay: 3s;  --drift: -22px; }
.particle:nth-child(7)  { left: 72%; width: 3px; height: 3px; animation-duration: 13s; animation-delay: 5s;  --drift: 18px; }
.particle:nth-child(8)  { left: 83%; width: 5px; height: 5px; animation-duration: 17s; animation-delay: 2.5s; --drift: -28px; }
.particle:nth-child(9)  { left: 91%; width: 4px; height: 4px; animation-duration: 16s; animation-delay: 7s;  --drift: 20px; }
.particle:nth-child(10) { left: 10%; width: 3px; height: 3px; animation-duration: 21s; animation-delay: 8s;  --drift: -15px; }
.particle:nth-child(11) { left: 55%; width: 3px; height: 3px; animation-duration: 14s; animation-delay: 9s;  --drift: 22px; }
.particle:nth-child(12) { left: 34%; width: 4px; height: 4px; animation-duration: 22s; animation-delay: 1.5s; --drift: -20px; }

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  .particle, .auth-glow { animation: none; }
}

/* ---------- Auth Card ---------- */
.auth-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 420px;
  background: rgba(20, 20, 22, 0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 40px 36px 36px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.02);
  opacity: 0;
  transform: translateY(20px);
  animation: cardFadeUp 0.6s cubic-bezier(0.16,1,0.3,1) forwards;
  animation-delay: 0.1s;
}
@keyframes cardFadeUp {
  to { opacity: 1; transform: translateY(0); }
}

.auth-card .icon-badge {
  width: 56px;
  height: 56px;
  margin: 0 auto 20px;
  border-radius: 16px;
  background: rgba(85, 255, 85, 0.08);
  border: 1px solid rgba(85, 255, 85, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--green);
}

.auth-card h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-align: center;
  margin: 0 0 8px;
}
.auth-card .subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  margin: 0 0 30px;
  line-height: 1.5;
}

/* ---------- Form ---------- */
.auth-form { display: flex; flex-direction: column; gap: 18px; }

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.01em;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-wrap .field-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  pointer-events: none;
  display: flex;
}
.input-wrap input {
  width: 100%;
  padding: 13px 14px 13px 42px;
  border-radius: 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}
.input-wrap input::placeholder { color: var(--text-muted); }
.input-wrap input:focus {
  border-color: rgba(85,255,85,0.5);
  background: rgba(255,255,255,0.07);
  box-shadow: 0 0 0 4px rgba(85,255,85,0.08);
}
.input-wrap input.has-error {
  border-color: rgba(255,92,92,0.6);
}
.input-wrap input.has-error:focus {
  box-shadow: 0 0 0 4px rgba(255,92,92,0.1);
}

/* Password field gets extra right padding for the toggle button */
.input-wrap input[type="password"],
.input-wrap input.pw-field {
  padding-right: 44px;
}

.pw-toggle {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  transition: color 0.2s ease;
}
.pw-toggle:hover { color: var(--text); }

.field-error {
  font-size: 12.5px;
  color: var(--error);
  min-height: 16px;
  display: none;
}
.field-error.show { display: block; }

.field-hint {
  font-size: 12px;
  color: var(--text-muted);
}

/* ---------- Password strength ---------- */
.pw-strength {
  display: flex;
  gap: 5px;
  margin-top: 2px;
}
.pw-strength .bar {
  height: 3px;
  flex: 1;
  border-radius: 2px;
  background: rgba(255,255,255,0.08);
  transition: background-color 0.25s ease;
}
.pw-strength.weak .bar:nth-child(1) { background: var(--error); }
.pw-strength.medium .bar:nth-child(1),
.pw-strength.medium .bar:nth-child(2) { background: #FFC85C; }
.pw-strength.strong .bar { background: var(--green); }

/* ---------- Row helpers ---------- */
.form-row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13.5px;
}
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--text-dim);
}
.checkbox-row input { accent-color: var(--green); width: 15px; height: 15px; }

.link-green {
  color: var(--green-soft);
  font-weight: 600;
  transition: color 0.2s ease;
}
.link-green:hover { color: var(--green); text-decoration: underline; }

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  overflow: hidden;
  width: 100%;
  padding: 14px 20px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 15px;
  border: none;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.16,1,0.3,1), box-shadow 0.25s ease, opacity 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: linear-gradient(135deg, var(--green-soft), var(--green));
  color: #06120A;
}
.btn-primary:hover {
  box-shadow: 0 8px 28px rgba(85, 255, 85, 0.35);
  transform: translateY(-2px);
}
.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.btn .ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  background: rgba(0,0,0,0.25);
  pointer-events: none;
  animation: rippleAnim 0.55s ease-out forwards;
}
@keyframes rippleAnim { to { transform: scale(2.6); opacity: 0; } }

/* Spinner for loading state (shown/hidden via JS later) */
.btn .spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(6,18,10,0.3);
  border-top-color: #06120A;
  animation: spin 0.7s linear infinite;
  display: none;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn.loading .spinner { display: inline-block; }
.btn.loading .btn-label { opacity: 0.7; }

/* ---------- Divider ---------- */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 26px 0 20px;
  color: var(--text-muted);
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.08);
}

/* ---------- Footer switch link ---------- */
.auth-switch {
  text-align: center;
  margin-top: 26px;
  font-size: 14px;
  color: var(--text-muted);
}

/* ---------- Toast (for later JS use) ---------- */
.auth-toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 12px 20px;
  font-size: 14px;
  color: var(--text);
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 50;
}
.auth-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.auth-toast.error { border-color: rgba(255,92,92,0.4); }
.auth-toast.success { border-color: rgba(85,255,85,0.4); }

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
  .auth-card { padding: 32px 24px 28px; border-radius: 18px; }
  .auth-card h1 { font-size: 23px; }
}
