/* ============================================================
   Expedição Glider Brasil — Manual de Usuário
   Color tokens:
     --navy:    #0A1A2F
     --orange:  #E27A37
     --sky:     #74B4D6
     --sand:    #D9B07E
   Font: Inter (Google Fonts)
   ============================================================ */

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

:root {
  /* palette */
  --navy:       #0A1A2F;
  --navy-light: #122440;
  --navy-dark:  #060F1A;
  --orange:     #E27A37;
  --orange-light: #F0944F;
  --orange-dark:  #C46425;
  --sky:        #74B4D6;
  --sky-light:  #A3D0E8;
  --sky-dark:   #4E94B8;
  --sand:       #D9B07E;
  --sand-light: #E8CDA6;
  --sand-dark:  #B8914E;

  /* neutrals */
  --white:      #FFFFFF;
  --gray-50:    #F8F9FA;
  --gray-100:   #F1F3F5;
  --gray-200:   #E9ECEF;
  --gray-300:   #DEE2E6;
  --gray-400:   #CED4DA;
  --gray-500:   #ADB5BD;
  --gray-600:   #868E96;
  --gray-700:   #495057;
  --gray-800:   #343A40;
  --gray-900:   #212529;

  /* semantic */
  --bg:         var(--gray-50);
  --text:       var(--gray-900);
  --text-muted: var(--gray-600);
  --border:     var(--gray-200);
  --radius-sm:  4px;
  --radius:     8px;
  --radius-lg:  12px;
  --radius-xl:  16px;
  --shadow-sm:  0 1px 3px rgba(10,26,47,.06), 0 1px 2px rgba(10,26,47,.04);
  --shadow:     0 4px 12px rgba(10,26,47,.08), 0 2px 4px rgba(10,26,47,.04);
  --shadow-lg:  0 12px 32px rgba(10,26,47,.12), 0 4px 8px rgba(10,26,47,.06);
  --transition: 200ms ease;
  --transition-slow: 350ms ease;

  /* layout */
  --sidebar-w:     280px;
  --header-h:      64px;
  --content-max-w: 820px;

  /* typography */
  --font:       'Inter', system-ui, -apple-system, sans-serif;
  --leading:    1.7;
  --leading-tight: 1.3;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  font-size: 1rem;
  line-height: var(--leading);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Accessible focus ring */
:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}

::selection {
  background: var(--sky-light);
  color: var(--navy);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--orange);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--orange-light);
}

/* ----- Typography ----- */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: var(--leading-tight);
  color: var(--navy);
}

h1 { font-size: 2rem;   margin-bottom: 1rem; }
h2 { font-size: 1.5rem; margin-bottom: 0.75rem; }
h3 { font-size: 1.25rem; margin-bottom: 0.5rem; }
h4 { font-size: 1.1rem;  margin-bottom: 0.5rem; }

p {
  margin-bottom: 1rem;
}

/* Anchor offset for deep linking */
[id] {
  scroll-margin-top: calc(var(--header-h) + 24px);
}

/* ============================================================
   LAYOUT
   ============================================================ */

.layout {
  display: flex;
  min-height: 100vh;
}

/* ----- Sidebar ----- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--navy);
  color: var(--white);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow: hidden;
  transition: transform var(--transition-slow);
}

.sidebar__header {
  flex-shrink: 0;
  padding: 20px 20px 12px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar__logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--white);
}

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

.sidebar__logo-text {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.sidebar__title {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.sidebar__subtitle {
  font-size: 0.7rem;
  color: var(--sky);
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Sidebar search box */
.sidebar__search {
  flex-shrink: 0;
  padding: 12px 16px;
}

.sidebar__search-input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius);
  color: var(--white);
  font-family: var(--font);
  font-size: 0.8125rem;
  outline: none;
  transition: border-color var(--transition), background var(--transition);
}

.sidebar__search-input::placeholder {
  color: rgba(255,255,255,.4);
}

.sidebar__search-input:focus {
  border-color: var(--orange);
  background: rgba(255,255,255,.12);
}

.sidebar__search-wrap {
  position: relative;
}

