:root {
  --bg-tertiary: #1a1a1a;
  --text-primary: #ffffff;
  --text-secondary: #a0a0a0;
  --text-muted: #666666;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-radius-sm: 8px;
  --border-radius-md: 12px;
  --border-radius-lg: 24px;
  --font-primary: 'Inter', sans-serif;
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
}

.auth-view { display: none; }
.auth-view.active { display: flex; flex-direction: column; gap: 16px; }

.auth-form-group { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.auth-form-group label { font-size: 0.8rem; color: rgba(255, 255, 255, 0.7); font-weight: 500; }
.auth-form-group input { width: 100%; box-sizing: border-box; }

.auth-links { display: flex; justify-content: space-between; font-size: 0.78rem; margin-top: 4px; }
.auth-links a { color: rgba(255, 255, 255, 0.6); text-decoration: none; transition: color 0.2s ease; }
.auth-links a:hover { color: #f9a900; }

.btn-text-back { background: transparent; color: rgba(255, 255, 255, 0.5); border: none; font-size: 0.8rem; cursor: pointer; text-decoration: underline; transition: color 0.2s ease; }
.btn-text-back:hover { color: #ffffff; }

.auth-input-wrapper { position: relative; display: flex; align-items: center; }
.auth-input-wrapper input { padding-right: 40px; }

.btn-toggle-password {
  position: absolute; right: 10px; background: transparent; border: none; color: rgba(255,255,255,0.5); cursor: pointer; display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; transition: color 0.2s ease;
}
.btn-toggle-password:hover { color: #ffffff; }
.btn-toggle-password svg { width: 18px; height: 18px; }

/* Glass Form Inputs */
.glass-form input[type="text"],
.glass-form input[type="email"],
.glass-form input[type="password"] {
  height: 38px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--border-radius-sm);
  color: #ffffff;
  padding: 0 12px;
  font-family: var(--font-primary);
  font-size: 16px;
  transition: all 0.3s ease;
}
.glass-form input:focus {
  background: rgba(255, 255, 255, 0.1);
  border-color: #ffffff;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.1);
  outline: none;
}

/* =========================================
   VARIABLES
========================================= */
:root {
  --theme-color: #F9A900;
  --theme-glow: rgba(249, 169, 0, 0.4);
}

/* Modals */
.modal-overlay {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); z-index: 1050; display: flex; justify-content: center; align-items: center; opacity: 0; pointer-events: none; transition: opacity 0.25s ease;
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }

.glass-modal {
  background: rgba(20, 20, 20, 0.6); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--border-color); border-radius: var(--border-radius-lg); padding: var(--spacing-xl); width: 90%; max-width: 400px; max-height: 96vh; overflow-y: auto; transform: scale(0.96); transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1); box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5); position: relative;
}
.modal-overlay.active .glass-modal { transform: scale(1); }

/* Scope auth modal specific padding-top */
#auth-modal-overlay .glass-modal,
#account-modal-overlay .glass-modal {
  padding-top: 66px !important;
}

.modal-close { position: absolute; top: 16px; right: 16px; width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.modal-close:hover { background: rgba(255,255,255,0.15); transform: rotate(90deg); }
.modal-close svg { width: 16px; height: 16px; }

/* Scope auth modal specific close button */
#auth-modal-overlay .modal-close,
#account-modal-overlay .modal-close {
  position: absolute !important;
  top: 16px !important;
  right: 16px !important;
  width: 32px !important;
  height: 32px !important;
  z-index: 11;
}

.auth-modal-top-bar {
  position: absolute !important;
  top: 16px !important;
  left: 0 !important;
  width: 100% !important;
  height: 32px !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  margin: 0 !important;
  pointer-events: none;
  z-index: 10;
}
.auth-modal-top-bar .lang-switcher {
  pointer-events: none;
}
.modal-overlay.active .auth-modal-top-bar .lang-switcher {
  pointer-events: auto;
}

