
:root {
  --primary: #2E8B57;        
  --primary-dark: #1E6140; 
  --primary-blue: #667eea;    
  --secondary: #F4EBD0;      
  --highlight: #FFD700;      
  --text-dark: #2F2F2F;
  --text-light: #7A7A7A;
  --white: #ffffff;
  --border: #E0E0D1;
  --shadow: rgba(0, 0, 0, 0.06);
  --radius: 14px;
    --bg-tertiary: rgba(102, 126, 234, 0.08);
}

/* ===== NAVBAR ===== */
.navbar {
  display: grid;               
  align-items: center;
  padding: 1rem 2rem;           
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px var(--shadow);
  position: sticky; top: 0; z-index: 100;
}

.navbar a:hover {
    color: var(--primary-blue);
    background-color: var(--bg-tertiary);
}

.navbar a:focus {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

.navbar.hydrating { visibility: hidden; }

.logo {
  display: flex;
  align-items: center;
  font-weight: bold;
  font-size: 1.5rem;
  color: #3f3d56;
}

.logo img {
  width: 32px;
  height: 32px;
  margin-right: 0.5rem;
}

.logo a {
  display: flex;
  align-items: center;
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--primary);
  text-decoration: none;
  gap: 0.5rem;
}

.logo i {
  font-size: 1.6rem;
  color: var(--primary);
}

.header-nav-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 32px;
  font-weight: 500;
}


/* nicer language selector */
#langSelector {
  appearance: none;
  padding: 6px 12px;
  border: 1px solid #d1d5db;         
  border-radius: 9999px;               
  background: #fff;
  font: inherit;
  line-height: 1;
  cursor: pointer;
}

@media (max-width: 900px){ #langSelector{ margin-right:0; margin-top: 10px; margin-bottom: 20px; } }

#langSelector:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-blue) 25%, transparent);
}


.header-nav-links a {
  text-decoration: none;
  color: var(--text-dark);
  font-weight: 500;
  transition: color 0.3s ease;
}

.header-nav-links a:hover {
  color: var(--primary);
}

.header-nav-buttons {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.header-nav-buttons a {
  text-decoration: none;
  color: var(--text-dark);
  font-weight: 500;
  transition: color 0.3s ease;
}

.header-nav-buttons a:hover {
  color: var(--primary);
}

.hidden {
  display: none !important;
}

.inline-block {
  display: inline-block !important;
}

/* Outline-style Login button */
#auth-buttons #login-link{
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 0.45rem 1rem;
  border-radius: 9999px;

  border: 1.5px solid color-mix(in srgb, var(--primary) 55%, #0000);
  background: rgba(255,255,255,0.7);
  color: var(--primary-dark);
  font-weight: bold;
  text-decoration: none;

  transition: background .2s ease, transform .15s ease, border-color .2s ease, color .2s ease;
}

#auth-buttons #login-link:hover{
  background: color-mix(in srgb, var(--primary) 10%, #fff);
  border-color: var(--primary);
  transform: translateY(-1px);
}

#auth-buttons #login-link:active{
  transform: translateY(0);
}

#auth-buttons #login-link:focus-visible{
  outline: 2px solid var(--primary-blue);
  outline-offset: 2px;
}

/* On mobile menu: make login full-width like a button */
@media (max-width: 900px){
  #auth-buttons #login-link{
    width: 100%;
  }
}


.signup-btn {
  background: var(--primary);
  color: white;
  padding: 0.7rem 1.2rem;
  border-radius: 30px;
  font-weight: bold;
  border: none;
  transition: background 0.3s ease, transform 0.2s;
}

.signup-btn:hover {
  background: var(--primary-dark);
  transform: scale(1.05);
}


/* Modern Authentication Modals */

