/* PrivietWeb · identidad editorial compartida
   Basada en loginPrueba2: papel marfil, tinta azul, rojo cereza y formas
   sencillas. Esta capa se carga después de los estilos de cada módulo. */

:root {
  --paper: #f6f1e9;
  --paper-deep: #eee5da;
  --card: #fffdf8;
  --ink: #202431;
  --muted: #7d7b78;
  --red: #a3324d;
  --red-dark: #7e263d;
  --blue: #315b82;
  --line: #e8dfd4;
  --green: #34735b;
  --shadow: 0 18px 45px rgba(80, 59, 42, .10);
  --radius: 3px;
  --round: 999px;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --display: Georgia, "Times New Roman", serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { background: var(--paper); }

body {
  min-height: 100vh;
  margin: 0;
  background: var(--paper) !important;
  color: var(--ink) !important;
  font-family: var(--sans) !important;
  -webkit-font-smoothing: antialiased;
}

body::before,
body::after {
  content: "";
  position: fixed;
  width: 34rem;
  height: 34rem;
  border: 1px solid rgba(163, 50, 77, .12);
  border-radius: 50%;
  background: none !important;
  pointer-events: none;
  z-index: 0;
}

body::before { top: -22rem; left: -18rem; }
body::after { right: -20rem; bottom: -22rem; border-color: rgba(49, 91, 130, .13); }

body > *, main, .page-main, .calendar-page, .teacher-page, .page-safe-top { position: relative; z-index: 1; }

h1, h2, h3, h4, h5, h6,
.hero-title, .hero-section h1, .section-title, .card-title, .game-title {
  color: var(--ink) !important;
  background: none !important;
  background-image: none !important;
  background-clip: border-box !important;
  -webkit-background-clip: border-box !important;
  -webkit-text-fill-color: currentColor !important;
  text-shadow: none !important;
  filter: none !important;
  animation: none !important;
  font-family: var(--display) !important;
  letter-spacing: -.045em;
}

.hero-title, .section-title { color: var(--red) !important; }
.hero-title .title-emoji { color: var(--blue) !important; }

p, li, label, small, span, div { text-rendering: optimizeLegibility; }

a { color: var(--blue); }
a:hover { color: var(--red); }

button, input, select, textarea { font-family: var(--sans) !important; }

button, .btn, .primary-btn, .outline-btn, .small-btn,
.btn-custom, .btn-primary-custom, .btn-secondary-custom,
.btn-back, .nav-link, .action-btn {
  border-radius: var(--radius) !important;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease !important;
}

button:hover:not(:disabled), .btn:hover, .primary-btn:hover, .outline-btn:hover,
.menu-card:hover, .lesson-card:hover, .feature-card:hover, .panel:hover {
  transform: translateY(-2px);
}

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(163, 50, 77, .22) !important;
  outline-offset: 3px;
}

/* Header y navegación */
.header, .calendar-header, .teacher-header {
  min-height: 74px !important;
  height: auto !important;
  padding: .8rem max(1.15rem, calc((100% - 1160px) / 2)) !important;
  background: rgba(246, 241, 233, .94) !important;
  border-bottom: 1px solid var(--line) !important;
  box-shadow: 0 6px 20px rgba(80, 59, 42, .06) !important;
  backdrop-filter: blur(12px);
}

.header-content {
  width: 100%;
  max-width: 1160px !important;
  min-height: 58px;
  padding: 0 !important;
}

.logo, .brand, .brand-logo, .calendar-header .brand, .teacher-header .brand {
  color: var(--ink) !important;
  font-family: var(--sans) !important;
  font-size: 1.08rem !important;
  font-weight: 900 !important;
  letter-spacing: -.06em;
  text-decoration: none !important;
}

.logo:hover, .brand:hover { color: var(--red) !important; transform: none !important; }

.logo-icon {
  width: 38px !important;
  height: 38px !important;
  border: 1px solid rgba(163, 50, 77, .28) !important;
  border-radius: 50% !important;
  background: transparent !important;
  color: var(--red) !important;
  box-shadow: none !important;
  animation: none !important;
  font-size: 1rem !important;
}

.logo-text, .logo span { color: var(--ink); font-size: inherit; }

