/*
  Learn Languages with AI — /en/languages/
  Independent stylesheet for the English pilot module. Not shared with, and not
  loaded by, any page inside /idiomas/. Uses Bootstrap 5.3.3 (CDN) for grid and
  base components; this file supplies the module's own visual language.
*/

:root {
  --lg-primary: #0b5f7a;
  --lg-secondary: #14a3a3;
  --lg-accent: #6a4fd6;
  --lg-ink: #12293a;
  --lg-surface: #ffffff;
  --lg-surface-alt: #f2f8f9;
  --lg-border: rgba(11, 95, 122, 0.14);
  --lg-shadow: 0 18px 42px rgba(9, 40, 56, 0.1);
  --lg-shadow-card: 0 10px 26px rgba(9, 40, 56, 0.09);
  --lg-radius-lg: 22px;
  --lg-radius-md: 16px;
  --lg-radius-sm: 10px;
  --lg-container-max: 1180px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  color: var(--lg-ink);
  background:
    radial-gradient(circle at top left, rgba(20, 163, 163, 0.1), transparent 32%),
    radial-gradient(circle at top right, rgba(106, 79, 214, 0.1), transparent 28%),
    linear-gradient(180deg, #f7fcfd 0%, #eef6f7 100%);
  min-height: 100vh;
  padding-top: 84px;
}

a {
  text-decoration: none;
}

img {
  max-width: 100%;
}

a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.lg-nav-link:focus-visible,
.lg-toc a:focus-visible,
.form-control:focus-visible {
  outline: 3px solid rgba(20, 163, 163, 0.95);
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgba(20, 163, 163, 0.18);
}

.lg-container {
  max-width: var(--lg-container-max);
  margin-left: auto;
  margin-right: auto;
}

.lg-section {
  padding-top: 4rem;
  padding-bottom: 4rem;
}

.lg-section.pt-0 {
  padding-top: 0;
}

.lg-subtitle {
  max-width: 720px;
  color: #46606d;
  font-size: 1.02rem;
}

/* ---------- Navbar ---------- */

.lg-navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1030;
  max-width: 100vw;
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--lg-border);
  box-shadow: 0 10px 26px rgba(9, 40, 56, 0.06);
}

.lg-navbar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 0.7rem 1rem;
}

.lg-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--lg-ink);
  font-weight: 800;
  font-size: 1.02rem;
  flex: 1 1 auto;
  min-width: 0;
}

.lg-brand i {
  color: var(--lg-primary);
  font-size: 1.3rem;
}

.lg-nav-toggle {
  display: none;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--lg-border);
  border-radius: var(--lg-radius-sm);
  background: var(--lg-surface);
  font-size: 1.4rem;
  color: var(--lg-primary);
}

.lg-nav-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.lg-nav-link {
  display: inline-block;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  color: #34515e;
  font-weight: 600;
  font-size: 0.95rem;
}

.lg-nav-link:hover {
  color: var(--lg-primary);
  background: var(--lg-surface-alt);
}

.lg-nav-link.active {
  color: #fff;
  background: linear-gradient(135deg, var(--lg-primary), var(--lg-accent));
}

.lg-nav-link.lg-nav-pt {
  border: 1px solid var(--lg-border);
  color: var(--lg-primary);
}

/* ---------- Learning Paths dropdown (reuses Bootstrap's dropdown JS) ---------- */

.lg-dropdown-menu {
  border: 1px solid var(--lg-border);
  border-radius: var(--lg-radius-md);
  box-shadow: var(--lg-shadow-card);
  padding: 0.5rem;
  min-width: 15rem;
}

.lg-dropdown-item {
  border-radius: var(--lg-radius-sm);
  padding: 0.55rem 0.85rem;
  font-weight: 600;
  font-size: 0.92rem;
  color: #34515e;
}

.lg-dropdown-item:hover,
.lg-dropdown-item:focus {
  background: var(--lg-surface-alt);
  color: var(--lg-primary);
}

.lg-dropdown-item.active {
  background: linear-gradient(135deg, var(--lg-primary), var(--lg-accent));
  color: #fff;
}

@media (max-width: 991.98px) {
  .lg-nav-toggle {
    display: inline-flex;
  }

  .lg-nav-list {
    display: none;
    flex-direction: column;
    align-items: stretch;
    flex-basis: 100%;
    width: 100%;
    order: 3;
    padding-top: 0.75rem;
    gap: 0.4rem;
  }

  .lg-nav-list.lg-nav-open {
    display: flex;
  }

  .lg-nav-link {
    padding: 0.65rem 0.9rem;
  }

  .lg-dropdown-menu {
    position: static;
    box-shadow: none;
    border: none;
    background: var(--lg-surface-alt);
    margin-top: 0.25rem;
  }
}