.sidebar__search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: rgba(255,255,255,.4);
  pointer-events: none;
}

/* Sidebar nav */
.sidebar__nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.15) transparent;
}

.sidebar__nav::-webkit-scrollbar {
  width: 4px;
}

.sidebar__nav::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.15);
  border-radius: 4px;
}

.sidebar__group {
  margin-bottom: 4px;
}

.sidebar__group-title {
  display: block;
  padding: 8px 20px 4px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sand);
  user-select: none;
}

.sidebar__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 20px 7px 24px;
  font-size: 0.8125rem;
  color: rgba(255,255,255,.7);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: background var(--transition), color var(--transition),
              border-color var(--transition);
}

.sidebar__link:hover {
  background: rgba(255,255,255,.05);
  color: var(--white);
}

.sidebar__link--active {
  background: rgba(255,255,255,.08);
  color: var(--white);
  border-left-color: var(--orange);
  font-weight: 600;
}

.sidebar__link-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  opacity: 0.6;
}

.sidebar__link--active .sidebar__link-icon {
  opacity: 1;
}

/* Nested (sub-section) links */
.sidebar__link--sub {
  padding-left: 48px;
  font-size: 0.78rem;
}

/* Sidebar footer */
.sidebar__footer {
  flex-shrink: 0;
  padding: 12px 20px;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: 0.7rem;
  color: rgba(255,255,255,.35);
  text-align: center;
}

/* ----- Mobile hamburger ----- */
.hamburger {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 200;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: var(--radius);
  background: var(--navy);
  color: var(--white);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  transition: background var(--transition);
}

.hamburger:hover {
  background: var(--navy-light);
}

.hamburger svg {
  width: 22px;
  height: 22px;
}

/* Overlay behind sidebar on mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 90;
  opacity: 0;
  transition: opacity var(--transition-slow);
}

.sidebar-overlay--visible {
  display: block;
  opacity: 1;
}

/* ----- Main content ----- */
.content {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
}

/* ============================================================
   HEADER (top bar inside content area)
   ============================================================ */

.header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: rgba(248,249,250,.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 32px;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.breadcrumb a {
  color: var(--text-muted);
  transition: color var(--transition);
}

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

.breadcrumb__sep {
  color: var(--gray-400);
  font-size: 0.75rem;
  user-select: none;
}

.breadcrumb__current {
  color: var(--navy);
  font-weight: 600;
}

/* ============================================================
   PAGE CONTENT
   ============================================================ */

.page {
  max-width: var(--content-max-w);
  margin: 0 auto;
  padding: 40px 32px 80px;
}

/* Section spacing */
.section {
  margin-bottom: 56px;
}

.section:last-child {
  margin-bottom: 0;
}

/* Section title with left accent */
.section__title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--navy);
  padding-bottom: 12px;
  border-bottom: 3px solid var(--orange);
  margin-bottom: 24px;
}

.section__subtitle {
  font-size: 1.15rem;
  color: var(--navy);
  margin-top: 28px;
  margin-bottom: 12px;
  padding-left: 12px;
  border-left: 3px solid var(--sky);
}

/* ============================================================
   CARDS (step-by-step, feature highlights)
   ============================================================ */

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}

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

.card__header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
}

.card__step {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--orange);
  color: var(--white);
  font-weight: 700;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card__title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.4;
  margin-bottom: 0;
}

.card__body {
  color: var(--gray-700);
  font-size: 0.9375rem;
  line-height: 1.65;
}

.card__body p:last-child {
  margin-bottom: 0;
}

/* Card variants */
.card--highlight {
  border-left: 4px solid var(--orange);
}

.card--info {
  border-left: 4px solid var(--sky);
  background: linear-gradient(135deg, rgba(116,180,214,.04), var(--white));
}

.card--warning {
  border-left: 4px solid var(--sand);
  background: linear-gradient(135deg, rgba(217,176,126,.06), var(--white));
}

.card--success {
  border-left: 4px solid #3CB371;
  background: linear-gradient(135deg, rgba(60,179,113,.04), var(--white));
}

/* ============================================================
   STEP LIST (numbered instruction sequence)
   ============================================================ */

