/* ============================================================
   MU Miracle Mobile — Auth Page Styles
   Design: Dark fantasy, premium, glassmorphism
   ============================================================ */

/* ── CSS Custom Properties ────────────────────────────────── */
:root {
  --bg:         #060a14;
  --panel:      rgba(10, 16, 32, 0.75);
  --border:     rgba(255, 255, 255, 0.08);
  --border-h:   rgba(200, 160, 80, 0.35);
  --text:       #e8eeff;
  --muted:      #7888aa;
  --gold:       #c8a050;
  --gold-light: #ffcc66;
  --gold-glow:  rgba(200, 160, 80, 0.25);
  --blue:       #4a9fff;
  --blue-glow:  rgba(74, 159, 255, 0.20);
  --red:        #ff4d6d;
  --green:      #2ee59d;
  --radius-lg:  20px;
  --radius-md:  12px;
  --radius-sm:  8px;
  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  --font-body:  'Inter', system-ui, sans-serif;
  --font-title: 'Lora', serif;
}

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Particle Canvas ──────────────────────────────────────── */
#particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ── Glow Orbs ────────────────────────────────────────────── */
.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  animation: orbPulse 8s ease-in-out infinite;
}
.orb-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(74,159,255,0.14), transparent 70%);
  top: -200px; left: -200px;
  animation-delay: 0s;
}
.orb-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(200,160,80,0.12), transparent 70%);
  bottom: -150px; right: -150px;
  animation-delay: 3s;
}
.orb-3 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(120,60,255,0.10), transparent 70%);
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  animation-delay: 5s;
}
@keyframes orbPulse {
  0%, 100% { opacity: 0.8; transform: scale(1); }
  50%       { opacity: 1.0; transform: scale(1.08); }
}

/* ── Page Layout ─────────────────────────────────────────── */
.page {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 32px 20px 24px;
  gap: 28px;
}

/* ── Hero ─────────────────────────────────────────────────── */
.hero {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(200,160,80,0.12);
  border: 1px solid rgba(200,160,80,0.30);
  color: var(--gold-light);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  animation: fadeSlideDown 0.6s ease both;
}

.hero-title {
  font-family: var(--font-title);
  line-height: 1;
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  animation: fadeSlideDown 0.7s 0.05s ease both;
}
.title-mu {
  font-size: clamp(48px, 10vw, 72px);
  font-weight: 900;
  background: linear-gradient(135deg, #ffdd88, var(--gold), #c07020);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
  filter: drop-shadow(0 0 24px rgba(200,160,80,0.5));
}
.title-miracle {
  font-size: clamp(28px, 6vw, 44px);
  font-weight: 700;
  color: #c8d8ff;
  letter-spacing: 0.02em;
}
.title-mobile {
  font-size: clamp(14px, 3vw, 20px);
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  align-self: flex-end;
  padding-bottom: 4px;
}

.hero-sub {
  color: var(--muted);
  font-size: 14px;
  animation: fadeSlideDown 0.7s 0.10s ease both;
}
.hero-sub strong { color: var(--gold-light); }

.server-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  animation: fadeSlideDown 0.7s 0.15s ease both;
}
.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}
.stat-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.stat-green { background: var(--green); box-shadow: 0 0 8px var(--green); animation: blink 2s ease infinite; }
.stat-gold  { background: var(--gold);  box-shadow: 0 0 8px var(--gold); }
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

/* ── Auth Card ─────────────────────────────────────────────── */
.auth-card {
  width: min(460px, 100%);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04) inset,
    0 32px 64px rgba(0,0,0,0.45),
    0 0 40px rgba(74,159,255,0.06);
  animation: fadeSlideUp 0.6s 0.2s ease both;
  overflow: hidden;
}

/* ── Tabs ─────────────────────────────────────────────────── */
.tab-nav {
  position: relative;
  display: flex;
  border-bottom: 1px solid var(--border);
}

.tab {
  flex: 1;
  padding: 16px 20px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: color var(--transition);
  position: relative;
  z-index: 1;
}
.tab:hover  { color: var(--text); }
.tab.active { color: var(--gold-light); }