.auth-modal {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.auth-modal.visible {
  opacity: 1;
  pointer-events: auto;
  animation: authModalFadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-modal[aria-hidden="true"] { display: none; }

@keyframes authModalFadeIn {
  from { 
    opacity: 0; 
    backdrop-filter: blur(0px);
  }
  to { 
    opacity: 1; 
    backdrop-filter: blur(8px);
  }
}

.auth-modal-content {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  width: 90vw;
  max-width: 420px;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.8);
  position: relative;
  transform: scale(0.95) translateY(20px);
  opacity: 0;
  transition: all 0.3s ease;
}

.auth-modal.visible .auth-modal-content {
  transform: scale(1) translateY(0);
  opacity: 1;
  animation: authModalSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes authModalSlideIn {
  from { 
    opacity: 0; 
    transform: scale(0.9) translateY(20px); 
  }
  to { 
    opacity: 1; 
    transform: scale(1) translateY(0); 
  }
}

.auth-modal-header {
  /* Softened green gradient using your palette */
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 255, 255, 0.18), transparent 55%),
    linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: var(--white);
  padding: 1.1rem 1.5rem;
  text-align: center;
  position: relative;
  border-radius: 24px 24px 0 0;  /* match modal radius if you use rounded corners */
}

.auth-modal-header h2 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.auth-close-button {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
}

.auth-close-button:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.auth-modal-body {
  padding: 1.2rem;
}

.auth-modal auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.auth-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.auth-form-group label {
  font-weight: 600;
  color: #374151;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}


.auth-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-modal input-icon {
  position: absolute;
  left: 1rem;
  font-size: 1.1rem;
  z-index: 1;
  opacity: 0.7;
}

.auth-input-wrapper input {
  width: 100%;
  padding: 0.5rem 0.5rem 0.5rem 3rem;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  font-size: 1rem;
  background: white;
  transition: all 0.3s ease;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  box-sizing: border-box;
}

.auth-input-wrapper input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  background: #fefefe;
}

.auth-input-wrapper input::placeholder {
  color: #9ca3af;
  font-weight: 400;
}

.pw-toggle{
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 6px;
  line-height: 1;
  opacity: .75;
}

.pw-toggle:hover{ opacity: 1; }

/* make room so text doesn’t go under the eye */
.auth-input-wrapper input{
  padding-right: 40px;
}

.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
}

.checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: #6b7280;
  user-select: none;
}

.checkbox-wrapper input[type="checkbox"] {
  display: none;
}

.checkmark {
  width: 18px;
  height: 18px;
  border: 2px solid #d1d5db;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  background: white;
}

/* Checked checkbox */
.checkbox-wrapper input[type="checkbox"]:checked + .checkmark {
  background: linear-gradient(
    135deg,
    var(--primary-dark),
    var(--primary)
  );
  border-color: var(--primary-dark);
}

.checkbox-wrapper input[type="checkbox"]:checked + .checkmark::after {
  content: '✓';
  color: var(--white);
  font-size: 12px;
  font-weight: bold;
}

/* Auth links (e.g. "Sign in") */
.auth-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.auth-link:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* Submit button */
.auth-submit-button {
  background: linear-gradient(
    135deg,
    var(--primary-dark) 0%,
    var(--primary) 100%
  );
  color: var(--white);
  border: none;
  border-radius: 12px;
  padding: 0.5rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-top: 0.5rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.12);
}

.auth-submit-button:hover {
  background: linear-gradient(
    135deg,
    rgba(30, 97, 64, 0.95) 0%,
    rgba(46, 139, 87, 0.95) 100%
  );
  transform: translateY(-2px);
  box-shadow: 0 8px 15px -3px rgba(0, 0, 0, 0.2);
}

