/* ===== Royal Dent Club – Enhanced Global Styles (White/Gloomy) ===== */
/* RTL (Persian) optimized – Premium dental clinic customer club UI */

/* ----- FONT SYSTEM (self-hosted Persian fonts) ----- */
@import url('./fonts.css');

/* Fallback for Persian fonts */
@font-face {
  font-family: 'Shabnam-fallback';
  src: local('Shabnam'), local('IRANSans'), local('Vazir'), local('Tahoma');
  font-display: swap;
}

:root {
  /* Override design system colors for RTL context if needed */
  --surface-0: var(--color-bg-base);
  --surface-1: var(--color-bg-surface);
  --surface-2: #FAFAFD;
  --bg-gradient: linear-gradient(165deg, var(--color-bg-base) 0%, var(--color-bg-surface) 42%, #FAFAFD 100%);
  --text-color: var(--color-text-primary);
  --text-muted: var(--color-text-secondary);
  --card-bg: var(--color-bg-card);
  --card-bg-strong: var(--color-bg-card-hover);
  --accent: var(--color-accent-primary);
  --accent-2: var(--color-accent-secondary);
  --accent-soft: rgba(106, 90, 205, 0.08);
  --accent-glow: var(--color-accent-glow);
  --border: var(--color-border-subtle);
  --border-focus: var(--color-border-glow);
  --ok: #059669;
  --warn: #d97706;
  --bad: #dc2626;

  /* Button gradients */
  --btn-primary-bg: var(--color-accent-gradient);
  --btn-primary-color: #ffffff;
  --btn-secondary-bg: linear-gradient(145deg, #8B7FBF 0%, #A89FD4 100%);
  --btn-secondary-color: #ffffff;
  --btn-ghost-bg: rgba(106, 90, 205, 0.05);
  --btn-ghost-border: var(--color-border-glow);

  /* Radii & Shadows */
  --radius-xs: var(--radius-sm);
  --radius-sm: var(--radius-md);
  --radius-md: var(--radius-lg);
  --radius-lg: var(--radius-xl);
  --radius-xl: 28px;
  --radius-pill: var(--radius-full);
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.06);
  --shadow-xl: 0 24px 56px rgba(0, 0, 0, 0.08);
  --shadow-2: var(--shadow-md);
  --shadow-inset: inset 0 1px 3px rgba(0,0,0,0.03);

  /* Typography */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --leading-tight: 1.3;
  --leading-normal: 1.6;
  --leading-relaxed: 1.8;

  /* Layout */
  --header-h: 72px;
  --container-max: 1200px;
  --content-pad: 1.5rem;
  --break-sm: 640px;
  --break-md: 900px;
  --break-lg: 1200px;
}

/* ----- RESET & BASE ----- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: "Shabnam", "Shabnam-fallback", sans-serif;
  font-size: var(--text-base);
  font-weight: 400;
  line-height: var(--leading-normal);
  color: var(--text-color);
  background: var(--bg-gradient);
  overflow-x: hidden;
  position: relative;
  transition: background 0.5s, color 0.3s;
}

/* Enforce font-family on all text elements */
h1, h2, h3, h4, h5, h6,
p, span, div, a, button, input, select, textarea, label,
li, blockquote, pre, code, .btn, .card, .pill {
  font-family: "Shabnam", "Shabnam-fallback", sans-serif !important;
}

/* ----- ANIMATIONS ----- */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

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

/* ----- TYPOGRAPHY ----- */
h1, h2, h3, h4 {
  font-weight: 800;
  line-height: var(--leading-tight);
  letter-spacing: 0;
}
h1 { font-size: clamp(1.875rem, 5vw, 3rem); margin-bottom: 0.5rem; }
h2 { font-size: clamp(1.5rem, 4vw, 2.25rem); margin-bottom: 0.5rem; }
h3 { font-size: var(--text-xl); margin-bottom: 0.35rem; }
h4 { font-size: var(--text-lg); margin-bottom: 0.25rem; }

p { margin-bottom: 0.75rem; }
.lead {
  font-size: var(--text-lg);
  font-weight: 500;
  color: var(--text-color);
  opacity: 0.9;
  margin-bottom: 1.25rem;
}
.muted {
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-weight: 400;
}

/* ----- LAYOUT COMPONENTS ----- */
.page-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.main-content {
  flex: 1;
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding: var(--content-pad);
  padding-top: 1rem;
  padding-bottom: 2.5rem;
  min-height: 0;
}

@media (max-width: 480px) {
  .main-content {
    padding: 1rem 0.85rem 2rem;
  }
}

.container {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 1.75rem var(--content-pad);
  background: var(--card-bg);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  animation: fadeSlideUp 0.4s cubic-bezier(0.2, 0.9, 0.4, 1);
  transition: background 0.3s, box-shadow 0.3s;
}

.main-content-wrap {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: transparent;
}

body > .container:not(.login-container):not(.signup-container),
.main-content > .container {
  max-width: none;
  min-height: 0;
  margin: 0;
  border-radius: 0;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: transparent;
  animation: none;
}

/* ----- HEADER / NAV ----- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1rem, 4vw, 3rem);
  height: var(--header-h);
  background: transparent;
  transition: background 0.3s ease, backdrop-filter 0.3s ease, border-bottom 0.3s ease;
}

.site-header.scrolled,
.site-header.site-header--solid {
  background: rgba(248, 248, 252, 0.85);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.02);
}

/* On pages without a hero, the fixed header otherwise floats invisibly over a bare
   gradient band (looks like a blank section). The solid variant defines that bar, and
   we tighten the gap below it so page content sits close to the header. */
.page-no-hero .main-content-wrap {
  padding-top: 0.25rem;
}

.site-header .brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-color);
  text-decoration: none;
  transition: var(--transition-base);
  position: relative;
}