.steps {
  counter-reset: step-counter;
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
}

.steps__item {
  counter-increment: step-counter;
  position: relative;
  padding: 20px 24px 20px 72px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}

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

.steps__item::before {
  content: counter(step-counter);
  position: absolute;
  left: 20px;
  top: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--orange);
  color: var(--white);
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.steps__item-title {
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 4px;
}

.steps__item-desc {
  color: var(--gray-700);
  font-size: 0.9375rem;
}

/* ============================================================
   CALLOUT / ALERT BOXES
   ============================================================ */

.callout {
  display: flex;
  gap: 14px;
  padding: 16px 20px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 0.9375rem;
  line-height: 1.6;
}

.callout__icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin-top: 2px;
}

.callout--tip {
  background: rgba(116,180,214,.1);
  border: 1px solid rgba(116,180,214,.3);
  color: var(--navy);
}

.callout--warning {
  background: rgba(217,176,126,.12);
  border: 1px solid rgba(217,176,126,.35);
  color: var(--navy);
}

.callout--important {
  background: rgba(226,122,55,.08);
  border: 1px solid rgba(226,122,55,.3);
  color: var(--navy);
}

/* ============================================================
   IMAGES & SCREENSHOTS
   ============================================================ */

.screenshot {
  margin: 20px 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.screenshot img {
  width: 100%;
  display: block;
}

.screenshot__caption {
  padding: 10px 16px;
  background: var(--gray-100);
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-align: center;
}

/* Phone mockup frame */
.phone-frame {
  max-width: 320px;
  margin: 24px auto;
  border: 8px solid var(--navy);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.phone-frame img {
  width: 100%;
  display: block;
}

/* ============================================================
   TABLES
   ============================================================ */

.table-wrap {
  overflow-x: auto;
  margin-bottom: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

thead {
  background: var(--navy);
  color: var(--white);
}

th {
  padding: 10px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 0.8125rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--gray-800);
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:nth-child(even) {
  background: var(--gray-50);
}

tbody tr:hover {
  background: rgba(116,180,214,.06);
}

/* ============================================================
   INLINE CODE & KBD
   ============================================================ */

code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.85em;
  background: var(--gray-100);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  color: var(--orange-dark);
}

kbd {
  display: inline-block;
  padding: 2px 8px;
  font-family: var(--font);
  font-size: 0.8em;
  background: var(--gray-100);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  box-shadow: 0 1px 0 var(--gray-300);
  color: var(--gray-800);
}

/* ============================================================
   LISTS inside content
   ============================================================ */

.content ul,
.content ol {
  margin: 0 0 1rem 1.5rem;
}

.content li {
  margin-bottom: 0.35rem;
}

.content li::marker {
  color: var(--orange);
}

/* ============================================================
   BADGE / TAG
   ============================================================ */

.badge {
  display: inline-block;
  padding: 2px 10px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
  white-space: nowrap;
}

.badge--orange  { background: rgba(226,122,55,.12);  color: var(--orange-dark); }
.badge--sky     { background: rgba(116,180,214,.15);  color: var(--sky-dark); }
.badge--sand    { background: rgba(217,176,126,.18);  color: var(--sand-dark); }
.badge--navy    { background: rgba(10,26,47,.08);     color: var(--navy); }
.badge--success { background: rgba(60,179,113,.12);   color: #1E7A46; }

/* ============================================================
   SEARCH RESULTS OVERLAY
   ============================================================ */

.search-results {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 16px;
  right: 16px;
  max-height: 320px;
  overflow-y: auto;
  background: var(--navy-light);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 110;
}

.search-results--open {
  display: block;
}

.search-results__item {
  display: block;
  padding: 10px 16px;
  font-size: 0.8125rem;
  color: rgba(255,255,255,.8);
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,.06);
  transition: background var(--transition);
}

.search-results__item:hover,
.search-results__item--active {
  background: rgba(255,255,255,.08);
  color: var(--white);
}

.search-results__item:last-child {
  border-bottom: none;
}

.search-results__title {
  font-weight: 600;
  color: var(--white);
  display: block;
}

.search-results__context {
  font-size: 0.75rem;
  color: rgba(255,255,255,.5);
  display: block;
  margin-top: 2px;
}

.search-results mark {
  background: rgba(226,122,55,.35);
  color: var(--white);
  border-radius: 2px;
  padding: 0 2px;
}

.search-results__empty {
  padding: 16px;
  text-align: center;
  color: rgba(255,255,255,.4);
  font-size: 0.8125rem;
}

/* ============================================================
   BACK-TO-TOP BUTTON
   ============================================================ */

.back-to-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 80;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: var(--orange);
  color: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity var(--transition-slow), visibility var(--transition-slow),
              transform var(--transition-slow), background var(--transition);
}

.back-to-top--visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--orange-light);
}

