/* BEGIN CSS RESET */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
main, menu, nav, output, ruby, section, summary,
time, mark, audio, video {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    font: inherit;
    vertical-align: baseline;
}

/* HTML5 display-role reset para navegadores antigos */
article, aside, details, figcaption, figure,
footer, header, hgroup, main, menu, nav, section {
    display: block;
}

body {
    line-height: 1;
}

ol {
    list-style: none;
}

blockquote, q {
    quotes: none;
}

#IAResult strong {
    font-weight: bold;
}

#IAResult ul {
    margin-left: 15px;
    list-style: disc;
}

blockquote:before, blockquote:after,
q:before, q:after {
    content: '';
    content: none;
}

table {
    border-collapse: collapse;
    border-spacing: 0;
}

/* Remove outline em links e botões, mas mantém acessibilidade */
a, button, input, textarea, select {
    outline: none;
    box-shadow: none;
}

/* Inherit font para inputs e buttons */
input, button, textarea, select {
    font: inherit;
    color: inherit;
    background: none;
    border-radius: 0;
    border: none;
}

/* Garante box-sizing border-box para todos */
*, *::before, *::after {
    box-sizing: border-box;
}

/* END CSS RESET */

:root {
    --bg-general: #1a1a1a;
    --bg-sidebar: #141416;
    --bg-card: #1d1f21;
    --text: #e6e6e6;
    --muted: #9aa0a6;
    --hover: #26282a;
    --accent: #9db0ff;
    --bg-button: #141416;
    --text-button: #e6e6e6;
    --ask: #323232d9;
    --response: #18222a;
}

body.light-theme {
    /* Tema Light - Default */
    --bg-general: #fbfbfb;
    --bg-sidebar: #f0f3f9;
    --bg-card: #ffffff;
    --text: #1d1f21;
    --muted: #7e7e82;
    --hover: #f3f5ee;
    --accent: #007bff;
    --bg-button: rgb(0, 68, 136);
    --text-button: #ffffff;
    --ask: #f3f5ee;
    --response: #f5f5f5;
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
    background: var(--bg-general);
    color: var(--text);
    display: flex;
}

#container {
    width: 100%;
}

#ai-site {
    display: flex;
}
#ia-empty-guide header p {
    margin-left: 0;
    max-width: 100%;
}

/* SIDEBAR */
#sidebar {
    width: 260px;
    min-width: 60px;
    background: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#sidebar, #main {
    height: 100vh;
}

#sidebar.collapsed {
    width: 60px;
}

.side-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: .8rem;
    /* border-bottom:1px solid #151616; */
    flex-wrap: wrap;
}

.platform-description {
    font-size: 1rem;
}

.logo a {
    display: flex;
    align-items: center;
    gap: .6rem;
    max-width: calc(100% - 48px);
    text-decoration: none;
}
.logo a:visited {
    color: var(--text);
}

.logo img {
    max-width: 40px;
    display: flex;
    align-self: baseline;
}

.logo span {
    font-weight: 600;
    letter-spacing: .4px;
    font-size: 1rem;
}

#sidebar.collapsed .logo span {
    display: none;
}

#collapse-btn {
    background: transparent;
    border: none;
    color: var(--text);
    cursor: pointer;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .12s;
    font-size: 16px;
}

#collapse-btn:hover {
    background: var(--hover);
}

#history {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: .6rem;
    display: flex;
    flex-direction: column;
    gap: .45rem;
}

.side-footer {
    padding: .9rem;
    position: relative;
    display: flex;
    gap: .6rem;
    align-items: flex-start;
    flex-direction: column;
    flex-shrink: 0;
}

/* Novo chat button */
#new-chat-btn {
    padding: .6rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: .6rem;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-button);
    border: 1px solid transparent;
    transition: .2s background, .2s border-color;
}

#sidebar.collapsed #new-chat-btn span {
    display: none;
}

.history-item {
    background: var(--bg-card);
    padding: .6rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: .6rem;
    cursor: pointer;
    color: var(--text);
    border: 1px solid transparent;
    transition: background .12s, border-color .12s;
    justify-content: space-between;
    margin-bottom: 10px;
}

.history-item .icon {
    margin-right: 10px;
}

.history-item .remove-chat-btn {
    color: red;
    cursor: pointer;
}

.history-item.active,
.history-item:hover {
    background: var(--hover);
    border-color: #2b2d2f17;
}

.history-item i {
    font-size: 14px;
    width: 24px;
    text-align: center;
}