.site-header .brand::before {
  content: '';
  position: absolute;
  right: -0.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 24px;
  background: var(--accent);
  border-radius: var(--radius-full);
  opacity: 0.6;
}

.site-header .brand:hover {
  text-shadow: 0 0 20px var(--accent-glow);
}

.site-header .logo img {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
}

.nav-links {
  display: none;
  align-items: center;
  gap: 2rem;
}

@media (min-width: 768px) {
  .nav-links {
    display: flex;
  }
}

.nav-links a {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-muted);
  position: relative;
  transition: var(--transition-base);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--transition-base);
}

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

.nav-links a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav-links a.active {
  background: var(--color-accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Hamburger */
.hamburger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001;
}

@media (min-width: 768px) {
  .hamburger {
    display: none;
  }
}

.hamburger-icon {
  position: relative;
  width: 24px;
  height: 18px;
}

.hamburger-icon span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--text-color);
  border-radius: var(--radius-full);
  transition: var(--transition-base);
}

.hamburger-icon span:nth-child(1) { top: 0; }
.hamburger-icon span:nth-child(2) { top: 50%; transform: translateY(-50%); }
.hamburger-icon span:nth-child(3) { bottom: 0; }

.hamburger.active .hamburger-icon span:nth-child(1) {
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
}

.hamburger.active .hamburger-icon span:nth-child(2) {
  opacity: 0;
}

.hamburger.active .hamburger-icon span:nth-child(3) {
  bottom: 50%;
  transform: translateY(50%) rotate(-45deg);
}

/* Mobile nav overlay */
.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}

.nav-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 85vw);
  background: var(--color-bg-surface);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  padding: calc(var(--header-h) + 1rem) 2rem 2rem;
  transform: translateX(100%);
  transition: transform var(--transition-slow);
  overflow-y: auto;
}

.nav-drawer.active {
  transform: translateX(0);
}

