/* === Base responsive y accesibilidad global === */
:root {
  --app-space-1: 0.25rem;
  --app-space-2: 0.5rem;
  --app-space-3: 0.75rem;
  --app-space-4: 1rem;
  --app-space-5: 1.5rem;
  --app-space-6: 2rem;
  --app-radius-sm: 0.5rem;
  --app-radius-md: 0.75rem;
  --app-radius-lg: 1rem;
  --app-shadow-sm: 0 4px 10px rgba(0, 0, 0, 0.08);
  --app-shadow-md: 0 8px 20px rgba(0, 0, 0, 0.12);
  --app-container-max: 1280px;
  --app-container-pad: clamp(0.75rem, 2.2vw, 1.5rem);
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  overflow-x: hidden;
}

img,
video {
  max-width: 100%;
  height: auto;
}

svg,
canvas {
  max-width: 100%;
}

iframe {
  max-width: 100%;
}

.container,
.container-sm,
.container-md,
.container-lg,
.container-xl,
.container-xxl {
  padding-inline: var(--app-container-pad);
}

.container-fluid {
  padding-inline: var(--app-container-pad);
  margin-left: 0 !important;
  margin-right: 0 !important;
}

@media (min-width: 1400px) {
  .container,
  .container-sm,
  .container-md,
  .container-lg,
  .container-xl,
  .container-xxl {
    max-width: var(--app-container-max);
  }
}

h1 {
  font-size: clamp(1.65rem, 2.6vw, 2.4rem);
}

h2 {
  font-size: clamp(1.35rem, 2.1vw, 1.85rem);
}

h3 {
  font-size: clamp(1.15rem, 1.6vw, 1.4rem);
}

p,
li,
label,
input,
select,
textarea,
button {
  font-size: clamp(0.95rem, 1.05vw, 1.02rem);
}

:where(a, button, .btn, [role="button"], input, select, textarea):focus-visible {
  outline: 3px solid rgba(0, 83, 119, 0.35);
  outline-offset: 2px;
  box-shadow: none !important;
}

.btn,
.form-control,
.form-select {
  min-height: 44px;
}

.form-control,
.form-select,
textarea {
  max-width: 100%;
}

textarea.form-control,
textarea.form-select,
textarea {
  min-height: 96px;
}

.app-navbar-brand {
  position: relative;
  z-index: 10;
}

.app-navbar-logo {
  width: auto;
  height: clamp(2.1rem, 3.3vw, 2.7rem);
}

.navbar .navbar-nav {
  gap: 0.15rem;
}

.navbar .btn,
.navbar .nav-link,
.navbar .dropdown-item {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.footer-logo-rotate {
  transform: rotate(180deg);
}

.cookie-consent-banner {
  z-index: 2000;
}

.table-scroll,
.table-responsive {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--app-radius-sm);
}

.table-scroll table,
.table-responsive table {
  min-width: 640px;
}

table {
  width: 100%;
}

th,
td {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.card,
.section-box {
  border-radius: var(--app-radius-lg);
}

.row > * {
  min-width: 0;
}

.profile-avatar-img {
  max-width: 140px;
}

.profile-avatar-fallback {
  font-size: 5rem;
  color: #6c757d;
}

.plan-card-body {
  position: relative;
}

.plan-card-free {
  border-top: 4px solid #203864;
}

.plan-card-free-header {
  background-color: #203864;
}

.plan-card-premium-header {
  background-color: #000;
}

.plans-comparison-wrap {
  max-width: var(--app-container-max);
  margin-inline: auto;
  padding-inline: var(--app-container-pad);
}

.plans-comparison-table {
  max-width: 100%;
}

.learning-background {
  position: relative;
  background-image: url("../img/mesa-escritorio.jpg");
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  min-height: 100dvh;
  padding-block: var(--app-space-4);
}

.learning-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.learning-link-reset {
  text-decoration: none;
  color: inherit;
}

.disabled-card {
  pointer-events: none;
  opacity: 0.6;
  cursor: not-allowed;
}

.home-page-background {
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  background-attachment: fixed;
}

.ranking-cta-btn {
  font-weight: 700;
  border-radius: 0.75rem;
  padding: 0.75rem 2rem;
  font-size: clamp(1rem, 1.3vw, 1.25rem);
}

.ranking-cta-btn-disabled {
  opacity: 0.7;
}

.evolution-panel {
  width: min(80%, 640px);
  min-height: 220px;
  border-radius: 21px 21px 0 0;
}

.ia-panel {
  background-color: rgba(0, 0, 0, 0.7);
  border-radius: 0.25rem;
}

.home-ai-text {
  filter: drop-shadow(1px 1px 2px rgba(255, 255, 255, 0.5));
  font-weight: 700;
}

.home-ai-subtext {
  filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.5));
}

.d-inline-form {
  display: inline;
}

.is-hidden {
  display: none !important;
}

.cursor-pointer {
  cursor: pointer;
}

.chart-canvas-lg {
  max-height: 240px;
  max-width: 100%;
}

.chart-canvas-md {
  max-height: 200px;
  max-width: 100%;
}

.max-w-300 {
  max-width: 300px;
}

.max-w-600 {
  max-width: 600px;
}

.quiz-background-dynamic {
  background-image: none;
}

.quiz-setup-panel {
  min-width: 200px;
  max-width: 100%;
}

.filter-select-card.selected {
  background-color: #007bff !important;
  color: #fff !important;
  transform: scale(1.02);
  transition: all 0.2s ease-in-out;
}

