/* =========================================================
   RC X-DESIGN FINAL — Aventura do Saber
   Objetivo: refinar a interface inteira do /portal com padrão premium,
   tipografia menor, menos densidade visual, mais hierarquia e sem alterar
   cores, ícones, rotas ou regras de negócio.
   ========================================================= */

:root{
  --xd-ink:#1a1060;
  --xd-muted:#5f5794;
  --xd-soft:#f4f2ff;
  --xd-card:#ffffff;
  --xd-border:rgba(91,57,201,.13);
  --xd-border-strong:rgba(91,57,201,.22);
  --xd-shadow:0 14px 38px rgba(26,16,96,.10);
  --xd-shadow-soft:0 8px 22px rgba(26,16,96,.075);
  --xd-radius-xl:24px;
  --xd-radius-lg:18px;
  --xd-radius-md:14px;
  --xd-topbar:58px;
  --xd-sidebar:236px;
  --xd-sidebar-closed:64px;
  --xd-content-pad:20px;
  --xd-text:13.5px;
  --xd-small:12px;
  --xd-micro:10.5px;
}

html{font-size:14px!important;text-rendering:geometricPrecision!important;}
body{
  font-size:var(--xd-text)!important;
  line-height:1.46!important;
  letter-spacing:-.01em!important;
  background:#f4f2ff!important;
}

/* ===== Tipografia global mais premium e compacta ===== */
h1,h2,h3,h4,h5,h6,
.hero h1,.ads-base-hero h1,.ads-worldscape-hero h1,.ads-trail-hero h1,.ads-activity-hero h1,
.rc-treasures-hero h1,.rc-book-hero h1,.rc-store-hero h1,.ads-evolution-hero h1,.rc-parent-hero h1,
.admin-hero-panel h1,.role-hero h1,.access-intro h1,.demo-hero h1,.presentation-hero h1{
  letter-spacing:-.045em!important;
  line-height:1.04!important;
}

h1,
.hero h1,
.ads-base-hero h1,
.ads-worldscape-hero h1,
.ads-trail-hero h1,
.ads-activity-hero h1,
.rc-treasures-hero h1,
.rc-book-hero h1,
.rc-store-hero h1,
.ads-evolution-hero h1,
.rc-parent-hero h1,
.admin-hero-panel h1,
.role-hero h1,
.access-intro h1{
  font-size:clamp(26px,3vw,39px)!important;
  margin-bottom:10px!important;
}

h2,
.ads-theo-strip h2,
.panel-head h2,
.ads-panel-head h2,
.section-title,
.section-title-dark,
.sec-title{
  font-size:clamp(20px,2.25vw,29px)!important;
  line-height:1.08!important;
  margin-bottom:8px!important;
}

h3,.card h3,.panel h3,.premium-panel h3,.ads-base-tile strong,.world-card h3,.age-card h3{
  font-size:clamp(15px,1.6vw,20px)!important;
  line-height:1.16!important;
}

h4,h5,h6{font-size:14px!important;line-height:1.18!important;}
p,li,td,th,label,input,select,textarea,button,a,.muted,.ads-muted,
.hero-p,.section-sub,.section-sub-dark,.sec-sub,.access-intro p,
.ads-base-copy p,.ads-world-story-card p,.ads-trail-step-meta,
.rc-store-card p,.rc-treasure-card p,.ads-play-card p{
  font-size:var(--xd-text)!important;
  line-height:1.48!important;
}

small,.small,.eyebrow,.ads-eyebrow,.ads-kicker,.rc-kicker,.section-eyebrow,.section-eyebrow-light,
.status-badge,.pill,.panel-pill,.badge,.ads-stage-header span,.prog-label,.sidebar-section{
  font-size:var(--xd-micro)!important;
  letter-spacing:.055em!important;
}

.muted,.ads-muted,.section-sub,.section-sub-dark,.sec-sub,.hero-p,
.ads-base-copy p,.ads-world-story-card p,.ads-trail-step-meta,
.rc-store-card p,.rc-treasure-card p,.ads-play-card p{
  color:var(--xd-muted)!important;
  font-weight:600!important;
}