.nav-drawer .nav-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.nav-drawer .nav-links a {
  font-size: var(--text-base);
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.nav-drawer.active .nav-links a {
  opacity: 1;
  transform: translateX(0);
}

.nav-drawer.active .nav-links a:nth-child(1) { transition-delay: 0.05s; }
.nav-drawer.active .nav-links a:nth-child(2) { transition-delay: 0.1s; }
.nav-drawer.active .nav-links a:nth-child(3) { transition-delay: 0.15s; }
.nav-drawer.active .nav-links a:nth-child(4) { transition-delay: 0.2s; }
.nav-drawer.active .nav-links a:nth-child(5) { transition-delay: 0.25s; }

/* ----- BUTTONS ----- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.5rem;
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  transition: var(--transition-base);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-color);
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
  box-shadow: var(--shadow-glow-strong);
  transform: translateY(-1px) scale(1.02);
}

.btn-primary:active {
  transform: translateY(0) scale(0.98);
}

.btn-secondary {
  background: var(--btn-secondary-bg);
  color: var(--btn-secondary-color);
}

.btn-secondary:hover {
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}

.btn-ghost {
  background: var(--btn-ghost-bg);
  color: var(--accent);
  border: 1px solid var(--btn-ghost-border);
}

.btn-ghost:hover {
  background: rgba(106, 90, 205, 0.1);
  border-color: var(--accent);
}

.btn-logout-club {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-logout-club:hover {
  background: rgba(220, 38, 38, 0.05);
  color: var(--bad);
  border-color: var(--bad);
}

/* ----- CARDS ----- */
.card, .club-card, .dash-card, .blog-card {
  background: var(--card-bg);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  transition: var(--transition-base);
  position: relative;
  overflow: hidden;
}

.card::before, .club-card::before, .dash-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top left, rgba(106, 90, 205, 0.05), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.card:hover, .club-card:hover, .dash-card:hover {
  background: var(--card-bg-strong);
  border-color: var(--border-focus);
  transform: translateY(-4px);
  box-shadow: var(--shadow-card), var(--shadow-glow);
}

.card:hover::before, .club-card:hover::before, .dash-card:hover::before {
  opacity: 1;
}

/* Clickable cards */
.club-card[data-href],
.dash-card[data-href] {
  cursor: pointer;
}

/* ----- FORMS ----- */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 0.5rem;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: var(--text-base);
  font-family: inherit;
  color: var(--text-color);
  background: var(--color-bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: var(--transition-base);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

/* ----- TABLES ----- */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  background: var(--card-bg);
  padding: 0.25rem;
}

.table-wrap table {
  min-width: 500px;
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.table-wrap th {
  background: var(--accent);
  color: white;
  padding: 0.9rem 1rem;
  font-weight: 700;
  text-align: center;
}

.table-wrap td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border);
}

.table-wrap tr:last-child td {
  border-bottom: none;
}

.table-wrap tr:hover td {
  background: rgba(106, 90, 205, 0.03);
}

/* ----- MODAL ----- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-backdrop.show {
  display: flex;
}

.modal-box {
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--card-bg-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  box-shadow: var(--shadow-xl);
  animation: fadeSlideUp 0.3s ease;
}

/* ----- UTILITIES ----- */
.row {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.hide {
  display: none !important;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.9rem;
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 700;
  background: var(--card-bg-strong);
  border: 1px solid var(--border);
  color: var(--text-color);
}

/* Badge/Pill for sections */
.section-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 1rem;
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: rgba(106, 90, 205, 0.08);
  border: 1px solid var(--border-focus);
  color: var(--accent-2);
  margin-bottom: 1rem;
}

/* Focus visible for accessibility */
button:focus-visible,
a:focus-visible,
[role="button"]:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* Retired animated background layers */
#particles,
#dent-icons {
  display: none !important;
}

/* Add space for fixed header */
body {
  padding-top: var(--header-h);
}

/* ----- FOOTER ----- */
.site-footer {
  position: relative;
  background: var(--color-bg-surface);
  border-top: 1px solid var(--color-border-subtle);
  overflow: hidden;
}