.auth-submit-button:active {
  transform: translateY(0);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.button-arrow {
  font-size: 1.2rem;
  transition: transform 0.2s ease;
}

.auth-submit-button:hover .button-arrow {
  transform: translateX(2px);
}

.auth-message {
  margin-top: 1rem;
  padding: 0.75rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
  display: none;
}

.auth-message.success {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  color: #065f46;
  border: 1px solid #10b981;
  display: block;
}

.auth-message.error {
  background: linear-gradient(135deg, #fee2e2, #fecaca);
  color: #991b1b;
  border: 1px solid #ef4444;
  display: block;
}

.auth-footer {
  text-align: center;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
}

.auth-footer p {
  margin: 0;
  color: #6b7280;
  font-size: 0.9rem;
}

/* Loading state */
.auth-submit-button.loading {
  pointer-events: none;
  opacity: 0.7;
}

.auth-submit-button.loading .button-arrow {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Google Login */

.oauth-stack { display:flex; flex-direction:column; gap:12px; margin-bottom:10px; }
.btn-google{
  width:100%; display:flex; align-items:center; justify-content:center; gap:10px;
  border:1px solid var(--border, #ddd); border-radius:10px; padding:10px 14px;
  background:#fff; font-weight:600; cursor:pointer;
}
.auth-divider{
  text-align:center; font-size:.9rem; color:#666; position:relative; margin-top:4px;
}
.auth-divider::before, .auth-divider::after{
  content:""; display:inline-block; height:1px; background:#e5e5e5; width:40%;
  vertical-align:middle; margin:0 8px;
}


/* Modern Profile Dropdown Styles */

.user-profile-container {
  position: relative;
  display: flex;
  align-items: center;
}

.profile-dropdown {
  position: relative;
}

.profile-button {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 50px;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.profile-button:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.profile-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
    background: linear-gradient(
    135deg,
    var(--primary) 100%,
    var(--secondary) 20%
  );
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-initials {
  color: white;
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
}

.dropdown-arrow {
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  transition: transform 0.3s ease;
}

.profile-button.active .dropdown-arrow {
  transform: rotate(180deg);
}

/* Dropdown Menu */
.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 280px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  overflow: hidden;
}

.dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.dropdown-header {
  padding: 20px;
  background: linear-gradient(
    135deg,
    var(--primary-dark) 0%,
    var(--primary) 100%
  );
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 12px;
}


.user-avatar-large {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.user-avatar-large img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dropdown-profile-initials {
  color: white;
  font-weight: 600;
  font-size: 18px;
  text-transform: uppercase;
}

.user-details {
  display: flex;
  flex-direction: column;
}

.name {
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 2px;
}

.user-name {
  font-weight: 450;
  font-size: 14px;
  margin-bottom: 2px;
}
.user-email {
  font-size: 13px;
  opacity: 0.9;
}

.dropdown-divider {
  height: 1px;
  background: rgba(0, 0, 0, 0.1);
  margin: 8px 0;
}

.dropdown-items {
  padding: 0px 8px 8px 8px;
}

.dropdown-token-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px 8px 16px;
  border-radius: 8px;
  text-decoration: none;
  color: #333;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  border: none;
  background: none;
  width: 100%;
  cursor: pointer;
}

.dropdown-token-item i {
  color: #DAA520;          /* gold */
  font-size: 15px;         /* a touch smaller than text works well */
  margin-top: 1px;         /* tiny optical nudge for vertical centering */
}

.dropdown-token-item:hover {
  background-color: rgba(102, 126, 234, 0.1) !important;
  transform: translateX(2px);
}

.dropdown-token-item:hover i { color: #c9a227; } /* slightly darker gold */
.dropdown-token-item:hover #tokenAmount { color: #2e7d32; } /* keep green or change */
.dropdown-token-item:hover .token-label { color: #667eea; } /* or keep #666 */

.token-item {
  padding: 0px 8px 0px 8px;
}

#tokenAmount {
  font-size: 18px;
  color: #2e7d32;
}

.token-label {
  color: #666;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  text-decoration: none;
  color: #333;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  border: none;
  background: none;
  width: 100%;
  cursor: pointer;
}

.dropdown-item:hover {
  background: rgba(102, 126, 234, 0.1);
  color: #667eea;
  transform: translateX(2px);
}

.dropdown-item i {
  width: 16px;
  text-align: center;
  opacity: 0.7;
}

.dropdown-item:hover i {
  opacity: 1;
}

.logout-item {
  color: #dc3545;
}

.logout-item:hover {
  background: rgba(220, 53, 69, 0.1);
  color: #dc3545;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
}

/* 1) FIX: selector typos so styles actually apply */
.auth-modal .auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.auth-modal .input-icon {
  position: absolute;
  left: 1rem;
  font-size: 1.1rem;
  z-index: 1;
  opacity: 0.7;
}

/* 2) A11y: support aria-hidden in addition to the .visible class */
.auth-modal[aria-hidden="true"] {
  opacity: 0;
  pointer-events: none;
}

.auth-modal[aria-hidden="false"] {
  opacity: 1;
  pointer-events: auto;
  animation: authModalFadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-modal[aria-hidden="false"] .auth-modal-content {
  transform: scale(1) translateY(0);
  opacity: 1;
  animation: authModalSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 3) Small UX polish */
.auth-modal .hint {
  display: block;
  margin-top: 0.35rem;
  color: #6b7280;
  font-size: 0.8rem;
}

#verify-modal .auth-modal-body p {
  text-align: center;
  margin-bottom: 1rem;
}

#verify-email {
  word-break: break-word;
}

/* 4) Better focus states */
.auth-modal .auth-modal-content:focus-visible,
.auth-modal button:focus-visible,
.auth-modal input:focus-visible,
.auth-modal a:focus-visible {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

/* 5) Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .auth-modal,
  .auth-modal .auth-modal-content {
    animation: none !important;
    transition: none !important;
  }
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .dropdown-menu {
    width: 260px;
    right: -10px;
  }
  
  .profile-button {
    padding: 4px;
  }
  
  .profile-avatar {
    width: 32px;
    height: 32px;
  }
  
  .profile-initials {
    font-size: 12px;
  }
}

/* Animation for dropdown arrow */
@keyframes dropdownSlide {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dropdown-menu.show {
  animation: dropdownSlide 0.3s ease-out;
}

/* Smooth hover effects for better UX */
.dropdown-item {
  position: relative;
  overflow: hidden;
}

.dropdown-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
  transition: width 0.3s ease;
}

.dropdown-item:hover::before {
  width: 100%;
}

/* Focus states for accessibility */
.profile-button:focus {
  outline: 2px solid rgba(102, 126, 234, 0.5);
  outline-offset: 2px;
}

.dropdown-item:focus {
  outline: 2px solid rgba(102, 126, 234, 0.5);
  outline-offset: -2px;
}

/* Responsive design */
@media (max-width: 480px) {
  .auth-modal-content {
    width: 95vw;
    margin: 1rem;
    border-radius: 16px;
  }
  
  .auth-modal-header {
    padding: 1rem 1rem 1rem 1rem;
  }
  
  .auth-modal-header h2 {
    font-size: 1.5rem;
  }
  
  .auth-modal-body {
    padding: 1rem;
  }
  
  .form-options {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
    margin-top: 1rem;
  }

  /* Focus trap for accessibility */
  .auth-modal input:focus,
  .auth-modal button:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
  }

  /* Smooth transitions for form validation */
  .auth-input-wrapper input.invalid {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
  }

  .auth-input-wrapper input.valid {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
  }
}

@media (max-width: 900px) {
  .menu-toggle { display: block; }

  .header-nav-links {
    display: none;
    position: absolute;
    right: 1rem;
    top: 70px;
    flex-direction: column;
    gap: 1rem;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
    padding: 1rem 1.25rem;
    z-index: 2000;
  }
  .header-nav-links.active {
    display: flex;
  }
  .header-nav-links a {
    padding: 0.25rem 0.5rem;
  }
}

@media (max-width: 480px) {
  .token-label { display: none; }
}

.cookie-banner {
  position: fixed; inset: auto 0 0 0;
  background: #fff; border-top: 1px solid #e8e8e8;
  box-shadow: 0 -6px 24px rgba(0,0,0,.08);
  padding: 12px 16px; z-index: 9999;
  display: grid; gap: 10px; align-items: center;
}
.cookie-banner p { margin: 0; font-size: .95rem; line-height: 1.35; text-align: center; }
.cookie-actions { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.cookie-actions button {
  padding: 8px 12px; border-radius: 8px; border: 1px solid #ddd; cursor: pointer; font-weight: 600;
}
.cookie-actions #accept-all { border-color: transparent; background: #111; color: #fff; }
.cookie-banner.hidden { display: none; }

dialog.cookie-modal {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  margin: 0; z-index: 10000; padding: 0; border: none;
  border-radius: 12px; max-width: 520px; width: min(92vw, 520px);
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
}
dialog.cookie-modal::backdrop { background: rgba(0,0,0,.35); }

.cookie-modal .cm-body { padding: 18px 20px; }
.cookie-modal .cm-row { display:flex; justify-content:space-between; align-items:center; gap:10px; }
.cookie-modal .cm-tile { display:flex; justify-content:space-between; align-items:center; gap:12px; border:1px solid #eee; border-radius:10px; padding:10px 12px; }
.cookie-modal .cm-actions { display:flex; justify-content:flex-end; gap:8px; margin-top:16px; }


/* Optional: small “Manage cookies” link style if you add it in header menu */
.manage-cookies-link { font-size: .9rem; opacity: .8; }

/* ---------- Name + badge layout ---------- */
.user-details .name-row{
  display:flex;
  align-items:center;
  gap:.5rem;
  min-width:0;                 /* enables ellipsis */
}

.user-details .name{
  font-weight:700;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;      /* long names truncate gracefully */
  flex:1 1 auto;               /* take remaining space */
}

/* Badge never shrinks; name gets the flex */
.tier-badge{ flex:0 0 auto; }

/* Wrap badge below name if space is tight */
@media (max-width: 520px){
  .user-details .name-row{ flex-wrap:wrap; }
  .tier-badge{ margin-top:.25rem; }
}

/* Ultra-narrow: icon-only badge */
@media (max-width: 360px){
  .tier-badge .tb-text{ display:none; }
  .tier-badge{ padding:.35rem .45rem; }
}

/* ---------- Pretty tier pill ---------- */
.tier-badge{
  --bg: rgba(255,255,255,.18);
  --bd: rgba(255,255,255,.28);
  --fg: #fff;

  display:inline-flex;
  align-items:center;
  gap:.4rem;

  padding:.35rem .6rem;
  border-radius:999px;
  border:1px solid var(--bd);
  background: var(--bg);
  color: var(--fg);

  font-weight:700;
  font-size:.70rem;
  letter-spacing:.06em;
  text-transform: uppercase;

  box-shadow:
    0 1px 0 rgba(255,255,255,.35) inset,
    0 6px 14px rgba(0,0,0,.08);
  backdrop-filter: blur(6px);
}

.tier-badge i{
  font-size:.8rem;
  line-height:1;
  opacity:.95;
}

/* Themes per tier */
.tier-badge.free{
  --bg: rgba(255,255,255,.16);
  --bd: rgba(255,255,255,.28);
  --fg: #f5f8ff;
}

.tier-badge.plus{
  --bg: linear-gradient(135deg,#EAF4FF,#D7ECFF);
  --bd: #bcd8ff;
  --fg: #0a4ea3;
  box-shadow:
    0 1px 0 rgba(255,255,255,.7) inset,
    0 8px 18px rgba(25,90,180,.15);
}

.tier-badge.premium{
  --bg: linear-gradient(135deg,#FFE7A0,#FFD36B);
  --bd: #e4b64c;
  --fg: #5a3b00;
  box-shadow:
    0 1px 0 rgba(255,255,255,.85) inset,
    0 10px 22px rgba(160,110,0,.22);
}

/* Optional dark-mode tweak */
@media (prefers-color-scheme: dark){
  .tier-badge.free{ --fg:#eaf1ff; }
}

/* =============================
   Welcome / Onboarding modal
============================= */

/* Make the welcome modal a bit wider */
#welcome-modal .auth-modal-content {
  max-width: 720px;          /* wider than default auth modals */
  width: 100%;
}

/* On small screens keep it comfy */
@media (max-width: 600px) {
  #welcome-modal .auth-modal-content {
    max-width: 100%;
    margin: 16px;
  }
}

/* Highlight block with bonus tokens */
.welcome-highlight {
  margin-top: 8px;
  margin-bottom: 18px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f3fbf5;
  border: 1px solid #e0f1e4;
}

.welcome-highlight h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.welcome-highlight p {
  margin: 0;
}

/* How it works list */
.welcome-steps {
  margin-top: 12px;
}

.welcome-steps h3 {
  margin-bottom: 6px;
  font-size: 1rem;
}

.welcome-steps ol {
  margin: 0 0 4px 1.2rem;
  padding: 0;
}

.welcome-steps li {
  margin-bottom: 4px;
}

/* =============================
   Tariffs table inside welcome
============================= */

.welcome-tariffs {
  margin-top: 20px;
}

.welcome-tariffs h3 {
  margin-bottom: 8px;
  font-size: 1rem;
}

.welcome-tariffs-table {
  border-radius: 12px;
  background: #f7faf7;
  padding: 8px 12px;
  border: 1px solid #e0efe0;
  font-size: 0.9rem;
}

.wt-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  align-items: center;
  padding: 6px 0;
}

.wt-row + .wt-row {
  border-top: 1px solid #e4ece4;
}

.wt-header {
  font-weight: 600;
  color: #334;
  border-bottom: 1px solid #e4ece4;
  padding-bottom: 6px;
  margin-bottom: 2px;
}

.wt-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: #e1f5e8;
  font-weight: 600;
  white-space: nowrap;
}

@media (max-width: 900px) {
  #langSelector { margin-right: 0; }
}

/* Make modal content fit viewport and allow internal scrolling */
#welcome-modal .auth-modal-content{
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 48px); /* leave some breathing room */
}

/* Scroll only the body, keep header visible */
#welcome-modal .auth-modal-body{
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 56px; /* reserve space for sticky button */
}

#welcome-start-btn{
  margin-top: 20px;
}

@media (max-height: 760px){
  #welcome-modal .auth-modal-content{
    max-height: calc(100vh - 24px);
  }
}