.filter-select-card.selected h6 {
  color: #fff;
}

.ai-suggestion-text {
  max-height: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quiz-explanation-title {
  color: #545151;
}

.quiz-ai-badge {
  width: 90px;
  height: 200px;
}

.quiz-feedback-tight-top {
  margin-top: 4px !important;
}

.source-locked {
  cursor: not-allowed;
}

.tree-item.level-1 {
  padding-left: 20px;
}

.tree-item.level-2 {
  padding-left: 40px;
}

.tree-item.level-3 {
  padding-left: 60px;
}

.tree-item.level-4 {
  padding-left: 80px;
}

.tree-item.level-5 {
  padding-left: 100px;
}

.tree-item.level-6 {
  padding-left: 120px;
}

.tree-item.level-7 {
  padding-left: 140px;
}

.tree-item.level-8 {
  padding-left: 160px;
}

.tree-item.level-9 {
  padding-left: 180px;
}

.tree-item.level-10 {
  padding-left: 200px;
}

.tree-indent-marker {
  display: inline-block;
  width: 14px;
}

.learning-summary-input-group {
  width: 100%;
  max-width: 300px;
}

.session-main-container {
  max-width: 1200px;
}

.opposition-title-compact {
  text-align: left;
  font-size: 0.9rem;
}

.opposition-alert-compact {
  font-size: 0.9rem;
}

.opposition-alert-help {
  font-size: 0.82rem;
}

.opposition-upgrade-btn {
  margin-top: 10px;
}

.opposition-list-compact {
  font-size: 0.9rem;
}

.opposition-release-text {
  font-size: 0.75rem;
}

.opposition-release-icon {
  font-size: 0.8rem;
  color: #007bff;
}

.countdown-display {
  font-size: 1.5rem;
}

.structure-card-body {
  background-color: #f9f9f9;
  font-family: "Open Sans", sans-serif;
  font-size: 1.05rem;
  color: #333;
}

.subscription-notes-field {
  height: 38px;
  min-height: 38px;
  width: min(400px, 100%);
}

.blog-watermark-layer {
  position: fixed;
  inset: 0;
  z-index: -30;
  pointer-events: none;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

.blog-watermark-image {
  width: min(50vw, 720px);
  height: auto;
  min-height: 260px;
  object-fit: contain;
}

.blog-content-shell {
  position: relative;
  z-index: 10;
  background-color: rgba(255, 255, 255, 0.85);
  border: clamp(8px, 1.4vw, 20px) solid #fff;
}

.payment-processing-container {
  min-height: 60vh;
}

.payment-spinner-lg {
  width: 4rem;
  height: 4rem;
}

.payment-help-small {
  font-size: 0.9em;
}

.payment-ko-card {
  max-width: 450px;
}

.payment-raw-json {
  font-size: 0.92em;
  word-break: break-all;
}

.session-terminated-wrap {
  margin-top: 100px;
}

.intro-logo-highlight {
  max-width: 160px;
  filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.7));
  animation: pulseLogo 2.5s infinite;
}

.exam-select-col {
  width: 40px;
}

.quiz-setup-info-list {
  max-width: 600px;
}

.blog-inline-action {
  display: inline;
}

.estructura-detalle.full-bleed {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 1280px) {
  .container,
  .container-sm,
  .container-md,
  .container-lg,
  .container-xl,
  .container-xxl {
    max-width: 1140px;
  }
}

@media (max-width: 1024px) {
  .navbar .btn {
    width: 100%;
    justify-content: center;
    margin-right: 0 !important;
    margin-bottom: 0.5rem;
  }

  .navbar .dropdown-menu {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .section-box,
  .card-body {
    padding: 1rem;
  }

  input,
  select,
  textarea,
  button,
  .form-control,
  .form-select {
    font-size: 1rem !important;
  }

  .table-scroll table,
  .table-responsive table {
    min-width: 560px;
  }

  .footer-gradient {
    padding-inline: var(--app-container-pad) !important;
  }

  .home-page-background {
    background-attachment: scroll;
  }

  .evolution-panel {
    width: 100%;
    min-height: 180px;
  }

  .subscription-notes-field {
    width: 100%;
  }
}

@media (max-width: 480px) {
  :root {
    --app-container-pad: 0.75rem;
  }

  .btn,
  .form-control,
  .form-select {
    min-height: 46px;
  }

  .table-scroll table,
  .table-responsive table {
    min-width: 520px;
  }

  .tree-item.level-1 {
    padding-left: 12px;
  }

  .tree-item.level-2 {
    padding-left: 24px;
  }

  .tree-item.level-3 {
    padding-left: 36px;
  }

  .tree-item.level-4 {
    padding-left: 48px;
  }

  .tree-item.level-5 {
    padding-left: 60px;
  }

  .tree-item.level-6 {
    padding-left: 72px;
  }

  .tree-item.level-7 {
    padding-left: 84px;
  }

  .tree-item.level-8 {
    padding-left: 96px;
  }

  .tree-item.level-9 {
    padding-left: 108px;
  }

  .tree-item.level-10 {
    padding-left: 120px;
  }

  .blog-watermark-image {
    width: 75vw;
    min-height: 0;
  }

  .countdown-display {
    font-size: 1.25rem;
  }

  .g-recaptcha {
    transform: scale(0.9);
    transform-origin: left top;
  }
}

@media (max-width: 360px) {
  .g-recaptcha {
    transform: scale(0.84);
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