.history-item span {
    font-size: .92rem;
}

#sidebar.collapsed .history-item span {
    display: none;
}

#chat-list {
    max-height: 560px;
    overflow: auto;
}

.side-footer .user {
    display: flex;
    gap: .6rem;
    align-items: center;
    width: 100%;
    justify-content: space-between;
    cursor: pointer;
}

.user-info {
    display: flex;
    width: 100%;
    flex-wrap: wrap;
    justify-content: space-between;
}

.username {
    display: inline;
}

.side-footer .user i {
    font-size: 20px;
}

.side-footer strong {
    font-size: .95rem;
}

.side-footer small {
    color: var(--muted);
    font-size: .78rem;
    width: 100%;
}

#sidebar.collapsed .side-footer strong,
#sidebar.collapsed .side-footer small {
    display: none;
}

#input-area .actions {
    display: flex;
    width: 100%;
    justify-content: center;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
    padding-top: 30px;
}

#IAResult .advanced-resources > .title,
#input-area .advanced-resources > .title {
    font-size: 20px;
    width: 100%;
    font-weight: bold;
    color: var(--text);
    margin-bottom: 20px;
}

/* MAIN */
#main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* chat area (scrollable) */
#IAResult {
    flex: 1;
    padding: 1rem;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: .6rem;
    background: var(--bg-general);
}

.msg {
    max-width: 75%;
    padding: .8rem 1rem;
    border-radius: 10px;
    line-height: 1.4;
    word-break: break-word;
}

.msg.user {
    margin-left: auto;
    background: var(--bg-general);
    color: var(--text);
}

.msg.ai {
    margin-right: auto;
    background: var(--bg-card);
    color: var(--text);
}

/* markdown preview above input */
#markdown-preview {
    border-top: 1px solid #151616;
    background: var(--bg-card);
    padding: .9rem;
    max-height: 220px;
    overflow: auto;
    font-size: 0.95rem;
    color: var(--text);
}

#markdown-preview h1,
#markdown-preview h2,
#markdown-preview h3 {
    color: var(--text);
    margin: .25rem 0;
}

#markdown-preview p {
    margin: .4rem 0;
    color: var(--text);
}

#markdown-preview a {
    color: var(--accent);
    text-decoration: underline;
}

#markdown-preview ul {
    padding-left: 1.1rem;
    margin: .3rem 0;
}

#markdown-preview pre {
    margin: .6rem 0;
    padding: .8rem;
    overflow: auto;
    border-radius: 8px;
    background: #0b0c0d;
}

#markdown-preview code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, "Roboto Mono", monospace;
    background: rgba(255, 255, 255, 0.02);
    padding: .12rem .24rem;
    border-radius: 6px;
}

#markdown-preview pre code {
    background: transparent;
    padding: 0;
}

/* input area */
#input-area {
    /* border-top:1px solid #151616; */
    padding: .6rem;
    background: var(--bg-general);
}

#IAResult #ia-empty-guide {
    display: none;
}

#input-row {
    display: flex;
    gap: .5rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

#userInputTxt {
    flex: 1;
    min-height: 68px;
    max-height: 220px;
    resize: none;
    padding: .6rem;
    color: var(--text);
    outline: none;
    font-size: 1rem;
    font-family: Arial, Helvetica;
    width: 100%;
    max-width: 860px;
    margin: 0 auto;
    display: block;
    line-height: 22px;
    border: none;
    background-color: transparent;
}

.advanced-resources .btn:disabled {
    opacity: 0.6;
    pointer-events: none;
}

#searchNormative.btn .icon-left {
    background-color: #800080b3;
}

#searchNormative.btn .icon-left .icon {
    background-color: #972494;
}

#searchNormative {
    background-color: #d476d4;
}

#searchNormative.btn .icon-left .icon img {
    filter: hue-rotate(-328deg);
}

#embase.btn .icon-left {
    background-color: #716a6a;
}

#embase img {
    filter: brightness(10.5);
}
#embase {
    background-color: #808080;
}
.light-theme #embase {
    background-color: #dcd5d5;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: 0.6rem .9rem;
    border-radius: 8px;
    border: 1px solid #2222221c;
    background: var(--bg-button);
    color: var(--text-button);
    cursor: pointer;
    font-size: 0.95rem;
    /* font-weight: 500; */
}

.btn:hover {
    /* background: var(--hover); */
    filter: brightness(.9);
}