body.modal-open {
  overflow: hidden;
}

/* =========================
   MOBILE HEADER FIX
   ========================= */

@media (max-width: 900px) {
  .navbar{
    /* ditch the 3-col grid on mobile */
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0.65rem 0.9rem; /* tighter */
    gap: 10px;
    overflow-x: clip; /* prevents tiny overflow from shadows/icons */
  }

  /* logo becomes compact */
  .logo a{
    font-size: 1.15rem;
    gap: 0.45rem;
  }
  .logo i{ font-size: 1.25rem; }

  /* keep right controls compact */
  .right-controls{
    gap: 10px;
    flex: 0 0 auto;
  }

  /* language selector smaller */
  #langSelector{
    padding: 15px 15px;
    font-size: 0.95rem;
    max-width: 140px;
    margin-bottom: 10px;
  }

  /* menu toggle visible + tappable */
  .menu-toggle{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
  }

  /* if the profile button exists, keep it tight */
  .profile-button{
    padding: 4px;
  }
}



/* Ultra small phones */
@media (max-width: 420px){

  #langSelector{
    max-width: 110px;
    font-size: 0.9rem;
    margin-bottom: 10px;
  }
}

/* Ultra small phones */
@media (max-width: 360px){
  /* hide brand text, keep icon */
  .logo span{ display: none; }
}

