/* AUTODIDATAS CONTAS — ESTILO PRINCIPAL */

:root {
    color-scheme: light;
    --primary: #18794e;
    --primary-dark: #12613e;
    --primary-light: #e6f6ec;
    --navy: #172d43;
    --text: #263648;
    --muted: #718096;
    --background: #f5f8f6;
    --surface: #ffffff;
    --border: #e2eae5;
    --danger: #c63f4d;
    --danger-light: #fff0f1;
    --success: #18794e;
    --radius: 18px;
    --shadow: 0 5px 22px rgba(24, 45, 35, 0.055);
    --content-width: 1120px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 90px;
}

body {
    margin: 0;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI",
        Roboto, Arial, sans-serif;
    color: var(--text);
    background: var(--background);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
    outline: 3px solid rgba(24, 121, 78, 0.28);
    outline-offset: 3px;
}

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

a:hover {
    color: var(--primary-dark);
}

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

/* CABEÇALHO */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    background: rgba(255, 255, 255, 0.97);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
}

.site-header-inner,
.header-inner,
.header-container {
    width: min(calc(100% - 36px), var(--content-width));
    min-height: 76px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand,
.site-brand,
.logo-link {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: var(--navy);
    font-weight: 800;
    font-size: 19px;
    letter-spacing: -0.5px;
    text-decoration: none;
}

.brand img,
.site-brand img,
.logo-link img,
.site-logo {
    display: block;
    max-width: 180px;
    max-height: 48px;
    object-fit: contain;
}

.brand-mark,
.logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    color: #fff;
    background: var(--primary);
    border-radius: 13px;
    font-size: 18px;
    font-weight: 800;
}

.site-nav,
.main-nav,
.header-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.site-nav a,
.main-nav a,
.header-nav a {
    display: inline-flex;
    align-items: center;
    padding: 10px 13px;
    border-radius: 10px;
    color: #536476;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s ease, color 0.2s ease;
}

.site-nav a:hover,
.main-nav a:hover,
.header-nav a:hover {
    color: var(--primary);
    background: var(--primary-light);
}

.menu-toggle,
.mobile-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    color: var(--navy);
    font-size: 23px;
}

/* MENUS SUSPENSOS */

.dropdown,
.nav-dropdown,
.menu-dropdown {
    position: relative;
}

.dropdown-menu,
.nav-dropdown-menu,
.menu-dropdown-content {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 120;
    min-width: 220px;
    padding: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
}

.dropdown-menu a,
.nav-dropdown-menu a,
.menu-dropdown-content a {
    display: block;
    padding: 11px 12px;
    border-radius: 9px;
}

/* ESTRUTURA PRINCIPAL */

.site-main {
    width: min(calc(100% - 36px), var(--content-width));
    min-height: 65vh;
    margin: 0 auto;
    padding: 36px 0 54px;
}

.dashboard,
.content-section {
    margin-bottom: 30px;
}

.section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

.eyebrow {
    margin: 0 0 7px;
    color: var(--primary);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.35px;
}

h1,
h2,
h3,
p {
    overflow-wrap: anywhere;
}

h1,
h2,
h3 {
    color: var(--navy);
    line-height: 1.25;
}

h1 {
    margin: 0 0 12px;
    font-size: clamp(28px, 4vw, 39px);
    font-weight: 800;
    letter-spacing: -1.1px;
}

h2 {
    margin: 0 0 8px;
    font-size: clamp(21px, 3vw, 27px);
    font-weight: 750;
    letter-spacing: -0.55px;
}

h3 {
    margin: 0 0 8px;
    font-size: 17px;
    font-weight: 750;
}

.section-heading p:not(.eyebrow) {
    max-width: 650px;
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

/* RESUMO FINANCEIRO */

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-top: 28px;
}

.summary-card {
    min-width: 0;
    padding: 23px 21px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.summary-label {
    display: block;
    margin-bottom: 12px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.summary-card strong {
    display: block;
    color: var(--navy);
    font-size: clamp(21px, 2.3vw, 28px);
    font-weight: 800;
    letter-spacing: -0.7px;
    overflow-wrap: anywhere;
}

.summary-description {
    display: block;
    margin-top: 10px;
    color: var(--muted);
    font-size: 12px;
}

#total-receitas {
    color: var(--success);
}

#total-despesas {
    color: var(--danger);
}

#saldo-total.negative-balance,
.negative-balance {
    color: var(--danger);
}

.progress-track {
    width: 100%;
    height: 8px;
    margin-top: 15px;
    overflow: hidden;
    background: #e9efeb;
    border-radius: 999px;
}

.progress-fill {
    width: 0;
    height: 100%;
    background: var(--primary);
    border-radius: inherit;
    transition: width 0.3s ease;
}

/* RECEITAS E DESPESAS */

