:root {
    --ot-navy: #0F1B2E;
    --ot-ink: #0b1220;
    --ot-paper: #F8FAFC;
    --ot-card: #E5EAF2;
    --ot-blue: #2563EB;
    --ot-teal: #14B8A6;
    --ot-border: rgba(148, 163, 184, 0.22);
    --ot-shadow: 0 18px 42px rgba(2, 6, 23, 0.18);
    --ot-radius: 18px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--ot-navy);
    color: var(--text-body, #dfeaf7);
}

a, button, input, textarea, select { font: inherit; }

a, button { -webkit-tap-highlight-color: transparent; }

button, a { transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background-color 180ms ease; }

button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
    outline: 3px solid rgba(20, 184, 166, 0.72);
    outline-offset: 3px;
}

.skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 10000;
    padding: 12px 16px;
    transform: translateY(-160%);
    border-radius: 10px;
    background: #F8FAFC;
    color: #0F1B2E;
    font-weight: 800;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
}

.skip-link:focus { transform: translateY(0); }

.glass-container, .login-card, .chat-container, .card, .card-chamado, .quiz-box, .resultado-box {
    border-color: var(--ot-border);
    box-shadow: var(--ot-shadow);
}

.btn-voltar-topo, .btn-voltar, .btn-footer, .back-link, .link-action {
    font-weight: 700;
}

.btn-voltar-topo, .btn-voltar, .btn-footer {
    border-radius: 12px;
}

.btn-voltar-topo:hover, .btn-voltar:hover, .btn-footer:hover, .back-link:hover, .link-action:hover {
    transform: translateY(-2px);
}

.curso-card, .curso-card:hover { border-radius: var(--ot-radius); }

.curso-card:hover { transform: translateY(-5px); }

.curso-card-support {
    border-color: rgba(20, 184, 166, 0.35) !important;
    background: linear-gradient(180deg, rgba(20, 184, 166, 0.07), rgba(255, 255, 255, 0.92)) !important;
}

.curso-card-support .card-icon {
    background: rgba(20, 184, 166, 0.12) !important;
    border-color: rgba(20, 184, 166, 0.18) !important;
}

.curso-card-support h3 { color: var(--accent-green, var(--ot-teal)) !important; }

.section-heading {
    color: var(--text-title, #F8FAFC);
    margin: 0 0 20px;
    text-align: center;
    font-size: clamp(1.35rem, 2.5vw, 1.65rem);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.table-responsive { border-radius: 14px; overflow: auto; }

th, td { min-width: 150px; }

input, textarea, select { min-height: 46px; }

/* Movimento compartilhado: curto, discreto e respeita acessibilidade. */
body {
    opacity: 0;
    animation: ot-page-in 520ms cubic-bezier(.2,.8,.2,1) forwards;
}

body.is-leaving {
    animation: ot-page-out 180ms ease forwards;
}

.header-site, .glass-container, .login-card, .chat-container, .card, .quiz-box, .resultado-box, .card-chamado {
    animation: ot-slide-up 620ms cubic-bezier(.2,.8,.2,1) both;
}

.reveal-on-scroll {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 520ms ease, transform 520ms cubic-bezier(.2,.8,.2,1);
}

.reveal-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.cursos-grid .curso-card:nth-child(2) { transition-delay: 60ms; }
.cursos-grid .curso-card:nth-child(3) { transition-delay: 120ms; }
.cursos-grid .curso-card:nth-child(4) { transition-delay: 180ms; }
.cursos-grid .curso-card:nth-child(5) { transition-delay: 240ms; }
.cursos-grid .curso-card:nth-child(6) { transition-delay: 300ms; }
.cursos-grid .curso-card:nth-child(7) { transition-delay: 360ms; }

button:not(:disabled), a { cursor: pointer; }

button:not(:disabled):active, a:active {
    transform: scale(0.97);
}

.theme-toggle {
    will-change: transform, background-color;
    transition: transform 360ms cubic-bezier(.22,.8,.24,1), background 420ms ease, border-color 420ms ease, box-shadow 420ms ease !important;
}

.theme-toggle.is-switching {
    animation: ot-theme-toggle 360ms cubic-bezier(.2,.8,.2,1);
}

.theme-toggle.is-switching::before { animation: ot-theme-knob 420ms cubic-bezier(.22,.8,.24,1); }

.ot-ripple {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.48);
    transform: translate(-50%, -50%) scale(0);
    pointer-events: none;
    animation: ot-ripple 520ms ease-out forwards;
}

button.ot-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.82;
}

.ot-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 8px;
    vertical-align: -3px;
    border: 2px solid rgba(248, 250, 252, 0.35);
    border-top-color: var(--ot-teal);
    border-radius: 50%;
    animation: ot-spin 720ms linear infinite;
}

.ot-loading-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent-green, var(--ot-teal));
    font-size: 0.82rem;
    font-weight: 700;
    animation: ot-pulse 1.2s ease-in-out infinite;
}

.ot-loading-indicator .ot-spinner { margin: 0; }

@keyframes ot-page-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes ot-page-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes ot-slide-up {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes ot-ripple { to { opacity: 0; transform: translate(-50%, -50%) scale(18); } }
@keyframes ot-spin { to { transform: rotate(360deg); } }
@keyframes ot-pulse { 50% { opacity: 0.55; } }
@keyframes ot-theme-toggle {
    0% { transform: scale(1); }
    45% { transform: scale(1.08) rotate(-2deg); }
    100% { transform: scale(1); }
}
@keyframes ot-theme-knob {
    0% { filter: brightness(1); }
    45% { filter: brightness(1.24); }
    100% { filter: brightness(1); }
}

@media (max-width: 640px) {
    body { padding-left: 14px !important; padding-right: 14px !important; }

    .topbar { position: static !important; margin-bottom: 18px; }

    .topbar-actions { gap: 7px; }

    .btn-admin-top, .contrast-toggle, .btn-instalar-top { padding: 9px 11px !important; }

    .header-site { margin-top: 8px !important; }

    .glass-container { padding: 24px 16px !important; border-radius: 22px !important; }

    .chat-input-wrapper { flex-direction: column; align-items: stretch !important; }

    .btn-send { width: 100%; }

    .cf-card, .cloudflare-panel { align-items: flex-start !important; flex-direction: column; }

    .cf-box, .cf-check { white-space: normal !important; }

    .btn-voltar-topo, .btn-voltar { position: static !important; margin-bottom: 16px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
    body { opacity: 1; }
}