.site-footer::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--color-accent-gradient);
}

.footer-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 3rem clamp(1.5rem, 5vw, 3rem) 2.5rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

@media (min-width: 640px) {
  .footer-inner { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 900px) {
  .footer-inner { grid-template-columns: 1.6fr 1fr 1fr; gap: 3rem; }
}

.footer-brand { display: flex; flex-direction: column; gap: 1rem; }

.footer-brand-logo { display: flex; align-items: center; gap: 0.65rem; }

.footer-brand-logo img { width: 36px; height: 36px; border-radius: var(--radius-sm); }

.footer-brand-name { font-size: var(--text-lg); font-weight: 800; color: var(--text-color); }

.footer-brand-desc {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.75;
  max-width: 300px;
}

.footer-section-title {
  font-size: var(--text-xs);
  font-weight: 800;
  color: var(--text-color);
  margin-bottom: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  position: relative;
  padding-bottom: 0.5rem;
}

.footer-section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 24px; height: 2px;
  background: var(--color-accent-gradient);
  border-radius: var(--radius-full);
}

.footer-links { display: flex; flex-direction: column; gap: 0.65rem; }

.footer-links a {
  font-size: var(--text-sm);
  color: var(--text-muted);
  transition: color 0.2s ease, transform 0.2s ease;
  display: inline-block;
}

.footer-links a:hover { color: var(--accent); transform: translateX(-4px); }

.footer-contact-item {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 0.75rem;
}

.footer-contact-item strong {
  color: var(--text-color);
  display: block;
  font-weight: 700;
  margin-bottom: 0.15rem;
}

.footer-contact-item a { color: var(--accent); font-weight: 600; }
.footer-contact-item a:hover { color: var(--accent-2); }

.footer-copy {
  background: rgba(0, 0, 0, 0.025);
  border-top: 1px solid var(--color-border-subtle);
  padding: 1.25rem clamp(1.5rem, 5vw, 3rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.footer-copy p { font-size: var(--text-xs); color: var(--text-muted); margin: 0; }

.footer-copy-link { font-size: var(--text-xs); color: var(--text-muted); transition: color 0.2s; }
.footer-copy-link:hover { color: var(--accent); }

/* ----- SECTION SYSTEM ----- */
.rd-section { padding: clamp(3rem, 6vw, 5rem) 0; }

.rd-section-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 5vw, 3rem);
}

.rd-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 1rem;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: rgba(106, 90, 205, 0.08);
  border: 1px solid var(--color-border-glow);
  color: var(--accent-2);
  margin-bottom: 1.25rem;
}

.rd-section-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  color: var(--text-color);
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

.rd-section-sub {
  font-size: var(--text-lg);
  color: var(--text-muted);
  max-width: 560px;
  line-height: 1.7;
  margin-bottom: 0;
}