@media (max-width: 420px){
  .dropdown-menu{
    width: min(92vw, 320px);
    right: 0;
  }
}

/* Utility */
.sr-only{
  position:absolute; width:1px; height:1px; padding:0; margin:-1px;
  overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0;
}

@media (max-width: 900px){
  /* Top bar */
  .navbar{
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding: 0.65rem 0.9rem;
    gap: 10px;
  }

  .menu-toggle{ display:inline-flex; }

  /* Mobile panel */
  .header-nav-links{
    display:none;
    position:absolute;
    left: 12px;
    right: 12px;
    top: 62px;
    flex-direction:column;
    align-items:stretch;
    gap: 10px;

    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(12px);
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
    padding: 12px;
    z-index: 2000;
  }

  .header-nav-links.active{ display:flex; }

  /* Make nav links full width, easy to tap */
  .header-nav-links a{
    display:block;
    padding: 10px 12px;
    border-radius: 10px;
  }

  /* Divider inside panel */
  .mobile-divider{
    height:1px;
    background: rgba(0,0,0,0.08);
    margin: 4px 0;
  }

  /* Language row inside panel */
  .mobile-lang #langSelector{
    width:100%;
    margin-right: 0;     /* important: kills your 35px */
    max-width: none;
  }

  /* Auth buttons inside panel */
  #auth-buttons{
    display:flex;        /* your .hidden will still override when needed */
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
  }

  #auth-buttons a{
    padding: 10px 12px;
    border-radius: 10px;
  }

  #auth-buttons .signup-btn{
    width:100%;
    justify-content:center;
  }

  /* Profile dropdown inside panel: full width */
  #user-info{ width:100%; }
  .profile-button{
    width:100%;
    justify-content:space-between;
    padding: 8px 10px;
    border-radius: 12px;
  }

  /* Make the dropdown menu not overflow on mobile */
  .dropdown-menu{
    position: static;   /* so it flows within panel */
    width: 100%;
    margin-top: 8px;
    right:auto;
    top:auto;
    display: none;
    opacity: 1;
    transform:none;
    box-shadow: 0 10px 24px rgba(0,0,0,0.12);
  }

  /* When shown, keep it visible (since we removed absolute transforms) */
  .dropdown-menu.show{
    display: block; 
    visibility:visible;
  }
}