/* ===== Shell, topbar e sidebar ===== */
.topbar,
.landing-nav{
  height:var(--xd-topbar)!important;
  min-height:var(--xd-topbar)!important;
  padding:0 18px!important;
  gap:10px!important;
}
.brand{font-size:16px!important;gap:8px!important;letter-spacing:-.035em!important;}
.brand-icon{width:34px!important;height:34px!important;border-radius:12px!important;font-size:17px!important;}
.topbar-right{gap:7px!important;}
.nav-user{font-size:12px!important;padding:6px 10px!important;max-width:180px!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;}
.notification-btn,.sidebar-mobile-toggle{width:32px!important;height:32px!important;border-radius:10px!important;}
.button,.btn,.ads-btn,.rc-btn,.ads-map-btn,.ads-world-btn,.ads-trail-btn,
.ads-primary-action,.ads-secondary-action,.btn-star,.btn-sky,.btn-ghost,.btn-ghost-dark{
  min-height:34px!important;
  padding:8px 13px!important;
  border-radius:12px!important;
  font-size:12.5px!important;
  line-height:1.15!important;
  gap:6px!important;
  letter-spacing:-.01em!important;
}
.btn-big,.ads-big-action{padding:11px 18px!important;font-size:13.5px!important;border-radius:15px!important;}
.button.small{padding:6px 10px!important;font-size:11.5px!important;min-height:30px!important;}
.lang-btn{padding:5px 9px!important;font-size:11.5px!important;border-radius:9px!important;}
.lang-dropdown{min-width:132px!important;border-radius:11px!important;}
.lang-option{padding:8px 9px!important;font-size:12px!important;}

.app-shell{min-height:calc(100vh - var(--xd-topbar))!important;}
.sidebar{
  width:var(--xd-sidebar)!important;
  top:var(--xd-topbar)!important;
  height:calc(100vh - var(--xd-topbar))!important;
  min-height:calc(100vh - var(--xd-topbar))!important;
}
.sidebar.collapsed{width:var(--xd-sidebar-closed)!important;}
.sidebar-nav{padding:12px 10px 8px!important;gap:4px!important;}
.sidebar-link{
  padding:8px 9px!important;
  border-radius:12px!important;
  font-size:12.25px!important;
  gap:9px!important;
  min-height:38px!important;
}
.sidebar-link .s-icon{font-size:14px!important;width:28px!important;height:28px!important;border-radius:9px!important;}
.sidebar-section{padding:10px 9px 4px!important;}
.sidebar-toggle{padding:10px 10px 6px!important;}
.sidebar-user{padding:12px 10px!important;gap:10px!important;}
.sidebar-avatar{width:34px!important;height:34px!important;border-radius:11px!important;font-size:15px!important;}
.sidebar-user-info strong{font-size:12.5px!important;}
.sidebar-user-info span{font-size:10.5px!important;}
.sidebar-supporter-card{margin:6px 10px 8px!important;padding:10px 8px!important;border-radius:15px!important;gap:6px!important;}
.sidebar-supporter-card img{width:88px!important;max-height:56px!important;}
.sidebar-supporter-card span{font-size:8.5px!important;}
.sidebar-supporter-card em{font-size:10px!important;}
.sidebar-footer{padding:8px!important;}
.app-content{padding:var(--xd-content-pad) var(--xd-content-pad) 72px!important;}

/* ===== Cards, painéis e grids ===== */
.panel,.card,.premium-panel,.access-panel,.quick-panel,.role-hero,.admin-hero-panel,
.finance-form-panel,.rc-soft-panel,.rc-summary-card,.ads-story-panel,.ads-panel-head,
.ads-base-tile,.ads-explorer-card,.ads-world-story-card,.ads-world-play,.ads-world-trail,
.ads-trail-step,.ads-question-card,.ads-question-stage,.ads-statement-card,
.rc-treasure-card,.rc-store-card,.rc-memory-page,.ads-play-card,.ads-evolution-story,
.ads-explorers-panel,.world-card,.age-card,.benefit-item,.stat-box,.metric-card,.daily-mission-card,
.country-card,.plan-card,.tcard,.hero-card,.hero-status-card,.finance-page .panel{
  border-radius:var(--xd-radius-lg)!important;
  box-shadow:var(--xd-shadow-soft)!important;
  border-color:var(--xd-border)!important;
}
.panel,.card,.premium-panel,.access-panel,.quick-panel,.finance-form-panel,.rc-soft-panel,
.rc-summary-card,.ads-story-panel,.ads-panel-head,.ads-explorer-card,.ads-world-story-card,
.ads-world-play,.ads-world-trail,.ads-question-stage,.ads-statement-card,.ads-play-card,
.ads-evolution-story,.ads-explorers-panel,.world-card,.age-card,.benefit-item,.metric-card,
.daily-mission-card,.country-card,.plan-card,.tcard,.hero-card,.hero-status-card{
  padding:16px!important;
}