.content-section {
    padding: 27px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.section-count {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    padding: 7px 11px;
    color: var(--primary-dark);
    background: var(--primary-light);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

/* FORMULÁRIOS */

.entry-form {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(150px, 0.8fr) auto;
    align-items: end;
    gap: 14px;
    padding: 19px;
    background: #f8fbf9;
    border: 1px solid var(--border);
    border-radius: 14px;
}

.form-field {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 7px;
}

.form-field label,
.backup-import label {
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
}

.form-field input,
.backup-import input,
.entry-form input {
    width: 100%;
    min-width: 0;
    min-height: 47px;
    padding: 11px 13px;
    color: var(--text);
    background: #fff;
    border: 1px solid #dce6df;
    border-radius: 10px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-field input::placeholder {
    color: #a0aca5;
}

.form-field input:focus,
.backup-import input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(24, 121, 78, 0.09);
}

/* BOTÕES */

.btn,
button.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 11px 17px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 750;
    text-align: center;
    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}

.btn-primary,
button.btn-primary {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover,
button.btn-primary:hover {
    color: #fff;
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn:active {
    transform: translateY(1px);
}

.btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* MENSAGENS E LISTAS */

.form-feedback {
    grid-column: 1 / -1;
    min-height: 0;
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.form-feedback:empty {
    display: none;
}

.entries-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 19px;
}

.entries-list:empty {
    display: none;
}

.entries-list > * {
    min-width: 0;
}

.entry-item,
.entry-row,
.launchamento,
.lancamento-item,
.record-item,
.finance-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 15px 16px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
}

.entry-info,
.entry-details,
.record-info,
.lancamento-info {
    min-width: 0;
    flex: 1;
}

.entry-item h3,
.entry-row h3,
.record-item h3 {
    margin-bottom: 3px;
    font-size: 14px;
}

.entry-value,
.record-value,
.lancamento-valor {
    color: var(--navy);
    font-weight: 800;
    white-space: nowrap;
}

.entry-date,
.record-date,
.lancamento-data {
    color: var(--muted);
    font-size: 11px;
}

.btn-delete,
.delete-button,
.btn-excluir,
button[aria-label*="Excluir"],
button[aria-label*="excluir"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    color: var(--danger);
    background: var(--danger-light);
    border: 1px solid #f7dadd;
    border-radius: 10px;
}

.btn-delete:hover,
.delete-button:hover,
.btn-excluir:hover {
    background: #ffe1e4;
}

/* TUTORIAL EM VÍDEO */

.tutorial-section {
    overflow: hidden;
}

.tutorial-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    padding: 35px 24px;
    text-align: center;
    background:
        radial-gradient(ellipse at top, #effaf2 0%, transparent 72%),
        #f8fbf9;
    border: 1px dashed #b9d8c3;
    border-radius: 16px;
}

.tutorial-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    margin-bottom: 20px;
    color: #fff;
    background: var(--primary);
    border-radius: 22px;
    box-shadow: 0 8px 20px rgba(24, 121, 78, 0.18);
}

.tutorial-icon span {
    padding-left: 4px;
    font-size: 27px;
}

.tutorial-placeholder h3 {
    margin-bottom: 10px;
    font-size: 20px;
}

.tutorial-placeholder p {
    max-width: 550px;
    margin: 0 auto;
    color: var(--muted);
    font-size: 14px;
}

.tutorial-placeholder .tutorial-note {
    margin-top: 13px;
    font-size: 12px;
}

.tutorial-video,
.video-container,
.video-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: #eaf1ec;
    border-radius: 15px;
}

.tutorial-video iframe,
.video-container iframe,
.video-wrapper iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}/* BACKUP */

.backup-section {
    background: linear-gradient(135deg, #fff 0%, #f8fbf9 100%);
}

.backup-actions {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 18px;
}

.backup-import {
    flex: 1;
    min-width: min(100%, 250px);
}

.backup-import input {
    padding: 8px;
    font-size: 12px;
}

/* PRIVACIDADE */

.privacy-section {
    padding: 0;
    overflow: hidden;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.privacy-card {
    padding: clamp(22px, 4vw, 34px);
    background: #fff;
    border: 1px solid #dcebe0;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.privacy-heading {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 22px;
}

.privacy-heading h2 {
    margin-bottom: 0;
}

.privacy-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    flex-shrink: 0;
    color: var(--primary-dark);
    background: var(--primary-light);
    border-radius: 16px;
    font-size: 25px;
}

.privacy-card > p {
    margin: 0 0 20px;
    color: #536476;
    font-size: 14px;
    line-height: 1.85;
}

.privacy-card strong {
    color: var(--navy);
}

.privacy-example {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-top: 14px;
    padding: 19px;
    background: #f7faf8;
    border: 1px solid var(--border);
    border-radius: 13px;
}

.privacy-example-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 43px;
    height: 43px;
    flex-shrink: 0;
    background: #e6f6ec;
    border-radius: 12px;
    font-size: 20px;
}

.privacy-example h3 {
    margin: 1px 0 7px;
    font-size: 15px;
}

.privacy-example p {
    margin: 0;
    color: #617164;
    font-size: 13px;
    line-height: 1.8;
}