#input-area .actions.default {
    justify-content: space-between;
    padding-top: 0;
    margin-bottom: 5px;
    align-items: center;
}

.send-options {
    margin-right: 5px;
}

.default .btn {
    background-color: var(--bg-sidebar);
    color: var(--text);
    padding: 0;
    border: none;
}

#disclaimer {
    margin-top: .45rem;
    text-align: center;
    color: var(--muted);
    font-size: .78rem;
}

#spinner {
    padding: .5rem 1rem;
    color: var(--muted);
    font-style: italic;
    display: none;
    margin: 2px 45px 5px 8px;
}

/* make chat use full width when sidebar collapsed */
#sidebar.collapsed+#main #IAResult {
    padding-left: 1rem;
}

/* responsive adjustments */
@media (max-width:800px) {
    #sidebar {
        position: absolute;
        z-index: 40;
        transform: translateX(0);
    }

    #sidebar.collapsed {
        transform: translateX(-200px);
    }
}

/**Change theme button **/
/* Container para alinhar */
.theme-switcher {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0px 20px;
}

.layout-mode {
    display: flex;
    align-items: center;
}

.layout-mode>label {
    font-size: 0.8em;
    font-weight: bold;
}

#sidebar.collapsed .layout-mode {
    display: none;
}

/* O container principal do switch */
.switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 24px;
}

/* Esconde o checkbox padrão do navegador */
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* O 'slider' (a parte móvel do switch) */
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cccccc3d;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
}

/* Estilo do switch quando está 'ligado' */
input:checked+.slider {
    background-color: #575757;
}

input:checked+.slider:before {
    transform: translateX(26px);
}

/* Estilo para arredondar o switch */
.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

.logged-menu {
    list-style: none;
    background-color: #272525;
    padding: 15px;
    border-radius: 10px;
    /* box-shadow: 0 0 2px 0px #ccc; */
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    transition: max-height .3s;
    position: absolute;
    top: -210px;
    max-width: min-content;
    min-width: 190px;
}
.logged-menu .emoji {
    margin-right: 5px;
}
.light-theme .logged-menu {
    background-color: #e2ebff;
}

.logged-menu.show {
    visibility: visible;
    max-height: 300px;
}

.logged-menu .item {
    margin-bottom: 10px;
    cursor: pointer;
    line-height: 20px;
    font-size: .9rem;
}

.logged-menu .item:hover .text {
    text-decoration: underline;
}

.logged-menu .item:last-child {
    margin-bottom: 0;
}

.header-menu {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-ini {
    background-color: orange;
    padding: 2px 7px 2px 6px;
    border-radius: 50%;
    font-size: .7rem;
    font-weight: bold;
}

.header-menu .user-info {
    gap: 0px;
}

.header-menu .user-info .title {
    color: var(--text);
}

.profile-anchor {
    font-size: 0.7rem;
    color: #ffffff75;
}

.light-theme .profile-anchor {
    color: #00000070;
}

.light-theme .logged-menu .Sair,
.light-theme .logged-menu .header {
    border-color: #ccd3e1;
}

.logged-menu .header {
    border-bottom: 1px solid #fffff73d;
    padding-bottom: 10px;
}

.logged-menu .Sair {
    padding-top: 10px;
    border-top: 1px solid #fffff73d;
}
/**** BUTTON COPY ******/
.copy-anwser {
    line-height: normal;
    display: flex;
    cursor: pointer;
    font-size: .7rem;
    justify-self: flex-end;
    border: 1px solid;
    padding: 6px;
    border-radius: 6px;
    border-color: var(--accent);
    color: var(--text);
    margin-bottom: 0px;
    opacity: 0;
    transition: opacity .2s;
}

.light-theme .copy-anwser {
    color: var(--text);
}

#IAResult:hover .copy-anwser {
    opacity: 1;
}

.copy-anwser:hover {
    background-color: var(--bg-button);
    filter: brightness(1.3);
}

.light-theme .copy-anwser:hover {
    color: var(--text-button);
}

.copy-anwser i {
    margin-right: 5px;
}
.markdown {
    display: none;
}

/**** BUTTON COPY ******/


/* CSS para o modal e formulários */
.modal {
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.modal-content {
    background-color: var(--bg-sidebar);
    color: var(--text);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    width: 90%;
    max-width: 450px;
    text-align: center;
    position: relative;
}

.modal-header h2 {
    margin: 0 0 20px;
    font-size: 24px;
    font-weight: 600;
    color: var(--text);
}

.form-wrapper {
    display: none;
}

.form-wrapper.active {
    display: block;
}

#reg_user_email {
    margin-bottom: 10px;
}