/* ---------- Hero / header card ---------- */

.lg-header-card {
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.96), rgba(236, 248, 249, 0.92));
  border: 1px solid var(--lg-border);
  border-radius: 28px;
  box-shadow: var(--lg-shadow);
  padding: 2.5rem;
}

@media (max-width: 575.98px) {
  .lg-header-card {
    padding: 1.6rem;
  }
}

.lg-breadcrumb {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0;
  margin: 0 0 0.9rem;
  font-size: 0.92rem;
}

.lg-breadcrumb li {
  color: #5a7581;
}

.lg-breadcrumb li:not(:last-child)::after {
  content: '\2039' '\203A';
  content: '/';
  margin-left: 0.5rem;
  color: #9db2ba;
}

.lg-breadcrumb a {
  color: #5a7581;
  font-weight: 600;
}

.lg-breadcrumb a:hover {
  color: var(--lg-primary);
}

.lg-breadcrumb li[aria-current="page"] {
  color: var(--lg-primary);
  font-weight: 700;
}

.lg-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  background: rgba(11, 95, 122, 0.08);
  color: var(--lg-primary);
  font-size: 0.84rem;
  font-weight: 700;
  margin-bottom: 0.9rem;
}

.lg-hero-title {
  font-size: clamp(2rem, 4vw, 2.9rem);
  font-weight: 700;
  margin-bottom: 0.9rem;
  color: var(--lg-ink);
}

.lg-hero-visual {
  border-radius: 22px;
  border: 1px solid var(--lg-border);
  background: linear-gradient(135deg, rgba(20, 163, 163, 0.16), rgba(106, 79, 214, 0.14));
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  padding: 2rem;
  text-align: center;
}

.lg-hero-visual i {
  font-size: 3rem;
  color: var(--lg-primary);
  margin-bottom: 0.75rem;
  display: block;
}

.lg-hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.25rem;
}

.lg-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  background: var(--lg-surface);
  border: 1px solid var(--lg-border);
  box-shadow: 0 8px 18px rgba(9, 40, 56, 0.06);
  font-size: 0.88rem;
  font-weight: 600;
  color: #34515e;
}

.lg-badge i {
  color: var(--lg-secondary);
}

/* ---------- Notices ---------- */

.lg-notice {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  border-radius: var(--lg-radius-md);
  border: 1px solid var(--lg-border);
  background: var(--lg-surface-alt);
  padding: 1.1rem 1.3rem;
}

.lg-notice i {
  flex-shrink: 0;
  margin-top: 0.2rem;
  font-size: 1.2rem;
  color: var(--lg-primary);
}

.lg-notice h2,
.lg-notice h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--lg-ink);
  margin-bottom: 0.25rem;
}

.lg-notice p {
  margin-bottom: 0;
  color: #2e4a54;
  font-size: 0.92rem;
}

.lg-safety-note {
  border-radius: var(--lg-radius-md);
  border-left: 4px solid #c74234;
  background: linear-gradient(135deg, rgba(199, 66, 52, 0.12), rgba(255, 237, 234, 0.55));
  border-top: 1px solid rgba(199, 66, 52, 0.28);
  border-right: 1px solid rgba(199, 66, 52, 0.28);
  border-bottom: 1px solid rgba(199, 66, 52, 0.28);
  padding: 1rem 1.15rem;
}

/* ---------- Cards / callouts ---------- */

.lg-callout {
  border-radius: var(--lg-radius-lg);
  background: linear-gradient(135deg, rgba(20, 163, 163, 0.1), rgba(106, 79, 214, 0.1));
  border: 1px solid rgba(20, 163, 163, 0.14);
  padding: 1.9rem;
}

.lg-card {
  height: 100%;
  border: 1px solid var(--lg-border);
  border-radius: var(--lg-radius-lg);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--lg-shadow-card);
  padding: 1.6rem;
  display: flex;
  flex-direction: column;
}

.lg-card:hover {
  transform: translateY(-3px);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 16px 34px rgba(9, 40, 56, 0.13);
}

.lg-icon-badge {
  width: 50px;
  height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  font-size: 1.35rem;
  background: linear-gradient(135deg, rgba(20, 163, 163, 0.14), rgba(106, 79, 214, 0.14));
  color: var(--lg-primary);
  margin-bottom: 0.9rem;
}

.lg-list-check {
  list-style: none;
  padding-left: 0;
  display: grid;
  gap: 0.85rem;
  margin-bottom: 0;
}