/* Desktop header alignment */
@media (min-width: 901px) {
  .right-controls{ display:none !important; }

  .navbar{
    display: grid;
    grid-template-columns: auto 1fr auto; /* logo | center | right */
    align-items: center;
  }

  /* nav spans the middle column and becomes a 2-zone flex row */
  .header-nav-links{
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;                 /* wrappers handle spacing */
    position: static;
  }

  .nav-primary{
    display: flex;
    align-items: center;
    justify-content: center; /* CENTER the 3 links */
    gap: 32px;
    flex: 1 1 auto;
    min-width: 0;
  }

  .nav-secondary{
    display: flex;
    align-items: center;
    justify-content: flex-end; /* RIGHT side */
    gap: 35px;
    flex: 0 0 auto;
  }

  /* divider is mobile-only */
  .nav-secondary .mobile-divider{ display: none; }

  /* keep auth buttons in a row on desktop */
  #auth-buttons{
    flex-direction: row;
    gap: 1.5rem;
    align-items: center;
  }

  /* undo any mobile-only select width rules */
  .mobile-lang #langSelector{
    width: auto;
    max-width: none;
  }
}


.header-token-pill{
  display:inline-flex;
  align-items:center;
  gap:.4rem;
  padding:.35rem .6rem;
  border:1px solid rgba(0,0,0,.12);
  border-radius:999px;
  text-decoration:none;
  font-weight:600;
  font-size:.95rem;
  line-height:1;
  background:rgba(255,255,255,.8);
  white-space:nowrap;
  margin-right: 25px;
}

.header-token-pill i{ color:#DAA520; }

.right-controls{
  display:flex;
  align-items:center;
  gap:12px;
}

/* compact pill look */
.header-token-pill.is-compact{
  margin-right: 0;
  padding: .3rem .5rem;
  font-size: .9rem;
}

/* mobile-only pill */
@media (min-width: 901px){
  #headerTokenPillMobile{ display:none !important; }
}
@media (max-width: 900px){
  /* your desktop pill inside the menu can stay, or hide it if you want */
  #headerTokenPill{ display:none !important; } /* optional */
}