.login-form input,
.register-form input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #4a4a4a;
    border-radius: 8px;
    background-color: #3b3b3b;
    color: var(--text);
    font-size: 16px;
    box-sizing: border-box;
}

.login-form input::placeholder,
.register-form input::placeholder {
    color: #888;
}

#login-modal.hidden {
    display: none;
}

.login-form label,
.register-form label {
    display: block;
    text-align: left;
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 5px;
}

.button-primary {
    background-color: #0056b3;
    color: #fff;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    width: 100%;
    transition: filter 0.3s ease;
}

.button-primary:hover {
    filter: brightness(1.3);
}
.recovery-screen,
.switch-link {
    color: #aaa;
}
.switch-link {
    margin-top: 20px;
    font-size: 14px;
}

.recovery-screen a,
.switch-link a {
    color: #007bff;
    text-decoration: none;
    font-weight: 600;
}

.recovery-screen {
    font-size: .8rem;
}

.form-wrapper input[type='text'],
.form-wrapper input[type='email'],
.form-wrapper input[type='password'] {
    padding: 6px;
    width: 250px;
    border: 1px solid var(--muted);
    border-radius: 5px;
}
#recovery-form .disclaimer {
    margin: 15px 0;
}
.button-primary:disabled {
    opacity: .4;
}

.form-wrapper > h2 {
    font-size: 25px;
    margin-bottom: 20px;
}

#register-form-wrapper > .description {
    font-size: .9rem;
}

.disclaimer.description {
    font-size: .9rem;
    margin-top: 10px;
    margin-bottom: 30px;
}

.logged-menu a {
    text-decoration: none;
    color: var(--text);
}

.collapsed #chat-list {
    display: none;
}

.description {
    font-size: 0.8rem;
    margin-bottom: 40px;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 35px;
    background: transparent;
    border: none;
    color: var(--text);
    cursor: pointer;
    font-weight: bold;
    line-height: 1;
}

.modal-close:hover {
    color: var(--accent);
}

.emoji,*[data-emoji] {
  font-family: system-ui, -apple-system, sans-serif !important;
  font-size: 1.1em !important;
  line-height: 1 !important;
  height: 1.1em !important;
  width: 1.1em !important;
  display: inline-block !important;
  vertical-align: middle !important;
  text-align: center !important;
}
.mensagem-pergunta .pergunta-texto {
    background-color: var(--ask);
    padding: 15px;
    border-radius: 10px;
    max-width: 75%;
    line-height: 22px;
}

.mensagem-pergunta {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
    animation: 0.3s ease 0s 1 normal none running slideDown;
}

.resposta-message {
    line-height: 25px;
    background-color: var(--response);
    padding: 15px;
    border-radius: 10px;
}

.titulo-pergunta {
    justify-content: flex-end;
}

.titulo-resposta,
.titulo-pergunta {
    font-style: italic;
    color: rgb(0, 109, 104);
    font-size: 16px;
    font-weight: bold;
    display: flex;
}
.result-message h1,
.result-message h2,
.result-message h3,
.result-message h4 {
    font-weight: bold;
    margin-top: 20px;
}


.result-message h1 {
    margin-bottom: 20px;
    font-size: 1.6rem;
}
.result-message h2 {
    font-size: 1.4rem;
    margin-bottom: 20px;
}
.result-message h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.result-message h4 {
    font-size: 1rem;
    margin-bottom: 10px;
}

.resposta-message li,
.resposta-message p {
    margin-bottom: 10px;
}

.resposta-message li,
.resposta-message p {
    line-height: 26px;
}

#floatingUploadButton {
    position: relative;
    padding: 8px 11px 7px 8px;
    margin-left: 10px;
}

#floatingUploadButton.show {
    margin-left: 0;
    z-index: 1;
}

.collapsed .platform-description,
.collapsed .side-footer small {
    display: none !important;
}