.lg-list-check li {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
}

.lg-list-check i {
  color: var(--lg-secondary);
  font-size: 1.05rem;
  margin-top: 0.15rem;
  flex-shrink: 0;
}

/* ---------- Learning path cards ---------- */

.lg-path-card {
  height: 100%;
  border: 1px solid var(--lg-border);
  border-radius: var(--lg-radius-lg);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--lg-shadow-card);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  position: relative;
}

.lg-path-card.lg-path-active {
  border-color: rgba(20, 163, 163, 0.4);
}

.lg-path-card.lg-path-soon {
  opacity: 0.85;
}

.lg-path-level {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--lg-secondary);
  margin-bottom: 0.35rem;
}

.lg-coming-soon {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  align-self: flex-start;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: rgba(11, 95, 122, 0.08);
  color: #4c6874;
  font-size: 0.78rem;
  font-weight: 700;
  margin-top: auto;
}

/* ---------- Category chip ---------- */

.lg-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--lg-border);
  box-shadow: 0 8px 16px rgba(9, 40, 56, 0.05);
  font-size: 0.85rem;
  font-weight: 600;
  color: #34515e;
}

.lg-chip i {
  color: var(--lg-primary);
}

/* ---------- Table of contents ---------- */

.lg-toc {
  border: 1px solid var(--lg-border);
  border-radius: var(--lg-radius-lg);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--lg-shadow-card);
  padding: 1.3rem;
}

.lg-toc nav {
  display: grid;
  gap: 0.55rem;
}

.lg-toc a {
  color: #2d4b56;
  font-weight: 600;
  font-size: 0.94rem;
}

.lg-toc a:hover,
.lg-toc a:focus {
  color: var(--lg-primary);
}

/* ---------- Prompt cards ---------- */

.lg-prompt-card {
  border: 1px solid var(--lg-border);
  border-radius: var(--lg-radius-lg);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--lg-shadow-card);
  padding: 1.7rem;
}

.lg-prompt-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.lg-prompt-box {
  border-radius: var(--lg-radius-md);
  border: 1px solid rgba(11, 95, 122, 0.18);
  background: #f6fbfc;
  padding: 1rem;
}

.lg-prompt-box pre {
  margin-bottom: 0.85rem;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.94rem;
  color: #1e3742;
  font-family: 'Consolas', 'Menlo', monospace;
}

.lg-copy-btn,
.lg-btn-gradient {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, var(--lg-primary), var(--lg-accent));
  color: #fff;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
}

.lg-copy-btn:hover,
.lg-copy-btn:focus-visible,
.lg-btn-gradient:hover,
.lg-btn-gradient:focus-visible {
  opacity: 0.92;
  color: #fff;
}

.lg-btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--lg-primary);
  background: transparent;
  color: var(--lg-primary);
  font-weight: 700;
  font-size: 0.92rem;
}

.lg-btn-outline:hover,
.lg-btn-outline:focus-visible {
  background: var(--lg-surface-alt);
  color: var(--lg-primary);
}

/* ---------- Trail (prev/next) navigation ---------- */

.lg-trail-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.9rem;
}

.lg-trail-nav .lg-trail-spacer {
  flex: 1 1 auto;
}

.lg-copy-feedback {
  font-size: 0.88rem;
  color: #146b3a;
  margin-top: 0.5rem;
  min-height: 1.2em;
}

.lg-prompt-note {
  border-left: 4px solid var(--lg-secondary);
  border-radius: var(--lg-radius-sm);
  background: linear-gradient(135deg, rgba(20, 163, 163, 0.1), rgba(106, 79, 214, 0.08));
  padding: 0.85rem 1rem;
  font-size: 0.92rem;
  color: #274752;
}

/* ---------- Feedback style cards ---------- */

.lg-feedback-card {
  height: 100%;
  border-radius: var(--lg-radius-lg);
  border: 1px solid var(--lg-border);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--lg-shadow-card);
  padding: 1.5rem;
}

.lg-feedback-card h3 {
  color: var(--lg-primary);
}

/* ---------- Learning cycle ---------- */

.lg-cycle {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.6rem;
  justify-content: center;
}

.lg-cycle-step {
  flex: 1 1 150px;
  min-width: 130px;
  border: 1px solid var(--lg-border);
  border-radius: var(--lg-radius-md);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--lg-shadow-card);
  padding: 1rem 0.9rem;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 600;
  color: #2d4b56;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.lg-cycle-step i {
  font-size: 1.3rem;
  color: var(--lg-primary);
}