/* Scope auth modal specific header styles */
#auth-modal-overlay .glass-modal .modal-header,
#account-modal-overlay .glass-modal .modal-header {
  display: block; text-align: center; margin-bottom: 18px !important; border-bottom: none; padding: 0;
}
#auth-modal-overlay .glass-modal .modal-header h2,
#account-modal-overlay .glass-modal .modal-header h2 {
  font-family: 'Bebas Neue', sans-serif; text-transform: uppercase; font-weight: 400; letter-spacing: 1px; font-size: 2.5rem; margin-bottom: 18px !important; background: linear-gradient(45deg, #E8172B, #F9A900); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
#auth-modal-overlay .glass-modal .modal-header p,
#account-modal-overlay .glass-modal .modal-header p {
  color: var(--text-secondary); font-size: 0.9rem; margin: 0;
}

.auth-providers { display: flex; flex-direction: column; gap: var(--spacing-sm); margin-top: var(--spacing-lg); }
.btn-provider { width: 100%; background: var(--bg-tertiary); border: 1px solid var(--border-color); color: var(--text-primary); padding: 12px; border-radius: var(--border-radius-sm); font-weight: 500; display: flex; align-items: center; justify-content: center; gap: 10px; cursor: pointer; transition: all 0.2s; }
.btn-provider:hover { background: rgba(255,255,255,0.05); }
.btn-provider img, .btn-provider svg { width: 20px; height: 20px; }

.auth-divider { display: flex; align-items: center; text-align: center; margin: var(--spacing-lg) 0; color: var(--text-muted); font-size: 0.8rem; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; border-bottom: 1px solid var(--border-color); }
.auth-divider span { padding: 0 var(--spacing-md); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 10px 20px; border-radius: var(--border-radius-sm); font-family: var(--font-primary); font-weight: 600; font-size: 0.9rem; cursor: pointer; transition: all 0.2s ease; border: none; gap: 8px; }
.btn-primary { background: linear-gradient(45deg, #f39c12, #e74c3c); color: white; box-shadow: 0 4px 15px rgba(243, 156, 18, 0.2); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(243, 156, 18, 0.3); }

/* Scrollbar Fix */
.glass-modal::-webkit-scrollbar { width: 6px; }
.glass-modal::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); border-radius: 10px; }
.glass-modal::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 10px; }

.btn-outline { background: transparent; color: var(--text-primary); border: 1px solid var(--border-color); }
.btn-outline:hover { background: var(--bg-secondary); }

:root { --bg-secondary: #121212; }

button { background: transparent; border: none; color: inherit; font-family: inherit; }
.btn-outline { background: transparent !important; color: #ffffff !important; border: 1px solid rgba(255,255,255,0.2) !important; }
.btn-text-back { background: transparent !important; }

.modal-close.hdr-btn-circular {
  color: #E8172B !important;
  background: rgba(232, 23, 43, 0.08) !important;
  border-color: rgba(232, 23, 43, 0.40) !important;
}
.modal-close.hdr-btn-circular:hover {
  background: rgba(232, 23, 43, 0.18) !important;
  border-color: rgba(232, 23, 43, 0.65) !important;
  box-shadow: 0 0 12px rgba(232, 23, 43, 0.30) !important;
}
.modal-close.hdr-btn-circular svg {
  stroke-width: 2.5 !important;
}

/* =========================================
   Language Switcher Styles
========================================= */
.lang-switcher {
  display: flex;
  gap: 4px;
  background: rgba(255, 255, 255, 0.03);
  padding: 4px;
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  align-items: center;
}

.lang-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 15px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
  line-height: 1;
}

.lang-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.lang-btn.active {
  background: var(--theme-color);
  color: #000000;
  box-shadow: 0 0 10px var(--theme-glow);
}

/* Mobile responsive menu adjustments */
@media (max-width: 768px) {
  nav {
    flex-wrap: wrap;
    gap: 10px;
    padding: 15px 5%;
  }
  .lang-switcher {
    padding: 2px;
  }
  .lang-btn {
    padding: 4px 8px;
    font-size: 0.7rem;
  }
}

/* Specific Overrides for consistency (scoped to auth modals) */
#auth-modal-overlay .btn, 
#auth-modal-overlay .btn-provider,
#account-modal-overlay .btn,
#account-modal-overlay .btn-provider {
  border-radius: 12px !important;
}

@media (max-width: 768px) {
  #auth-modal-overlay .glass-modal,
  #account-modal-overlay .glass-modal {
    padding-top: 66px !important;
  }
}