.fa.fa-paperclip {
    font-size: 1.2rem;
}
.screen-reader-response > ul {
    display: none;
}
.file-number {
    position: absolute;
    top: -4px;
    right: -4px;
    background-color: #ff4040;
    color: #fff;
    border-radius: 50%;
    font-size: 11px;
    padding: 2px 5px;
    min-width: 16px;
    text-align: center;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.file-number.hidden {
    opacity: 0;
    transform: scale(0.6);
}

/* === DATASET INTERATIVO === */
.dataset-section {
    background: var(--bg-general);
    border-left: 5px solid #007bff;
    padding: 8px 14px;
    margin: 20px 0;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    transition: background 0.3s ease;
}

.dataset-header {
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 6px;
    user-select: none;
}

.dataset-header:hover {
    background-color: #eef6ff;
}

.dataset-arrow {
    font-size: 14px;
    color: #007bff;
    transition: transform 0.2s ease;
}

.dataset-title {
    font-size: 15px;
    color: #004488;
    font-weight: bold;
    margin: 6px 0;
}

.dataset-content {
    transition: max-height 0.3s ease, opacity 0.3s ease;
    /* inicia expandido */
    opacity: 1;
    padding-left: 10px;
}

.dataset-section.collapsed .dataset-content {
    max-height: 0;
    opacity: 0;
}

.chat-options {
    position: absolute;
    border: 1px solid #ccc;
    border-radius: 6px;
    background-color: var(--bg-sidebar);
    z-index: 999999999592;
    margin-top: -27px;
    margin-left: 30px;
    padding: 10px 20px;
    font-size: .85rem;
}

.chat-options .options {
    list-style: none;
    margin: 0;
    padding: 0;
}

.chat-options .options .option {
    margin-bottom: 10px;
}

.chat-options .options .option:last-child {
    margin-bottom: 0;
}

.chat-options .options .option:hover {
    text-decoration: underline;
}

#new-chat-btn:hover {
    color: var(--text-button);
    filter: brightness(1.5);
}

header .actions .action.links {
    color: var(--text-button);
}

/* ====== Wrapper e textarea ====== */
.input-wrapper {
    position: relative;
    width: 100%;
    margin: 0 auto;
    max-width: 870px;
    background-color: var(--bg-card);
    color: var(--bg-card);
    border: 1px solid #2222224a;
    border-radius: 10px;
}

#askAnaliticys {
    margin-right: 5px;
    padding: 0.6rem .6rem;
}
/* ====== Ícone dentro da área ====== */
#toneBtn {
    background: none;
    border: none;
    color: var(--text);
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    z-index: 2;
    margin-left: 10px;
}

#toneBtn:hover {
    filter: brightness(1.5);
}

/* ====== Menu de tons ====== */
.tone-menu {
    position: absolute;
    bottom: 40px;
    left: 8px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 6px 0;
    list-style: none;
    margin: 0;
    min-width: 200px;
    z-index: 999;
}

.tone-menu li {
    padding: 8px 14px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
}

.tone-menu li:hover {
    background-color: #f4f4f4;
}

.hidden {
    display: none !important;
}

/* ====== Tag de tom ====== */
#toneTagContainer {
    margin-top: 6px;
    padding-left: 4px;
    bottom: -28px;
    margin-left: 40px;
    right: 0;
    position: absolute;
}

.tone-tag {
    display: inline-flex;
    align-items: center;
    background-color: #eef2ff;
    color: #334155;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 13px;
    gap: 6px;
    animation: fadeIn 0.2s ease-in;
}

.tone-tag i {
    cursor: pointer;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

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


/* CSS inspirado no GPT */
#ia-empty-guide {
    text-align: center;
    padding: 40px 20px;
    font-family: 'Inter', sans-serif;
    color: #202123;
}

#ia-empty-guide h2 {
    margin-bottom: 10px;
}

#ia-empty-guide p {
    font-size: 1rem;
    margin-bottom: 30px;
}

.guide-cards {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    margin-top: 30px;
}

 section.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 800px) {
    section.grid {
    grid-template-columns: 1fr;
    }
}

.non-logged-info {
    line-height: 22px;
    margin-top: 15px;
    padding-left: 2px;
}

body:not(.logged-in) .collapsed .non-logged-info {
    display: none;
}

body:not(.logged-in) .non-logged-info {
    display: block;
}

.non-logged-info {
    display: none;
}

h2#\31 referencias {
    color: var(--text-button);
    background-color: var(--bg-card);
    padding: 20px;
    text-align: center;
    text-transform: uppercase;
    border-top: 5px solid var(--bg-card);
}

.card {
    background: var(--bg-general);
    border: 1px solid var(--slate-200);
    border-radius: 1rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    padding: 1.5rem;
    animation: fadeUp 0.6s ease;
    color: var(--text);
}

.card h2 {
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 1rem 0;
}

.card ul {
    padding-left: 1rem;
    margin: 0;
    text-align: left;
}