.panel-head,.ads-panel-head,.admin-hero-panel,.role-hero,.rc-parent-hero__content,
.table-toolbar,.finance-form-panel h2{
  gap:10px!important;
}

.grid,.grid-2,.cards,.admin-metric-grid,.dashboard-layout-grid,.ads-base-grid,
.ads-soft-stats,.world-grid,.benefits-grid,.age-grid,.stats-grid,.rc-form-grid,.form-grid-3{
  gap:14px!important;
}

/* ===== Heróis compactos por área ===== */
.hero-wrap,.landing-hero,.presentation-hero,.demo-hero,
.ads-base-hero,.ads-worldscape-hero,.ads-trail-hero,.ads-activity-hero,
.rc-treasures-hero,.rc-book-hero,.rc-store-hero,.ads-evolution-hero,
.rc-parent-hero,.admin-hero-panel,.role-hero,.access-wrap{
  padding:24px!important;
  border-radius:var(--xd-radius-xl)!important;
  gap:20px!important;
}
.hero,.ads-base-hero,.ads-worldscape-hero,.ads-trail-hero,.ads-activity-hero,
.rc-parent-hero,.dashboard-layout-grid,.access-wrap{
  gap:22px!important;
}
.hero-card{padding:20px!important;border-radius:22px!important;}
.hero-pill,.ads-eyebrow,.rc-kicker,.eyebrow,.section-eyebrow,.section-eyebrow-light,
.panel-pill,.pill,.status-badge{
  padding:5px 10px!important;
  border-radius:999px!important;
}
.hero-actions,.ads-base-actions,.ads-worldscape-actions,.ads-world-actions,.ads-trail-actions,
.rc-treasures-actions,.ads-result-actions,.ads-page-actions,.rc-parent-actions{
  gap:8px!important;
}

/* ===== Portal do aluno / mundos / trilhas ===== */
.ads-base-grid{grid-template-columns:repeat(auto-fit,minmax(220px,1fr))!important;}
.ads-base-tile{padding:14px!important;gap:11px!important;min-height:auto!important;}
.ads-base-tile b{font-size:22px!important;width:38px!important;height:38px!important;border-radius:12px!important;}
.ads-base-tile em{font-size:12px!important;line-height:1.35!important;}
.ads-theo-strip{padding:16px!important;border-radius:20px!important;gap:12px!important;}
.ads-theo-face,.ads-theo-orb{font-size:30px!important;width:54px!important;height:54px!important;}
.ads-soft-stats{grid-template-columns:repeat(auto-fit,minmax(180px,1fr))!important;gap:12px!important;}
.ads-soft-stats div{padding:14px!important;border-radius:16px!important;}
.ads-soft-stats b{font-size:15px!important;}
.ads-soft-stats span{font-size:12px!important;}
.ads-map-canvas,.ads-world-map,.ads-worldscape-map{border-radius:22px!important;min-height:420px!important;}
.ads-map-node,.world-icon{transform:scale(.88)!important;}
.ads-trail-step{padding:14px!important;gap:11px!important;}
.ads-trail-step-title{font-size:15px!important;}
.ads-challenge-shell{gap:16px!important;}
.ads-challenge-top{font-size:12px!important;margin-bottom:12px!important;}
.ads-challenge-hero{gap:16px!important;}
.ads-question-icon{font-size:24px!important;width:44px!important;height:44px!important;}
.ads-statement-card h2{font-size:clamp(18px,2.2vw,25px)!important;line-height:1.2!important;}
.ads-option,.ads-answer-option{padding:12px!important;border-radius:14px!important;font-size:13px!important;}
.rc-treasure-icon,.daily-mission-icon{width:42px!important;height:42px!important;font-size:22px!important;border-radius:14px!important;}

