﻿:root {
    --c1: #ffe3b3;
    --c2: #c5dd63;
    --c3: #79ce67;
    --c4: #30b155;
    --bg: #ffe3b3;
    --surface: #ffffff;
    --surface2: #fff4dc;
    --text: #1d3320;
    --muted: #5f7062;
    --line: #f0d9a8;
    --income: #1f8e40;
    --expense: #d9583b;
    box-sizing: border-box;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #121c13;
        --surface: #1b2a1d;
        --surface2: #223526;
        --text: #eaf5e4;
        --muted: #9db3a0;
        --line: #2c4230;
        --income: #79ce67;
        --expense: #f08a70;
    }
}
:root[data-theme="dark"] {
    --bg: #121c13;
    --surface: #1b2a1d;
    --surface2: #223526;
    --text: #eaf5e4;
    --muted: #9db3a0;
    --line: #2c4230;
    --income: #79ce67;
    --expense: #f08a70;
}
* {
    box-sizing: border-box;
    margin: 0;
    -webkit-tap-highlight-color: transparent;
}
html,
body {
    background: var(--bg);
    color: var(--text);
    font-family:
        "Plus Jakarta Sans",
        system-ui,
        -apple-system,
        "Segoe UI",
        Roboto,
        sans-serif;
    min-height: 100%;
}
button,
input {
    font: inherit;
    color: inherit;
}
button {
    cursor: pointer;
    border: 0;
    background: none;
}
:focus-visible {
    outline: 3px solid var(--c4);
    outline-offset: 2px;
}
.hide {
    display: none !important;
}

/* Login */
.auth {
    max-width: 430px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.hero {
    background: linear-gradient(150deg, var(--c4), var(--c3));
    color: #fff;
    padding: 56px 28px 74px;
    border-radius: 0 0 36px 36px;
    text-align: center;
}
.logo {
    width: 68px;
    height: 68px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.22);
    display: grid;
    place-items: center;
    font-size: 1.9rem;
    margin: 0 auto 16px;
}
.hero h1 {
    font-size: 1.7rem;
    font-weight: 800;
}
.hero p {
    opacity: 0.92;
    font-size: 0.92rem;
    margin-top: 6px;
}
.auth-card {
    background: var(--surface);
    margin: -44px 18px 24px;
    border-radius: 26px;
    padding: 20px;
    box-shadow: 0 14px 32px rgba(29, 51, 32, 0.14);
}
.input {
    position: relative;
    margin-bottom: 12px;
}
.input > svg:first-child,
.input > i:first-child {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: 0.95rem;
}
.input .field {
    padding-left: 42px;
}
.eye {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    color: var(--muted);
}
.field {
    width: 100%;
    padding: 14px;
    border-radius: 14px;
    border: 2px solid var(--line);
    background: var(--surface);
    font-size: 1rem;
}
.field:focus {
    border-color: var(--c4);
    outline: 0;
}
.big {
    font-size: 1.7rem;
    font-weight: 800;
}
.msg {
    font-size: 0.82rem;
    min-height: 1.2em;
    margin: 2px 0 10px;
    color: var(--expense);
    font-weight: 500;
}
.msg.ok {
    color: var(--income);
}
.btn {
    width: 100%;
    padding: 16px;
    border-radius: 16px;
    background: var(--c4);
    color: #fff;
    font-weight: 800;
    font-size: 1rem;
    display: flex;
    justify-content: center;
    gap: 10px;
    align-items: center;
}


.google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.google-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.google-mark img {
    display: block;
    width: 20px;
    height: 20px;
    object-fit: contain;
}


.btn:disabled {
    opacity: 0.6;
}
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
    color: var(--muted);
    font-size: 0.82rem;
}
.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--line);
}
.google-btn {
    width: 100%;
    min-height: 52px;
    padding: 12px 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    color: #202124;
    font-size: 0.96rem;
    font-weight: 700;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
}
.google-btn:hover { background: #f8f9fa; }
.google-btn:disabled { opacity: 0.6; }
.google-mark {
    font-family: Arial, sans-serif;
    font-size: 1.2rem;
    font-weight: 800;
    color: #4285f4;
}
.seg {
    display: flex;
    background: var(--surface2);
    border-radius: 16px;
    padding: 4px;
    margin: 0 0 18px;
    gap: 4px;
}
.seg button {
    flex: 1;
    padding: 10px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--muted);
}
.seg button.on {
    background: var(--c4);
    color: #fff;
}
.boot {
    min-height: 100vh;
    display: grid;
    place-items: center;
    color: var(--c4);
    font-size: 2rem;
}