.card ul li {
    margin-bottom: 0.6rem;
    color: var(--slate-700);
    line-height: 1.5;
}

.guide-cards li {
    margin-bottom: 20px;
}

.guide-cards li:last-child {
    margin-bottom: 0;
}

header {
    color: var(--text);
    position: relative;
    padding: 2rem 1.5rem 2rem;
    text-align: left;
    overflow: hidden;
    display: inline-table;
    width: 100%;
}

#ia-empty-guide .actions .action {
    padding: 11px;
}

body:not(.logged-in) #chat-list {
    visibility: hidden;
}

header .actions .action {
    padding: 10px;
    font-weight: bold;
    border-radius: 6px;
    border: 1px solid;
    border-color: var(--bg-button);
    color: var(--text-button);
    transition: background-color .2s, color .2s;
    cursor: pointer;
}
header .actions .action.links {
    background-color: transparent;
    color: var(--text-button);
    text-decoration: none;
}
header .actions .action.links:hover {
    background-color: var(--bg-button);
}
.light-theme .actions .action.links {
    color: var(--bg-button);
}
.light-theme .actions .action.links:hover {
    color: var(--text-button);
    background-color: var(--bg-button);
}
.page-content .page {
    display: none;
    padding: 10px;
    margin-top: 20px;
    text-align: left;
}

#new-chat-btn,
header .actions .start-now {
    background-color: var(--bg-button);
}

header .actions .show-examples {
    background-color: var(--bg-general);
    color: var(--text-button);
}
.light-theme header .actions .show-examples {
    color: var(--bg-button);
}

.light-theme header .actions .action:hover {
    color: var(--text-button);
    background-color: var(--bg-card);
}
.light-theme header .actions .show-examples:hover {
    background-color: var(--bg-button);
}
#new-chat-btn:hover,
header .actions .start-now:hover {
    background-color: var(--bg-general);
    color: var(--text-button);
}

.light-theme #new-chat-btn:hover,
.light-theme header .actions .start-now:hover {
    color: var(--bg-button);
}

header .actions {
    gap: 10px;
    display: flex;
    position: relative;
    z-index: 3;
}

header h1 {
    font-size: 2.4rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

header h1 span {
    color: var(--indigo);
}

header p {
    max-width: 650px;
    color: var(--slate-700);
    font-size: 1.1rem;
    line-height: 1.6;
}

.circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    z-index: 0;
}

.circle.indigo {
    background: #72a39a;
    top: -60px;
    right: 0;
    width: 280px;
    height: 280px;
}

.circle.cyan {
    background: #a5f3fc;
    bottom: -60px;
    left: 0;
    width: 490px;
    height: 280px;
}

.removing-overlay {
    background-color: var(--bg-card);
    height: 100%;
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.history-item .removing-overlay i {
    font-size: 35px;
    text-align: center;
    width: 35px;
    animation: removing 1.5s infinite;
}
#login-form-wrapper > h2 {
    font-size: 25px;
    margin-bottom: 30px;
}
#login-form-wrapper p {
    margin-top: 15px;
}
.advanced-resources {
    width: 100%;
}
.advanced-resources .btn {
    background-color: var(--bg-general);
    margin-bottom: 5px;
    color: var(--text);
    padding: 0;
    border-radius: 10px;
    overflow: hidden;
    width: 22%;
    max-width: 210px;
    height: 80px;
}

.advanced-resources .btn:hover {
    border-color: var(--bg-button);
    filter: none;
}

#contestFlow {
    background-color: #ef9d9d;
    border-color: #ef9d9d;
}

#contestFlow .icon-left {
    background-color: #e36363;
}

#contestFlow img {
    filter: hue-rotate(275deg);
}

#commercialProposal {
    background-color: #e2f4f7;
    border: 1px solid #97d3e2;
}
.advanced-resources .btn .icon-left {
    background-color: #97d3e2;
    padding: 1.9em 0rem;
    position: relative;
}
#initialPetition .icon-left {
    background-color: #b8d9aa;
}
#initialPetition {
    background-color: #eaf5e6;
}
#contractReview .icon-left {
    background-color: #f7bb90;
}
#contractReview {
    background-color:#fcede0;
}
#searchJurisPrudence {
    background-color:#edeaf8;
}

#searchJurisPrudence .icon-left {
    background-color: #b6a5e2;
}