.privacy-card .privacy-warning {
    margin: 20px 0 0;
    padding: 15px 17px;
    color: #705b31;
    background: #fff8e8;
    border: 1px solid #f0e2bd;
    border-radius: 11px;
    font-size: 12px;
    line-height: 1.8;
}

/* RODAPÉ */

.site-footer {
    padding: 27px 18px;
    background: #fff;
    border-top: 1px solid var(--border);
}

.footer-inner,
.site-footer-inner,
.footer-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    width: min(100%, var(--content-width));
    margin: 0 auto;
}

.site-footer p,
.footer-inner p,
.site-footer-inner p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.site-footer a {
    font-size: 12px;
}

/* ACESSIBILIDADE */

[hidden] {
    display: none !important;
}

button,
input {
    -webkit-tap-highlight-color: transparent;
}

::selection {
    color: var(--navy);
    background: #d8f2e1;
}

/* TABLETS */

@media (max-width: 900px) {
    .summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .entry-form {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .entry-form > button {
        grid-column: 1 / -1;
        width: 100%;
    }

    .form-feedback {
        grid-column: 1 / -1;
    }

    .site-main {
        padding-top: 28px;
    }
}

/* CELULARES */

@media (max-width: 600px) {
    html {
        scroll-padding-top: 75px;
    }

    body {
        font-size: 14px;
    }

    .site-header-inner,
    .header-inner,
    .header-container {
        width: calc(100% - 28px);
        min-height: 66px;
        gap: 12px;
    }

    .brand,
    .site-brand,
    .logo-link {
        font-size: 17px;
    }

    .brand-mark,
    .logo-mark {
        width: 38px;
        height: 38px;
        border-radius: 11px;
    }

    .brand img,
    .site-brand img,
    .logo-link img,
    .site-logo {
        max-width: 145px;
        max-height: 40px;
    }

    .menu-toggle,
    .mobile-menu-toggle {
        display: inline-flex;
    }

    .site-nav,
    .main-nav,
    .header-nav {
        gap: 3px;
    }

    .site-nav a,
    .main-nav a,
    .header-nav a {
        padding: 8px;
        font-size: 12px;
    }

    .site-main {
        width: calc(100% - 26px);
        padding: 25px 0 35px;
    }

    .dashboard,
    .content-section {
        margin-bottom: 20px;
    }

    .section-heading {
        flex-direction: column;
        gap: 12px;
        margin-bottom: 17px;
    }

    h1 {
        font-size: 29px;
    }

    h2 {
        font-size: 22px;
    }

    .summary-grid {
        gap: 10px;
        margin-top: 21px;
    }

    .summary-card {
        padding: 17px 14px;
        border-radius: 14px;
    }

    .summary-label {
        margin-bottom: 9px;
        font-size: 11px;
    }

    .summary-card strong {
        font-size: clamp(18px, 5vw, 23px);
        letter-spacing: -0.5px;
    }

    .summary-description {
        margin-top: 8px;
        font-size: 11px;
    }

    .content-section {
        padding: 19px 15px;
        border-radius: 15px;
    }

    .section-count {
        align-self: flex-start;
    }

    .entry-form {
        grid-template-columns: minmax(0, 1fr);
        gap: 13px;
        padding: 14px;
    }

    .entry-form > button {
        grid-column: auto;
        width: 100%;
    }

    .form-feedback {
        grid-column: auto;
    }

    .entry-item,
    .entry-row,
    .launchamento,
    .lancamento-item,
    .record-item,
    .finance-item {
        gap: 10px;
        padding: 12px;
    }

    .entry-value,
    .record-value,
    .lancamento-valor {
        font-size: 13px;
    }

    .backup-actions {
        align-items: stretch;
        flex-direction: column;
        gap: 14px;
    }

    .backup-actions > button {
        width: 100%;
    }

    .backup-import {
        min-width: 0;
        width: 100%;
    }

    .privacy-card {
        padding: 20px 15px;
    }

    .privacy-heading {
        align-items: flex-start;
        gap: 12px;
    }

    .privacy-icon {
        width: 44px;
        height: 44px;
        border-radius: 13px;
        font-size: 21px;
    }

    .privacy-heading h2 {
        font-size: 21px;
    }

    .privacy-example {
        gap: 11px;
        padding: 14px 12px;
    }

    .privacy-example-icon {
        width: 36px;
        height: 36px;
        font-size: 17px;
    }

    .privacy-example h3 {
        font-size: 14px;
    }

    .tutorial-placeholder {
        min-height: 245px;
        padding: 26px 16px;
    }

    .tutorial-icon {
        width: 59px;
        height: 59px;
        border-radius: 18px;
    }

    .footer-inner,
    .site-footer-inner,
    .footer-container {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .site-footer {
        padding: 23px 14px;
    }
}

/* CELULARES MUITO ESTREITOS */

@media (max-width: 360px) {
    .summary-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .summary-card {
        padding: 16px;
    }

    .section-heading p:not(.eyebrow) {
        font-size: 13px;
    }
}

/* REDUÇÃO DE ANIMAÇÕES */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}