.tab-indicator {
  position: absolute;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  border-radius: 2px 2px 0 0;
  transition: left var(--transition), width var(--transition);
  left: 0;
  width: 50%;
  box-shadow: 0 0 10px var(--gold-glow);
}
/* Move indicator when register tab active */
.tab-nav:has(#tabRegister.active) .tab-indicator { left: 50%; }

/* ── Tab Panels ───────────────────────────────────────────── */
.tab-panel {
  padding: 28px 28px 32px;
  animation: fadeIn 0.3s ease both;
}
.tab-panel[hidden] { display: none !important; }

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

.field-group { display: flex; flex-direction: column; gap: 6px; }

.field-label {
  font-size: 13px;
  font-weight: 600;
  color: #9aaac8;
  letter-spacing: 0.02em;
}
.field-label .hint { color: var(--muted); font-weight: 400; font-size: 11px; }

.field-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.field-icon {
  position: absolute;
  left: 14px;
  width: 18px; height: 18px;
  color: var(--muted);
  display: grid;
  place-items: center;
  pointer-events: none;
  transition: color var(--transition);
  z-index: 1;
}
.field-icon svg { width: 18px; height: 18px; }

.field-input {
  width: 100%;
  padding: 12px 16px 12px 44px;
  background: rgba(10, 16, 36, 0.60);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 400;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  -webkit-appearance: none;
  appearance: none;
}
.field-input::placeholder { color: rgba(120, 136, 170, 0.55); }
.field-input:focus {
  border-color: rgba(74, 159, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(74, 159, 255, 0.12), 0 0 0 1px rgba(74,159,255,0.25) inset;
  background: rgba(10, 16, 36, 0.80);
}
.field-input:focus + .show-pass slot,
.field-wrap:focus-within .field-icon { color: var(--blue); }
.field-input.error  { border-color: rgba(255,77,109,0.6); }
.field-input.valid  { border-color: rgba(46,229,157,0.4); }

.show-pass {
  position: absolute;
  right: 10px;
  width: 32px; height: 32px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  transition: color var(--transition), background var(--transition);
}
.show-pass svg { width: 18px; height: 18px; }
.show-pass:hover { color: var(--blue); background: rgba(74,159,255,0.10); }

/* ── Password Strength ─────────────────────────────────────── */
.strength-bar-wrap {
  height: 3px;
  border-radius: 999px;
  background: rgba(255,255,255,0.07);
  overflow: hidden;
  margin-top: 4px;
}
.strength-bar-fill {
  height: 100%;
  border-radius: 999px;
  width: 0%;
  transition: width 0.4s ease, background 0.4s ease;
}
.strength-label { font-size: 11px; color: var(--muted); margin-top: 3px; min-height: 16px; }
.strength-row   { font-size: 11px; color: var(--muted); margin-top: 2px; min-height: 16px; }

/* ── Messages ─────────────────────────────────────────────── */
.form-message {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  display: none;
  animation: fadeIn 0.25s ease;
}
.form-message.error {
  display: block;
  background: rgba(255,77,109,0.12);
  border: 1px solid rgba(255,77,109,0.30);
  color: #ff8099;
}
.form-message.success {
  display: block;
  background: rgba(46,229,157,0.10);
  border: 1px solid rgba(46,229,157,0.30);
  color: var(--green);
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn-primary {
  width: 100%;
  padding: 14px 24px;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform var(--transition), filter var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #2856cc, #1a3a99);
  color: #fff;
  box-shadow: 0 4px 20px rgba(40,86,204,0.3);
  letter-spacing: 0.04em;
}
.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.10), transparent);
  pointer-events: none;
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: brightness(1.1);
  box-shadow: 0 8px 28px rgba(40,86,204,0.40);
}
.btn-primary:active:not(:disabled) { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-gold {
  background: linear-gradient(135deg, #b08820, #8a6010, #c8a050);
  box-shadow: 0 4px 20px rgba(160,120,30,0.35);
}
.btn-gold:hover:not(:disabled) {
  box-shadow: 0 8px 28px rgba(160,120,30,0.50);
}

.btn-text { position: relative; z-index: 1; }

.btn-spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  position: relative;
  z-index: 1;
}
@keyframes spin { to { transform: rotate(360deg); } }

.terms {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  line-height: 1.6;
}
.terms strong { color: var(--gold); }

/* ── Modal ────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 20, 0.80);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.3s ease;
}
.modal-backdrop[hidden] { display: none !important; }

.modal {
  position: relative;
  background: linear-gradient(160deg, rgba(14,22,44,0.95), rgba(8,14,28,0.98));
  border: 1px solid var(--border-h);
  border-radius: var(--radius-lg);
  padding: 40px 32px 32px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  box-shadow: 0 0 60px rgba(200,160,80,0.18), 0 32px 80px rgba(0,0,0,0.5);
}

.modal-glow {
  position: absolute;
  inset: -1px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(200,160,80,0.15), transparent 60%);
  pointer-events: none;
}

.modal-icon {
  font-size: 52px;
  line-height: 1;
  filter: drop-shadow(0 0 20px rgba(200,160,80,0.6));
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

.modal-title {
  font-family: var(--font-title);
  font-size: 26px;
  font-weight: 700;
  color: var(--gold-light);
}
.modal-body { color: var(--muted); font-size: 14px; line-height: 1.6; }
.modal-info {
  background: rgba(200,160,80,0.08);
  border: 1px solid rgba(200,160,80,0.20);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  width: 100%;
  font-size: 13px;
  color: var(--text);
  line-height: 1.7;
}
.modal-info strong { color: var(--gold-light); }

/* ── Footer ───────────────────────────────────────────────── */
.site-footer {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  animation: fadeIn 1s 0.5s ease both;
}
.site-footer a { color: var(--gold); text-decoration: none; }
.site-footer a:hover { color: var(--gold-light); }

/* ── Animations ───────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes fadeSlideDown {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes popIn {
  from { opacity: 0; transform: scale(0.88); }
  to   { opacity: 1; transform: scale(1); }
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 480px) {
  .page { padding: 24px 16px 20px; gap: 20px; }
  .tab-panel { padding: 22px 20px 26px; }
  .auth-card { border-radius: var(--radius-md); }
  .modal { padding: 30px 24px 26px; }
}