.advanced-resources .btn .icon {
    background-color: inherit;
    border-radius: 50%;
    position: relative;
    right: -8px;
    z-index: 2;
    display: block;
    padding: .35rem .55rem .0rem 0;
}

.advanced-resources img {
    max-width: 35px;
    max-height: 35px;
}
.advanced-resources .btn .text {
    margin-left: 10px;
    text-align: left;
    font-weight: bold;
    color: #353535;
}
#input-area .advanced-resources {
    display: none;
}

.empty-chat #input-area .advanced-resources {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  min-height: calc(50vh - 160px);
  text-align: center;
}
.page-content .page h1,
.page-content .page h2,
.page-content .page h3,
.page-content .page h4 {
    font-weight: bold;
}

.page-content iframe {
    max-width: 100%;
}

.page-content img {
    max-width: 100%;
    height: auto;
}

.page-content .page h1 {
    font-size: 2rem;
    margin-bottom: 20px;
}

.page-content .page h2 {
    font-size: 1.6rem;
    margin-bottom: 15px;
}

.page-content .page h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.page-content .page h4 {
    font-size: 1rem;
    margin-bottom: 10px;
}

.page-content .page li {
    margin-bottom: 10px;
}

.page-content .page {
    font-size: 1rem;
    line-height: 1.2rem;
}

.init.wpcf7-form ::placeholder,
#ia-empty-guide .page-content .page p {
    color: var(--text);
}

#ia-empty-guide .page-content .page p {
    margin-bottom: 20px;
    line-height: 22px;
}

#ia-empty-guide .page-content .page a {
    color: var(--accent);
    text-decoration: none;
}

#ia-empty-guide .page-content .page a:hover {
    text-decoration: underline;
}

.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 textarea {
    width: 100%;
    border: 1px solid var(--accent);
    padding: 10px;
    border-radius: 6px;
}

.page-content .page.contato {
    max-width: 760px;
}

.wpcf7-submit {
    background-color: var(--bg-button);
    color: var(--text-button);
    padding: 10px 30px;
    border-radius: 6px;
    text-transform: uppercase;
    transition: background-color .2s;
    font-weight: bold;
    border: 1px solid var(--muted);
    cursor: pointer;
}

.wpcf7-submit:hover {
    background-color: var(--text-button);
    color: var(--bg-button);
}

.page .wpcf7 .wpcf7-not-valid {
    border-color: red;
}

.light-theme .modal-box {
    /* color: var(--text); */
    background-color: var(--bg-card);
}

.light-theme .modal-box strong {
    color: var(--text);
}

.light-theme #formPdfUpload li, .light-theme #formPdfUpload i {
    color: var(--text);
}

.light-theme #pdf-server-results {
    color: var(--text);
}

@keyframes removing {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}
.card.samples b {
    font-weight: bold;
}


/* ============================================================
   📱 RESPONSIVE MEDIA QUERIES - Adaptação para telas menores
   ============================================================ */

/* Telas até 1200px - ajustes leves */
@media (max-width: 1200px) {
    #sidebar {
        width: 220px;
    }

    .msg {
        max-width: 80%;
    }
}

/* Telas até 992px - notebooks pequenos e tablets landscape */
@media (max-width: 992px) {
    #ai-site {
        flex-direction: column;
    }

    #sidebar {
        position: relative;
        width: 100%;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        height: auto;
        border-right: none;
        border-bottom: 1px solid #2b2d2f33;
    }

    #sidebar.collapsed {
        width: 100%;
        transform: none;
    }
    #main {
        height: auto;
    }

    #input-row {
        flex-wrap: wrap;
        align-items: center;
    }

    #userInputTxt {
        min-width: 90%;
    }

    #sidebar {
        position: fixed;
        left: 0;
        top: 0;
        width: 0;
        max-width: 350px;
        bottom: 16px;
        background: var(--bg-sidebar);
        z-index: 9999;
        box-shadow: 2px 0 10px #0002;
        transition: width .3s;
        transform: translateX(-100%);
        overflow-x: hidden;
        overflow-y: auto;
    }
    #sidebar.open {
        display: flex;
        transform: translateX(0);
        width: 80vw;
        flex-wrap: wrap;
        height: 100%;
    }
    .mobile-only {
        display: flex;
        position: static;
        font-size: 1.1rem;
        border: none;
        background: none;
        font-weight: bold;
        padding: .6rem 1rem;
        color: var(--text);
        align-items: center;
        min-height: 64px;
    }
    .mobile-only .fa-bars {
        font-size: 2rem;
    }

    .mobile-only > a {
        margin-left: 20px;
        color: var(--text);
        display: inherit;
        align-items: center;
        text-decoration: none;
    }

    .mobile-only > a > img {
        max-height: 50px;
        margin-right: 10px;
    }

    .mobile-only span {
        text-decoration: none;
    }
    .side-footer,
    #history,
    .side-top {
        width: 100%;
    }
    #collapse-btn {
        display: none;
    }
    #chat-list {
        max-height: 450px;
    }
    #history {
        flex: initial;
        height: calc(100% - 165px);
    }
    .logged-in #history {
        height: calc(100% - 200px);
    }
    #IAResult {
        min-height: 200px;
    }
}
@media (min-width: 993px) {
    .mobile-only {
        display: none;
    }
}