.header-right, .user-section { gap: .75rem !important; }
.user-info, .user-info-placeholder {
  border: 1px solid var(--line) !important;
  border-radius: var(--round) !important;
  background: rgba(255, 253, 248, .76) !important;
  color: var(--ink) !important;
  box-shadow: none !important;
}
.user-info:hover { background: var(--card) !important; border-color: rgba(163, 50, 77, .32) !important; transform: none !important; }
.user-avatar { border-color: var(--red) !important; }
.role-badge, .user-info .badge { background: var(--red) !important; border-radius: 2px !important; }

.menu-btn-icon {
  width: 42px !important;
  height: 42px !important;
  border: 1px solid var(--line) !important;
  border-radius: 50% !important;
  color: var(--ink) !important;
  background: transparent !important;
}
.menu-btn-icon:hover { color: var(--red) !important; background: rgba(163, 50, 77, .06) !important; transform: none !important; }

/* Sidebar compartido */
.offcanvas, aside#sidebar {
  width: min(380px, 92vw) !important;
  background: var(--card) !important;
  border-left: 1px solid var(--line) !important;
  box-shadow: -18px 0 45px rgba(80, 59, 42, .14) !important;
  backdrop-filter: none !important;
}
.offcanvas-header {
  min-height: 78px;
  padding: 1.25rem 1.4rem !important;
  background: var(--ink) !important;
  box-shadow: none !important;
}
.offcanvas-title { font-family: var(--display) !important; color: #fff !important; letter-spacing: -.03em; }
.btn-close { border: 1px solid rgba(255,255,255,.28) !important; background: transparent !important; box-shadow: none !important; }
.offcanvas-body { padding: 1.25rem !important; }
.search-section .input-group { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: none !important; background: var(--card); }
.search-section .form-control { padding: .82rem 1rem !important; }
#clear-search { min-width: 44px; background: var(--red) !important; }
.sidebar-btn {
  min-height: 46px;
  padding: .78rem .9rem !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  background: var(--card) !important;
  color: var(--ink) !important;
  box-shadow: none !important;
  font-weight: 800 !important;
}
.sidebar-btn:hover { border-color: rgba(163, 50, 77, .35) !important; background: #f8edf0 !important; box-shadow: none !important; transform: none !important; }
.btn-primary-sidebar, .btn-success-sidebar, .btn-warning-sidebar { border-color: var(--red) !important; background: var(--red) !important; color: #fff !important; }
.btn-danger-sidebar { border-color: var(--ink) !important; background: var(--ink) !important; color: #fff !important; }
.btn-secondary-sidebar { background: var(--paper-deep) !important; color: var(--ink) !important; }
.suggestion-section { padding: 1rem !important; border: 1px solid var(--line) !important; border-radius: var(--radius) !important; background: #fbf5ed !important; box-shadow: none !important; }
.sidebar-divider { background: var(--line) !important; opacity: 1 !important; }

/* Shells y hero de los módulos */
.page-main, .calendar-page, .teacher-page { max-width: 1160px !important; margin-inline: auto !important; padding: 2.5rem max(1rem, 2vw) 4rem !important; }
.floating-shapes { pointer-events: none; opacity: .35; }
.floating-shapes .shape { border: 1px solid rgba(163, 50, 77, .15) !important; background: transparent !important; box-shadow: none !important; }
.hero-section, .hero, .intro-card, .teacher-page > .intro-card, .page-main > .hero-section {
  background: var(--card) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow) !important;
}
.hero-section, .intro-card { padding: clamp(1.6rem, 4vw, 3.5rem) !important; }
.hero-section::before, .hero-section::after, .hero::before, .hero::after { display: none !important; }
.hero-title, .hero h1, .intro-card h1, .teacher-page .intro-card h1 {
  margin-top: 0;
  font-size: clamp(2.25rem, 6vw, 4.8rem) !important;
  line-height: .94 !important;
}
.hero-title { color: var(--red) !important; }
.hero-title .title-emoji { color: var(--blue) !important; font-family: var(--sans) !important; font-size: .32em !important; letter-spacing: .02em; }
.hero-subtitle, .intro-card > p:not(.eyebrow):not(.notice):not(.calendar-status), .teacher-page .intro-card > p:not(.eyebrow):not(.teacher-status) {
  color: var(--muted) !important;
  line-height: 1.65 !important;
}
.eyebrow, .section-kicker, .card-kicker { color: var(--red) !important; font-family: var(--sans) !important; letter-spacing: .14em; text-transform: uppercase; font-size: .72rem; font-weight: 900; }

/* Tarjetas, estadísticas y menús */
.stat-card, .stat-item, .metric-card, .quick-stat, .feature-card,
.menu-card, .lesson-card, .culture-card, .game-card, .social-card,
.panel, .word-card, .game-container, .content-card, .card,
.deck-card, .goal-card, .premium-card, .profile-header {
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  background: var(--card) !important;
  box-shadow: 0 8px 24px rgba(80, 59, 42, .06) !important;
}
.stat-card, .metric-card, .stat-item { padding: 1.1rem !important; }
.stat-number, .metric-card strong { color: var(--red) !important; font-family: var(--display) !important; }
.stat-label, .metric-card span, .card-description, .menu-card-description { color: var(--muted) !important; }
.menu-grid, .lessons-grid, .feature-grid, .games-grid, .culture-grid, .cards-grid { gap: 1rem !important; }
.menu-card, .lesson-card, .culture-card, .game-card { padding: 1.25rem !important; min-height: 0 !important; color: var(--ink) !important; }
.menu-card::before, .lesson-card::before, .culture-card::before { background: var(--red) !important; }
.menu-card:hover, .lesson-card:hover, .culture-card:hover, .game-card:hover { border-color: rgba(163, 50, 77, .35) !important; box-shadow: 0 15px 30px rgba(80, 59, 42, .1) !important; }
.menu-card-icon, .card-icon, .title-emoji { filter: none !important; }

/* Reemplazos puntuales para módulos que todavía traen la paleta anterior */
.search-card, .song-card, .songs-header, .search-header, .category-header,
.vocabulary-header, .culture-header, .map-container, .state-list-card {
  background: var(--card) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow) !important;
}
.search-card::before, .song-card::before, .map-container::before,
.category-header::before, .culture-header::before { background: var(--red) !important; }
.section-title { font-size: clamp(2.35rem, 6vw, 4.2rem) !important; }
.counter-badge, .count-badge, .category-count { background: var(--red) !important; color: #fff !important; box-shadow: 0 8px 16px rgba(163, 50, 77, .18) !important; }
.filter-btn.active, .category-chip.active, .state-item-active { background: var(--red) !important; color: #fff !important; border-color: var(--red) !important; }
.back-button, .back-link { color: var(--blue) !important; background: transparent !important; }

/* Geografía: mapa claro en tinta, sin el marco morado del tema anterior */
#map-wrapper { background: transparent !important; }
#svg-container svg path, #svg-container svg polygon, #svg-container svg polyline {
  fill: #e3e8ec !important;
  stroke: var(--blue) !important;
}
#svg-container svg path:hover, #svg-container svg polygon:hover, #svg-container svg polyline:hover {
  fill: #f3dce2 !important;
  stroke: var(--red) !important;
  filter: none !important;
}
#svg-container svg .state-active { fill: var(--red) !important; stroke: var(--red-dark) !important; filter: none !important; }
#reset-view-btn { background: var(--red) !important; box-shadow: 0 8px 16px rgba(163, 50, 77, .18) !important; }
.state-item { border: 1px solid transparent !important; border-radius: var(--radius) !important; background: #fbf7f1 !important; }
.state-item:hover { background: #f8edf0 !important; border-color: rgba(163, 50, 77, .25) !important; }
.state-item-active { background: var(--red) !important; }

/* Botones y formularios */
.primary-btn, .btn-primary, .btn-primary-custom, .btn-success-custom, .btn-warning-custom,
.btn-custom.btn-primary-custom, .action-btn.primary, .save-btn {
  border: 1px solid var(--red) !important;
  background: var(--red) !important;
  color: #fff !important;
  box-shadow: 0 8px 16px rgba(163, 50, 77, .18) !important;
}
.primary-btn:hover, .btn-primary:hover, .btn-primary-custom:hover { background: var(--red-dark) !important; }
.btn-google, #google-btn {
  border: 1px solid var(--red) !important;
  border-radius: var(--radius) !important;
  background: var(--red) !important;
  color: #fff !important;
  box-shadow: 0 8px 18px rgba(163, 50, 77, .2) !important;
}
.btn-google:hover, #google-btn:hover { background: var(--red-dark) !important; box-shadow: 0 12px 24px rgba(163, 50, 77, .25) !important; }
.outline-btn, .btn-secondary-custom, .btn-ghost, .btn-back, .small-btn,
.btn-outline-secondary, .secondary-btn {
  border: 1px solid var(--line) !important;
  background: transparent !important;
  color: var(--blue) !important;
  box-shadow: none !important;
}
input, select, textarea, .form-control, .form-select {
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  background: var(--card) !important;
  color: var(--ink) !important;
  box-shadow: none !important;
}
input:focus, select:focus, textarea:focus, .form-control:focus, .form-select:focus { border-color: var(--red) !important; box-shadow: 0 0 0 3px rgba(163, 50, 77, .1) !important; }

/* Progreso, juegos y vocabulario */
.progress-container, .progress-track, .level-progress, .goal-progress { background: #eadfd5 !important; border-radius: var(--round) !important; }
.progress-bar, .level-progress-bar, .goal-progress span { background: var(--red) !important; border-radius: inherit !important; }
.russian-word, .word-russian, .russian-text { color: var(--red) !important; font-family: var(--display) !important; }
.spanish-word, .english-word, .word-translation, .word-hint { color: var(--muted) !important; }
.answer-option, .option-btn, .demo-option, .turn-options button { border-color: var(--line) !important; border-radius: var(--radius) !important; background: var(--card) !important; color: var(--ink) !important; }
.answer-option:hover, .option-btn:hover, .turn-options button:hover:not(:disabled) { border-color: var(--red) !important; background: #f8edf0 !important; }
.game-header, .game-info, .results-header { border-color: var(--line) !important; }
.memorama-board, .game-board { background: var(--paper-deep) !important; border-radius: var(--radius) !important; }

/* Selector de modo de juegos: texto legible sobre la superficie clara */
.mode-selector {
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 2rem;
  padding: .45rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card) !important;
  box-shadow: 0 8px 20px rgba(80, 59, 42, .06);
}
.mode-selector .mode-label,
.mode-selector .mode-hint { color: #475569 !important; }
.mode-selector .mode-btn {
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  background: var(--card) !important;
  color: #1f2937 !important;
  font-weight: 800 !important;
}
.mode-selector .mode-btn:hover { background: #f8edf0 !important; color: var(--red-dark) !important; }
.mode-selector .mode-btn.active { background: #e9efff !important; color: #1f3b5b !important; border-color: var(--blue) !important; }

/* Calendario, docente y perfil */
.calendar-status.success, .teacher-status.success { color: var(--green) !important; }
.calendar-day { border-radius: var(--radius) !important; background: var(--card) !important; }
.calendar-day-today { border-color: var(--red) !important; background: #f8edf0 !important; }
.icon-btn { border-radius: 50% !important; background: #f3e5e7 !important; color: var(--red) !important; }
.teacher-grid, .calendar-layout { gap: 1rem !important; }
.profile-avatar, .profile-avatar img, .avatar, .user-avatar { border-radius: 50% !important; }
.badge-tag, .badge-premium { border-radius: 2px !important; background: var(--red) !important; color: #fff !important; }
.premium-section .premium-card { border-color: rgba(163, 50, 77, .28) !important; background: #f8edf0 !important; }

/* Modales y estados */
.modal-content, .results-modal > div:not(.modal-backdrop), .modal-card {
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  background: var(--card) !important;
  box-shadow: var(--shadow) !important;
}
.empty-state { border-color: var(--line) !important; color: var(--muted) !important; background: transparent !important; }
.toast, .alert, .status-message { border-radius: var(--radius) !important; }

@media (max-width: 760px) {
  .header, .calendar-header, .teacher-header { padding-inline: 1rem !important; }
  .page-main, .calendar-page, .teacher-page { padding: 1.5rem .75rem 3rem !important; }
  .hero-title, .hero h1, .intro-card h1 { font-size: clamp(2.2rem, 14vw, 3.6rem) !important; }
  .logo-text, .logo > span { font-size: .98rem; }
}