.back-to-top svg {
  width: 20px;
  height: 20px;
}

/* ============================================================
   FOOTER
   ============================================================ */

.footer {
  padding: 32px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.footer a {
  color: var(--orange);
  font-weight: 500;
}

/* ============================================================
   HR / DIVIDER
   ============================================================ */

hr {
  border: none;
  height: 1px;
  background: var(--border);
  margin: 32px 0;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-in {
  animation: fadeInUp 0.4s ease both;
}

/* Staggered entrance for cards/steps */
.card:nth-child(1)  { animation-delay: 0ms; }
.card:nth-child(2)  { animation-delay: 60ms; }
.card:nth-child(3)  { animation-delay: 120ms; }
.card:nth-child(4)  { animation-delay: 180ms; }
.card:nth-child(5)  { animation-delay: 240ms; }

.steps__item:nth-child(1)  { animation-delay: 0ms; }
.steps__item:nth-child(2)  { animation-delay: 60ms; }
.steps__item:nth-child(3)  { animation-delay: 120ms; }
.steps__item:nth-child(4)  { animation-delay: 180ms; }
.steps__item:nth-child(5)  { animation-delay: 240ms; }
.steps__item:nth-child(6)  { animation-delay: 300ms; }

/* ============================================================
   RESPONSIVE — Tablet (<= 1024px)
   ============================================================ */

@media (max-width: 1024px) {
  :root {
    --sidebar-w: 260px;
  }

  .page {
    padding: 32px 24px 64px;
  }

  .header {
    padding: 0 24px;
  }
}

/* ============================================================
   RESPONSIVE — Mobile (<= 768px)
   ============================================================ */

@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .sidebar {
    transform: translateX(-100%);
    width: 280px;
  }

  .sidebar--open {
    transform: translateX(0);
  }

  .content {
    margin-left: 0;
  }

  .header {
    padding: 0 16px 0 64px;
    height: 56px;
  }

  html {
    scroll-padding-top: 72px;
  }

  .page {
    padding: 24px 16px 64px;
  }

  .section__title {
    font-size: 1.35rem;
  }

  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.25rem; }
  h3 { font-size: 1.1rem; }

  .card {
    padding: 18px;
  }

  .steps__item {
    padding: 16px 16px 16px 60px;
  }

  .steps__item::before {
    left: 14px;
    top: 16px;
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
  }

  .phone-frame {
    max-width: 260px;
  }

  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
  }

  table {
    font-size: 0.8rem;
  }

  th, td {
    padding: 8px 12px;
  }
}

/* ============================================================
   RESPONSIVE — Small phone (<= 480px)
   ============================================================ */

@media (max-width: 480px) {
  .page {
    padding: 20px 12px 48px;
  }

  .card__header {
    flex-direction: column;
    gap: 8px;
  }

  .breadcrumb {
    font-size: 0.75rem;
  }
}

/* ============================================================
   PRINT
   ============================================================ */

@media print {
  .sidebar,
  .hamburger,
  .sidebar-overlay,
  .back-to-top,
  .sidebar__search,
  .search-results {
    display: none !important;
  }

  .content {
    margin-left: 0;
  }

  .header {
    position: static;
    background: none;
    backdrop-filter: none;
    border-bottom: 1px solid #ccc;
  }

  .card,
  .steps__item {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ddd;
  }

  body {
    font-size: 11pt;
    color: #000;
  }
}