/* ===== Admin, professor, pais e financeiro ===== */
.admin-dashboard-page,.finance-page,.rc-parent-shell{gap:16px!important;}
.admin-metric-grid,.stats-grid{grid-template-columns:repeat(auto-fit,minmax(155px,1fr))!important;}
.metric-card,.stat-box,.rc-report-metric{padding:14px!important;border-radius:16px!important;}
.metric-card strong,.stat-box strong,.rc-report-metric strong{font-size:clamp(22px,2.4vw,31px)!important;line-height:1!important;}
.metric-card span,.stat-box span,.rc-report-metric span{font-size:12px!important;line-height:1.32!important;}
.quick-actions{gap:8px!important;}
.country-card{padding:13px!important;}
.country-flag{font-size:22px!important;}
.country-name{font-size:14px!important;}
.country-sub,.country-status{font-size:11.5px!important;}

/* ===== Tabelas compactas e legíveis ===== */
.table-wrap,table{border-radius:var(--xd-radius-md)!important;}
table{width:100%!important;border-collapse:separate!important;border-spacing:0!important;font-size:12.5px!important;}
th,td{padding:9px 10px!important;vertical-align:middle!important;}
th{font-size:11px!important;text-transform:uppercase!important;letter-spacing:.05em!important;font-weight:850!important;color:#4c437f!important;background:rgba(245,243,255,.9)!important;}
td{font-size:12.5px!important;color:#24185f!important;}
.table-actions,.actions{gap:6px!important;}

/* ===== Formulários ===== */
.form,.finance-form,.rc-form-grid{gap:12px!important;}
.form-group,.form-row{gap:7px!important;margin-bottom:10px!important;}
label{font-size:11.5px!important;font-weight:800!important;color:#3d3276!important;}
input,select,textarea,.input,.form-control{
  min-height:38px!important;
  padding:9px 11px!important;
  border-radius:12px!important;
  border:1px solid var(--xd-border-strong)!important;
  background:#fff!important;
  color:#1a1060!important;
  box-shadow:none!important;
}
textarea{min-height:96px!important;}
input:focus,select:focus,textarea:focus{
  border-color:#8b5cf6!important;
  box-shadow:0 0 0 4px rgba(139,92,246,.14)!important;
}
.alert,.success,.ads-alert{
  padding:11px 13px!important;
  border-radius:14px!important;
  font-size:12.5px!important;
}

/* ===== Páginas públicas ===== */
.public-body{font-size:var(--xd-text)!important;}
.landing-nav nav a,.lnav a,.nav a{font-size:12.5px!important;padding:7px 9px!important;}
.hero-wrap{padding:54px 24px 46px!important;}
.hero{grid-template-columns:minmax(0,1.05fr) minmax(280px,.95fr)!important;gap:36px!important;}
.hero-p{max-width:560px!important;margin-bottom:22px!important;}
.mascot-grid{gap:8px!important;margin-bottom:16px!important;}
.mascot-cell{height:58px!important;border-radius:16px!important;}
.mascot-cell img{width:42px!important;height:42px!important;}
.hcard-title{font-size:18px!important;}
.hcard-sub,.reward-box,.subject-tag{font-size:12.5px!important;}
.stats-section,.subjects-section,.age-section,.steps-section,.benefits-section{padding:48px 24px!important;}
.stat-box{padding:18px 14px!important;border-radius:18px!important;}
.stat-box strong{font-size:30px!important;}
.age-card{padding:20px!important;border-radius:20px!important;}
.age-card ul li{font-size:12.5px!important;padding:6px 0!important;}
.steps-grid{gap:12px!important;}
.step-num{width:54px!important;height:54px!important;font-size:20px!important;margin-bottom:14px!important;}
.step-item h4{font-size:14px!important;}
.step-item p{font-size:12.5px!important;}
.benefit-icon{width:44px!important;height:44px!important;font-size:22px!important;border-radius:14px!important;}
.benefit-item{gap:13px!important;padding:17px!important;}

/* ===== Login / acesso ===== */
.access-wrap{min-height:calc(100vh - var(--xd-topbar))!important;align-items:center!important;}
.access-intro,.access-panel{padding:22px!important;}
.access-benefit{padding:12px!important;border-radius:15px!important;}
.access-benefit strong{font-size:13px!important;}
.access-benefit span{font-size:12px!important;}
.tab{padding:8px 10px!important;font-size:12px!important;border-radius:11px!important;}

/* ===== Scroll e microinterações ===== */
*{scrollbar-width:thin;scrollbar-color:rgba(109,74,255,.35) rgba(245,243,255,.75);}
*::-webkit-scrollbar{width:8px;height:8px;}
*::-webkit-scrollbar-thumb{background:rgba(109,74,255,.28);border-radius:999px;}
*::-webkit-scrollbar-track{background:rgba(245,243,255,.75);}
a,button,.button,.btn,.ads-btn,.rc-btn,.sidebar-link,.card,.panel,.ads-base-tile,.world-card{
  transition:transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease!important;
}
.button:hover,.btn:hover,.ads-btn:hover,.rc-btn:hover,.ads-base-tile:hover,.world-card:hover,.panel:hover,.card:hover{
  transform:translateY(-1px)!important;
}

/* ===== Responsividade final ===== */
@media(max-width:1100px){
  :root{--xd-content-pad:18px;--xd-sidebar:224px;}
  .dashboard-layout-grid,.hero,.access-wrap{grid-template-columns:1fr!important;}
  .hero-card{max-width:620px!important;}
}
@media(max-width:980px){
  .sidebar{top:var(--xd-topbar)!important;height:calc(100vh - var(--xd-topbar))!important;width:244px!important;}
  .app-content{padding:16px 14px 76px!important;}
  .topbar{padding:0 12px!important;}
  .brand{font-size:14px!important;}
  .nav-user{display:none!important;}
}
@media(max-width:760px){
  :root{--xd-text:13px;--xd-content-pad:14px;}
  h1,.hero h1,.ads-base-hero h1,.ads-worldscape-hero h1,.ads-trail-hero h1,.access-intro h1{font-size:clamp(24px,7vw,32px)!important;}
  h2,.section-title,.section-title-dark{font-size:clamp(19px,5.4vw,25px)!important;}
  .hero-wrap,.landing-hero,.presentation-hero,.demo-hero,.ads-base-hero,.ads-worldscape-hero,.ads-trail-hero,.ads-activity-hero,
  .rc-treasures-hero,.rc-book-hero,.rc-store-hero,.ads-evolution-hero,.rc-parent-hero,.admin-hero-panel,.role-hero,.access-wrap{
    padding:18px!important;border-radius:20px!important;
  }
  .panel,.card,.premium-panel,.access-panel,.quick-panel,.finance-form-panel,.rc-soft-panel,
  .rc-summary-card,.ads-story-panel,.ads-panel-head,.ads-explorer-card,.ads-world-story-card,
  .ads-world-play,.ads-world-trail,.ads-question-stage,.ads-statement-card,.ads-play-card,
  .ads-evolution-story,.ads-explorers-panel,.world-card,.age-card,.benefit-item,.metric-card,
  .daily-mission-card,.country-card,.plan-card,.tcard,.hero-card,.hero-status-card{
    padding:14px!important;border-radius:16px!important;
  }
  .ads-map-canvas,.ads-world-map,.ads-worldscape-map{min-height:360px!important;}
  th,td{padding:8px!important;font-size:12px!important;}
  .table-wrap{overflow-x:auto!important;}
  .topbar-right .button.ghost{display:none!important;}
  .stats-section,.subjects-section,.age-section,.steps-section,.benefits-section{padding:36px 16px!important;}
  .steps-grid,.age-grid,.benefits-grid,.stats-grid{grid-template-columns:1fr!important;}
  .steps-grid::before{display:none!important;}
}
@media(max-width:480px){
  .brand-text{display:inline!important;max-width:138px!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;}
  .lang-selector{display:none!important;}
  .button,.btn,.ads-btn,.rc-btn{width:100%!important;justify-content:center!important;}
  .hero-actions,.ads-base-actions,.ads-worldscape-actions,.ads-world-actions,.ads-trail-actions,.rc-parent-actions{align-items:stretch!important;flex-direction:column!important;}
}