/* Telas até 768px - tablets verticais e celulares grandes */
@media (max-width: 768px) {
    #ai-site {
        flex-direction: column;
    }

    .side-footer {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: .6rem 1rem;
    }

    #main {
        width: 100%;
        height: auto;
    }

    #IAResult {
        padding: .8rem;
    }

    #userInputTxt {
        min-height: 80px;
        max-height: 160px;
        font-size: .95rem;
    }

    .btn {
        width: 48%;
        justify-content: center;
    }

    .theme-switcher {
        margin: 10px auto;
    }

    #input-area .actions {
        /* max-width: 90%;
        margin: 0 auto;
        padding-top: 45px; */
    }
    #askAnaliticys,
    #floatingUploadButton {
        width: auto;
    }
    #floatingUploadButton {
        display: inline;
    }

    .collapsed .platform-description,
    .collapsed .side-footer small {
        display: block !important;
    }
    .empty-chat #input-area .advanced-resources .btn {
        width: 46%;
        max-width: 46%;
        justify-content: flex-start;
        display: flex;
    }
    #IAResult {
        min-height: 130px;
    }
    .advanced-resources .btn {
        width: 48%;
        margin-bottom: 5px;
        justify-content: flex-start;
    }
}

/* Telas até 576px - celulares comuns */
@media (max-width: 576px) {
    body {
        flex-direction: column;
        overflow-y: auto;
    }

    #sidebar {
        flex-direction: column;
        align-items: flex-start;
    }

    .side-top {
        width: 100%;
        justify-content: space-between;
    }

    #collapse-btn {
        width: 40px;
        height: 40px;
    }

    #main {
        height: auto;
    }

    #IAResult {
        padding: 0rem;
    }

    #IAResult #ia-empty-guide {
        padding: 0 !important;
    }

    .card ul {
        padding-left: 1.5rem;
    }

    #IAResult .card {
        padding: 1rem;
    }

    .msg {
        max-width: 90%;
        padding: .7rem .8rem;
        font-size: .95rem;
    }

    #input-row {
        flex-direction: column;
        gap: .4rem;
    }

    #userInputTxt {
        width: 100%;
        max-width: 100%;
    }

    .btn {
        font-size: .9rem;
        padding: .5rem .2rem;
        display: block;
    }
    #floatingUploadButton {
        max-width: 70px;
    }
    .btn .icon {
        display: flow;
    }

    .modal-content {
        width: 95%;
        padding: 25px;
    }

    .modal-header h2 {
        font-size: 20px;
    }

    .button-primary {
        padding: 10px 14px;
        font-size: 15px;
    }

    .switch {
        width: 50px;
        height: 28px;
    }

    .slider:before {
        height: 22px;
        width: 22px;
    }
    .logged-menu {
        position: absolute;
        top: -130px;
    }
    .side-footer {
        position: relative;
    }
    .mensagem-pergunta, .resposta-message {
        margin: 0 30px;
    }
    header .actions {
        flex-wrap: wrap;
    }
    .advanced-resources .btn {
        width: 48%;
        margin-bottom: 5px;
        justify-content: flex-start;
        display: inline-flex;
    }
}

/* Telas até 400px - celulares muito pequenos */
@media (max-width: 400px) {
    .logo span {
        font-size: 0.85rem;
    }

    .msg {
        font-size: 0.9rem;
        padding: .6rem .7rem;
    }

    .modal-box {
        width: 100%;
        padding: 16px;
    }

    label[for=multifilesPdf] {
        font-size: 14px;
        padding: 8px 10px;
    }

    .confirm-upload-btn {
        width: 100%;
        text-align: center;
    }
    .advanced-resources .btn .text {
        font-size: 13px;
    }
}
