/* ============================================
   C2ME - Main Stylesheet
   Dark blue/purple theme matching app
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&family=Inter:wght@400;500;600&display=swap');

:root {
  --primary: #4f9cf9;
  --primary-dark: #2563eb;
  --primary-light: #93c5fd;
  --accent: #a855f7;
  --accent-dark: #7c3aed;
  --bg-deep: #07070f;
  --bg-main: #0f0f1e;
  --bg-card: #16162a;
  --bg-input: #1e1e35;
  --bg-hover: #1a1a2e;
  --border: rgba(79,156,249,0.15);
  --border-light: rgba(255,255,255,0.06);
  --text-primary: #f0f0ff;
  --text-secondary: #8888aa;
  --text-muted: #555570;
  --online: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --success: #22c55e;
  --shadow: 0 4px 24px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 30px rgba(79,156,249,0.15);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --transition: 0.2s cubic-bezier(0.4,0,0.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ---- TYPOGRAPHY ---- */
h1, h2, h3, h4, h5 { font-family: 'Nunito', sans-serif; font-weight: 800; line-height: 1.2; }
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-light); }

/* ---- LAYOUT ---- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.container-sm { max-width: 480px; margin: 0 auto; padding: 0 20px; }
.container-md { max-width: 720px; margin: 0 auto; padding: 0 20px; }

/* ---- AUTH PAGES ---- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background:
    radial-gradient(ellipse 80% 60% at 20% -10%, rgba(79,156,249,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 110%, rgba(168,85,247,0.10) 0%, transparent 60%),
    var(--bg-deep);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 36px;
  box-shadow: var(--shadow), var(--shadow-glow);
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  justify-content: center;
}

.auth-logo .logo-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.auth-logo span {
  font-family: 'Nunito', sans-serif;
  font-size: 26px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-title { font-size: 22px; margin-bottom: 6px; text-align: center; }
.auth-subtitle { color: var(--text-secondary); text-align: center; font-size: 14px; margin-bottom: 28px; }

/* ---- FORMS ---- */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 7px; text-transform: uppercase; letter-spacing: 0.05em; }

.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 15px;
  font-family: 'Inter', sans-serif;
  padding: 12px 16px;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,156,249,0.12);
}

.form-control::placeholder { color: var(--text-muted); }

.form-control.is-error { border-color: var(--danger); }

.input-icon-wrap { position: relative; }
.input-icon-wrap .form-control { padding-left: 44px; }
.input-icon-wrap .input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.input-icon-wrap .input-eye {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  transition: color var(--transition);
}
.input-icon-wrap .input-eye:hover { color: var(--primary); }

.form-error { color: var(--danger); font-size: 12px; margin-top: 5px; display: flex; align-items: center; gap: 4px; }

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 15px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 4px 16px rgba(79,156,249,0.3);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(79,156,249,0.45);
  color: #fff;
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  box-shadow: 0 4px 16px rgba(168,85,247,0.3);
}
.btn-accent:hover:not(:disabled) { transform: translateY(-1px); color: #fff; }

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.btn-outline:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); background: rgba(79,156,249,0.05); }

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover:not(:disabled) { background: #dc2626; color: #fff; }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 12px;
}
.btn-ghost:hover { color: var(--text-primary); background: var(--bg-hover); }

.btn-full { width: 100%; }
.btn-sm { font-size: 13px; padding: 8px 16px; border-radius: var(--radius-xs); }
.btn-lg { font-size: 17px; padding: 15px 32px; }
.btn-icon { width: 40px; height: 40px; padding: 0; border-radius: 50%; }

/* Loading spinner in button */
.btn-loading .btn-text { opacity: 0.6; }
.btn-spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- ALERTS ---- */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.alert-error { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); color: #fca5a5; }
.alert-success { background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.3); color: #86efac; }
.alert-info { background: rgba(79,156,249,0.1); border: 1px solid rgba(79,156,249,0.3); color: #93c5fd; }
.alert-warning { background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.3); color: #fcd34d; }

/* ---- CARDS ---- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.card:hover { border-color: var(--border); }

/* ---- NAVBAR ---- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15,15,30,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  height: 60px;
  display: flex;
  align-items: center;
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.navbar-logo {
  font-family: 'Nunito', sans-serif;
  font-size: 22px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-decoration: none;
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.navbar-nav a {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-xs);
  transition: all var(--transition);
  text-decoration: none;
}

.navbar-nav a:hover, .navbar-nav a.active {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.navbar-actions { display: flex; align-items: center; gap: 8px; }

/* ---- AVATAR ---- */
.avatar {
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-input);
}
.avatar-sm { width: 36px; height: 36px; }
.avatar-md { width: 48px; height: 48px; }
.avatar-lg { width: 72px; height: 72px; }
.avatar-xl { width: 96px; height: 96px; }

.avatar-wrap { position: relative; display: inline-block; }
.online-dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 10px;
  height: 10px;
  background: var(--online);
  border-radius: 50%;
  border: 2px solid var(--bg-card);
}
.online-dot.offline { background: var(--text-muted); }

/* ---- BADGE ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-vip { background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; }
.badge-online { background: rgba(34,197,94,0.15); color: var(--online); border: 1px solid rgba(34,197,94,0.3); }
.badge-admin { background: rgba(239,68,68,0.15); color: #f87171; border: 1px solid rgba(239,68,68,0.3); }

/* ---- TURNSTILE ---- */
.cf-turnstile-wrap { display: flex; justify-content: center; margin: 16px 0; }

/* ---- DIVIDER ---- */
.divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 20px 0;
  color: var(--text-muted);
  font-size: 13px;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-light);
}

/* ---- MODAL ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow);
  transform: scale(0.95);
  transition: transform var(--transition);
}
.modal-overlay.open .modal { transform: scale(1); }

.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-title { font-size: 18px; font-weight: 700; }
.modal-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 20px; padding: 4px; border-radius: 4px; transition: color var(--transition); }
.modal-close:hover { color: var(--text-primary); }

/* ---- TOAST ---- */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: all;
  animation: toastIn 0.3s ease;
  max-width: 320px;
}

.toast.success { border-color: rgba(34,197,94,0.4); }
.toast.error { border-color: rgba(239,68,68,0.4); }
.toast.info { border-color: rgba(79,156,249,0.4); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ---- UTILITY ---- */
.text-primary { color: var(--primary) !important; }
.text-accent { color: var(--accent) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-danger { color: var(--danger) !important; }
.text-success { color: var(--success) !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.fw-bold { font-weight: 700; }
.fw-black { font-weight: 900; }
.fs-sm { font-size: 13px; }
.fs-xs { font-size: 11px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.w-full { width: 100%; }
.hidden { display: none !important; }

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .auth-card { padding: 28px 20px; }
  .navbar-nav { display: none; }
}