.rd-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.rd-section-head-center {
  text-align: center;
  margin-bottom: 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ----- FORM INPUTS ----- */
.input {
  width: 100%;
  padding: 0.8rem 1.1rem;
  font-size: var(--text-base);
  font-family: inherit;
  color: var(--text-color);
  background: var(--color-bg-surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
}

.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.select {
  width: 100%;
  padding: 0.8rem 1.1rem;
  font-size: var(--text-base);
  font-family: inherit;
  color: var(--text-color);
  background: var(--color-bg-surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ----- STATUS MESSAGES ----- */
.error {
  color: var(--bad);
  font-size: var(--text-sm);
  background: rgba(220, 38, 38, 0.06);
  border: 1px solid rgba(220, 38, 38, 0.2);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  display: none;
}

.error.show, .error:not(:empty) { display: block; }

.success {
  color: var(--ok);
  font-size: var(--text-sm);
  background: rgba(5, 150, 105, 0.06);
  border: 1px solid rgba(5, 150, 105, 0.2);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  display: none;
}

.success.show, .success:not(:empty) { display: block; }

/* ----- BUTTON SIZE VARIANTS ----- */
.btn-sm { padding: 0.45rem 1rem; font-size: var(--text-xs); }
.btn-lg { padding: 1rem 2.25rem; font-size: var(--text-base); }

/* ----- ALERT COMPONENTS ----- */
.alert { padding: 0.85rem 1.1rem; border-radius: var(--radius-md); font-size: var(--text-sm); border: 1px solid transparent; }
.alert-error { background: rgba(220, 38, 38, 0.06); border-color: rgba(220, 38, 38, 0.2); color: var(--bad); }
.alert-ok { background: rgba(5, 150, 105, 0.06); border-color: rgba(5, 150, 105, 0.2); color: var(--ok); }

/* ===== DARK MODE OVERRIDES ===== */
html[data-theme="dark"] body {
  --bg-gradient: linear-gradient(165deg, #0d0d1a 0%, #1a1a2e 50%, #16213e 100%);
  --text-color: #f0f0f0;
  --text-muted: #b0b8c8;
  --card-bg: rgba(255, 255, 255, 0.04);
  --card-bg-strong: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.07);
  --border-focus: rgba(0, 200, 200, 0.3);
  --accent: #aecece;
  --accent-2: #00c8c0;
  --accent-soft: rgba(0, 200, 200, 0.12);
  --accent-glow: rgba(0, 131, 163, 0.35);
  --btn-primary-bg: linear-gradient(135deg, #00645f 0%, #128088 100%);
  --btn-ghost-bg: rgba(0, 200, 200, 0.08);
  --btn-ghost-border: rgba(0, 200, 200, 0.25);
  --surface-2: #1a1a2e;
  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
}

html[data-theme="dark"] .site-header {
  background: rgba(13, 13, 26, 0.6);
}

html[data-theme="dark"] .site-header.scrolled,
html[data-theme="dark"] .site-header.site-header--solid {
  background: rgba(13, 13, 26, 0.92) !important;
  border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}

html[data-theme="dark"] .site-header .brand {
  color: #f0f0f0;
}

html[data-theme="dark"] .hamburger-icon span {
  background: #f0f0f0;
}

html[data-theme="dark"] .nav-drawer {
  background: #1a1a2e;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.6);
}

html[data-theme="dark"] .nav-overlay {
  background: rgba(0, 0, 0, 0.7);
}

html[data-theme="dark"] .site-footer {
  background: #1a1a2e;
  border-top-color: rgba(255, 255, 255, 0.07);
}

html[data-theme="dark"] .footer-copy {
  background: rgba(255, 255, 255, 0.02);
  border-top-color: rgba(255, 255, 255, 0.07);
}

html[data-theme="dark"] .rd-feature-card {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.07);
}

html[data-theme="dark"] .rd-feature-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(0, 200, 200, 0.25);
  box-shadow: 0 20px 48px rgba(0, 131, 163, 0.15);
}

html[data-theme="dark"] .rd-feature-icon {
  background: rgba(0, 200, 200, 0.1);
}

html[data-theme="dark"] .rd-feature-card:hover .rd-feature-icon {
  background: rgba(0, 200, 200, 0.18);
}

html[data-theme="dark"] .rd-feature-icon svg {
  fill: #aecece;
}

html[data-theme="dark"] .game-tile-preview {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.07);
}

html[data-theme="dark"] .game-tile-preview:hover {
  border-color: rgba(0, 200, 200, 0.3);
  box-shadow: 0 16px 36px rgba(0, 131, 163, 0.2);
}

html[data-theme="dark"] .game-tile-preview .game-tile-icon {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
}

html[data-theme="dark"] .game-tile-preview .game-tile-body h3 {
  color: #f0f0f0;
}

html[data-theme="dark"] .game-tile-preview .game-tile-body span {
  color: #6b7280;
}

html[data-theme="dark"] ::-webkit-scrollbar-track {
  background: #0d0d1a;
}

html[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: rgba(174, 206, 206, 0.3);
}

html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: rgba(174, 206, 206, 0.5);
}

/* ----- DARK MODE THEME TOGGLE BUTTON ----- */
.btn-theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: transparent;
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  color: var(--text-muted);
  flex-shrink: 0;
}