.lg-cycle-arrow {
  display: flex;
  align-items: center;
  color: #9db2ba;
  font-size: 1.2rem;
}

@media (max-width: 767.98px) {
  .lg-cycle-arrow {
    transform: rotate(90deg);
    align-self: center;
  }
}

/* ---------- Footer ---------- */

.lg-footer {
  margin-top: 3rem;
  background: var(--lg-ink);
  color: rgba(255, 255, 255, 0.82);
  padding: 3rem 0 2rem;
}

.lg-footer h2 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 0.9rem;
}

.lg-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.55rem;
}

.lg-footer a {
  color: rgba(255, 255, 255, 0.85);
}

.lg-footer a:hover {
  color: #fff;
  text-decoration: underline;
}

.footer-link-button {
  display: inline-block;
  padding: 0.2rem 0;
  line-height: 1.35;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.85);
  font: inherit;
  text-align: left;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.4);
}

.footer-link-button:hover,
.footer-link-button:focus {
  color: #ffffff;
  text-decoration-color: rgba(255, 255, 255, 0.7);
}

.lg-footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  margin-top: 2rem;
  padding-top: 1.25rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.55);
}

/* ---------- Utility ---------- */

.reveal-up {
  animation: lgRevealUp 0.5s ease both;
}

.reveal-delay-1 {
  animation-delay: 0.08s;
}

.reveal-delay-2 {
  animation-delay: 0.16s;
}

@keyframes lgRevealUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.visually-hidden-lg {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal-up,
  .reveal-delay-1,
  .reveal-delay-2,
  .lg-card:hover {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
}

/* ---------- Future page images (prepared, not yet in use) ----------
   No <img> tag references these classes yet — the final images are being
   produced separately (see documentation/007_image_integration_guide.md).
   Do not remove these rules for appearing unused; they exist so the
   images can be dropped in later with a small, explicit swap instead of a
   redesign. Both classes require explicit width/height (or a wrapper with
   a fixed aspect-ratio, as already used by .lg-hero-visual) so adding the
   real image does not shift surrounding layout.

   - .lg-hero-image: the single hero photo on index.html, replacing the
     icon inside .lg-hero-visual. Use loading="eager" and
     fetchpriority="high" (it is the largest above-the-fold element).
   - .lg-page-image: the secondary/per-level photo on any page (the header
     illustration on beginner.html through study-plans.html, and the
     "global-language-connections.webp" companion image on index.html).
     These sit further down the page, so use loading="lazy".
*/

.lg-hero-image {
  width: 100%;
  height: 100%;
  min-height: 220px;
  object-fit: cover;
  border-radius: 22px;
  display: block;
}

/* Modifier for .lg-hero-visual when it holds the real hero photo instead of
   the icon fallback: removes the icon block's padding/centering so the
   image fills the gradient-bordered box edge to edge, and clips its
   corners to the same radius. */
.lg-hero-visual-photo {
  padding: 0;
  overflow: hidden;
  display: block;
}

.lg-page-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--lg-radius-lg);
  border: 1px solid var(--lg-border);
  box-shadow: var(--lg-shadow-card);
  display: block;
}

/* The three approved page images are 3:2, not the 16:9 default above. */
.lg-page-image--3-2 {
  aspect-ratio: 3 / 2;
}

@media (max-width: 575.98px) {
  .lg-page-image {
    border-radius: var(--lg-radius-md);
  }
}

/* ---------- Cookie consent banner ----------
   Mirrors /assets/css/style.css's .cookie-consent-* rules (the Portuguese
   site's banner), restyled with this module's own design tokens. Loaded by
   en/languages/assets/js/consent.js on all 8 module pages and the 3 English
   institutional pages. */

.cookie-consent-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1040;
  background: var(--lg-ink);
  box-shadow: 0 -12px 30px rgba(9, 40, 56, 0.28);
  padding: 1rem 1.25rem;
  max-width: 100vw;
}

.cookie-consent-inner {
  max-width: var(--lg-container-max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
}

.cookie-consent-text {
  flex: 1 1 320px;
  color: #d7e6f5;
  font-size: 0.92rem;
  margin: 0;
}

.cookie-consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  flex-shrink: 0;
}

.cookie-consent-actions .btn-outline-light {
  border-color: rgba(255, 255, 255, 0.55);
  color: #eaf2fb;
}

.cookie-consent-actions .btn-outline-light:hover,
.cookie-consent-actions .btn-outline-light:focus {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

@media (max-width: 575.98px) {
  .cookie-consent-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .cookie-consent-actions {
    justify-content: stretch;
  }

  .cookie-consent-actions .btn {
    flex: 1 1 auto;
  }
}