/* App */
.app {
    max-width: 430px;
    margin: 0 auto;
    padding: 20px 18px 120px;
}
.top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    gap: 12px;
}
.top h1 {
    font-size: 1.25rem;
    font-weight: 800;
}
.top p {
    font-size: 0.82rem;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 240px;
}
.logout {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--surface);
    color: var(--c4);
    display: grid;
    place-items: center;
    font-size: 1rem;
    flex: none;
}
.balance {
    background: linear-gradient(145deg, var(--c4), var(--c3));
    color: #fff;
    border-radius: 28px;
    padding: 22px;
    box-shadow: 0 12px 28px rgba(48, 177, 85, 0.28);
}
.balance small {
    opacity: 0.9;
    font-size: 0.85rem;
    font-weight: 500;
}
.balance .val {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 4px 0 18px;
}
.flow {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.flow div {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 18px;
    padding: 12px;
}
.flow span {
    display: flex;
    gap: 6px;
    align-items: center;
    font-size: 0.75rem;
}
.flow b {
    font-size: 1.05rem;
}
.app .seg {
    background: var(--surface);
    margin: 22px 0 14px;
}
.sec-title {
    font-size: 1rem;
    font-weight: 800;
    margin: 6px 0 10px;
}
.list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.tx {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface);
    border-radius: 18px;
    padding: 12px;
}
.ico {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: var(--surface2);
    color: var(--c4);
    display: grid;
    place-items: center;
    font-size: 1.1rem;
    flex: none;
}
.tx .info {
    flex: 1;
    min-width: 0;
}
.tx .info b {
    display: block;
    font-size: 0.92rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tx .info span {
    font-size: 0.75rem;
    color: var(--muted);
}
.amt {
    font-weight: 800;
    font-size: 0.95rem;
    white-space: nowrap;
}
.amt.in {
    color: var(--income);
}
.amt.out {
    color: var(--expense);
}
.del {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    color: var(--muted);
    font-size: 0.9rem;
}
.del:active {
    background: var(--surface2);
}
.empty {
    text-align: center;
    color: var(--muted);
    padding: 36px 12px;
    background: var(--surface);
    border-radius: 20px;
    font-size: 0.9rem;
}
.card {
    background: var(--surface);
    border-radius: 22px;
    padding: 18px;
    margin-bottom: 14px;
}
.bar-row {
    margin-bottom: 14px;
}
.bar-row:last-child {
    margin-bottom: 0;
}
.bar-head {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 6px;
    font-weight: 500;
}
.bar-head span {
    display: flex;
    gap: 8px;
    align-items: center;
}
.bar-head svg {
    color: var(--c4);
}
.bar-head b {
    font-weight: 700;
}
.track {
    height: 10px;
    border-radius: 99px;
    background: var(--surface2);
    overflow: hidden;
}
.fill {
    height: 100%;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--c4), var(--c2));
    transition: width 0.4s;
}
.nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 10px 18px calc(10px + env(safe-area-inset-bottom, 0px));
    background: var(--surface);
    border-top: 1px solid var(--line);
    z-index: 5;
}
.nav-in {
    max-width: 430px;
    margin: 0 auto;
    height: 56px;
    display: grid;
    grid-template-columns: 1fr 72px 1fr;
    align-items: center;
}
.nav-in .tab {
    justify-self: center;
}
.nav .tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--muted);
    padding: 6px 18px;
    border-radius: 14px;
}
.nav .tab svg {
    font-size: 1.15rem;
}
.nav .tab.on {
    color: var(--c4);
}
.fab {
    position: relative;
    grid-column: 2;
    justify-self: center;
    align-self: start;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: var(--c4);
    margin-top: -32px;
    box-shadow: 0 8px 20px rgba(48, 177, 85, 0.45);
    border: 4px solid var(--bg);
    z-index: 6;
}
.fab::before,
.fab::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    background: #fff;
    border-radius: 3px;
    transform: translate(-50%, -50%);
}
.fab::before {
    width: 22px;
    height: 4px;
}
.fab::after {
    width: 4px;
    height: 22px;
}
.row-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 6px 0 10px;
}
.row-title .sec-title {
    margin: 0;
}
.pill {
    display: flex;
    gap: 7px;
    align-items: center;
    background: var(--c4);
    color: #fff;
    font-weight: 700;
    font-size: 0.82rem;
    padding: 9px 14px;
    border-radius: 99px;
}
.fab:active {
    transform: scale(0.94);
}
.ov {
    position: fixed;
    inset: 0;
    background: rgba(10, 20, 12, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 10;
}
.ov.open {
    opacity: 1;
    pointer-events: auto;
}
.sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 11;
    background: var(--surface);
    border-radius: 28px 28px 0 0;
    padding: 14px 20px calc(22px + env(safe-area-inset-bottom, 0px));
    transform: translateY(105%);
    transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
    max-height: 92%;
    overflow-y: auto;
}
.sheet.open {
    transform: none;
}
.sheet-in {
    max-width: 430px;
    margin: 0 auto;
}
.grab {
    width: 42px;
    height: 5px;
    border-radius: 9px;
    background: var(--line);
    margin: 0 auto 14px;
}
.sheet h2 {
    font-size: 1.1rem;
    margin-bottom: 14px;
}
.type {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
}
.type button {
    padding: 12px;
    border-radius: 14px;
    font-weight: 700;
    background: var(--surface2);
    color: var(--muted);
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
}
.type button.in.on {
    background: var(--c3);
    color: #0f3318;
}
.type button.out.on {
    background: var(--expense);
    color: #fff;
}
label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--muted);
    margin: 12px 0 6px;
}
.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.chip {
    padding: 9px 12px;
    border-radius: 99px;
    background: var(--surface2);
    font-size: 0.82rem;
    font-weight: 700;
    display: flex;
    gap: 7px;
    align-items: center;
}
.chip.on {
    background: var(--c4);
    color: #fff;
}
.sheet .btn {
    margin-top: 18px;
}
.toast {
    position: fixed;
    left: 50%;
    bottom: 110px;
    transform: translate(-50%, 20px);
    background: var(--text);
    color: var(--bg);
    padding: 10px 18px;
    border-radius: 99px;
    font-size: 0.85rem;
    font-weight: 700;
    opacity: 0;
    pointer-events: none;
    transition: 0.25s;
    z-index: 20;
    white-space: nowrap;
}
.toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}
/* Microinterações consistentes, com movimento reduzido respeitado */
button, .tx, .card, .balance, .auth-card {
    transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease,
        color 180ms ease, border-color 180ms ease, opacity 180ms ease;
}
button:not(:disabled):active { transform: scale(.97); }
button:disabled { cursor: wait; }
@media (hover: hover) and (pointer: fine) {
    .btn:hover:not(:disabled), .pill:hover, .fab:hover { filter: brightness(1.05); box-shadow: 0 8px 22px rgba(48,177,85,.24); }
    .tx:hover, .card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(29,51,32,.08); }
    .logout:hover, .del:hover, .chip:hover, .seg button:hover { background-color: var(--surface2); }
}
.btn:disabled { opacity: .68; }
/* Não animar com transform o ancestral da folha: isso muda o containing block de position:fixed. */
#main:not(.hide) { animation: fade-in .22s ease both; }
.tx { animation: enter .24s ease both; }
.skeleton-row {
    height: 68px;
    border-radius: 18px;
    background: linear-gradient(100deg, var(--surface) 25%, var(--surface2) 45%, var(--surface) 65%);
    background-size: 220% 100%;
    animation: shimmer 1.25s linear infinite;
}
@keyframes shimmer { to { background-position-x: -220%; } }
@keyframes enter { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