.btn-theme-toggle:hover {
  background: var(--accent-soft);
  border-color: var(--border-focus);
  color: var(--accent);
  transform: rotate(20deg);
}

.btn-theme-toggle svg {
  width: 18px;
  height: 18px;
  transition: opacity 0.2s ease;
}

html[data-theme="dark"] .theme-icon--sun { display: none; }
html[data-theme="dark"] .theme-icon--moon { display: block; }
html:not([data-theme="dark"]) .theme-icon--sun { display: block; }
html:not([data-theme="dark"]) .theme-icon--moon { display: none; }

/* ----- BACKGROUND DECORATIONS (shared across all pages) ----- */
.bg-decorations {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.bg-bubble {
  position: absolute;
  border-radius: 50%;
  opacity: 0.035;
  background: var(--color-accent-primary);
  animation: bgBubbleFloat 22s ease-in-out infinite;
}

.bg-bubble--1 {
  width: clamp(280px, 35vw, 500px);
  height: clamp(280px, 35vw, 500px);
  top: 5%;
  right: 3%;
  animation-delay: 0s;
}

.bg-bubble--2 {
  width: clamp(180px, 25vw, 360px);
  height: clamp(180px, 25vw, 360px);
  top: 55%;
  left: 5%;
  animation-delay: -8s;
}

.bg-bubble--3 {
  width: clamp(200px, 30vw, 420px);
  height: clamp(200px, 30vw, 420px);
  bottom: 8%;
  right: 28%;
  animation-delay: -16s;
}

@keyframes bgBubbleFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(20px, -25px) scale(1.04); }
  66% { transform: translate(-15px, 15px) scale(0.97); }
}

.bg-wave {
  position: absolute;
  width: 2px;
  background: var(--color-accent-primary);
  opacity: 0.05;
  animation: bgWavePulse 3s ease-in-out infinite;
}

.bg-wave--1 { height: 110px; top: 18%; left: 12%; animation-delay: 0s; }
.bg-wave--2 { height: 70px; top: 38%; left: 22%; animation-delay: 0.5s; }
.bg-wave--3 { height: 140px; top: 12%; right: 18%; animation-delay: 1s; }
.bg-wave--4 { height: 55px; bottom: 28%; right: 32%; animation-delay: 1.5s; }
.bg-wave--5 { height: 90px; bottom: 18%; left: 38%; animation-delay: 2s; }

@keyframes bgWavePulse {
  0%, 100% { transform: scaleY(1); opacity: 0.05; }
  50% { transform: scaleY(1.9); opacity: 0.1; }
}

html[data-theme="dark"] .bg-bubble { opacity: 0.04; }
html[data-theme="dark"] .bg-wave { opacity: 0.07; }

/* ----- DARK MODE: login card ----- */
html[data-theme="dark"] .login-container {
  background: rgba(26, 26, 46, 0.92) !important;
  border-color: rgba(0, 200, 200, 0.2) !important;
  box-shadow: var(--shadow-xl), 0 0 40px rgba(0, 131, 163, 0.15) !important;
}

/* ----- DARK MODE: dashboard components ----- */
html[data-theme="dark"] .mini-stat {
  background: rgba(255, 255, 255, 0.06) !important;
}

html[data-theme="dark"] .tag-pill {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--text-muted);
}

html[data-theme="dark"] .empty-hint {
  background: rgba(255, 255, 255, 0.03) !important;
  border-color: rgba(255, 255, 255, 0.08);
}

/* ----- DARK MODE: game hub tile icons ----- */
html[data-theme="dark"] .game-tile-icon {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03)) !important;
}
