/* ===================================================
   ALICEWORLD — Design System Dark
   =================================================== */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
    --bg: #09090f; --surface: #10101e; --surface-2: #17172b; --surface-3: #1f1f38;
    --border: rgba(255,255,255,0.07); --border-hover: rgba(255,255,255,0.15);
    --gold: #e8c547; --gold-light: #f5d76e; --gold-glow: rgba(232,197,71,0.15);
    --income: #34d399; --expense: #f87171; --error: #ef4444; --success: #10b981;
    --text: #f1f5f9; --text-muted: #64748b; --text-soft: #94a3b8;
    --glass: rgba(16,16,30,0.85); --glass-border: rgba(232,197,71,0.12);
    --glow: 0 0 30px rgba(232,197,71,0.08);
    --radius-sm: 8px; --radius-md: 14px; --radius-lg: 20px; --radius-xl: 28px;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.4); --shadow-md: 0 8px 24px rgba(0,0,0,0.5);
    --shadow-lg: 0 24px 60px rgba(0,0,0,0.7);
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.6; -webkit-font-smoothing: antialiased; }

/* ===================================================
   LOGIN PAGE — Diagonal split (Violet Evergarden inspired)
   =================================================== */

/* Body da auth = fundo parchment (painel direito) */
.auth-page {
    min-height: 100vh;
    width: 100%;
    position: relative;
    overflow: hidden;
    background: #e2cca8;
}

/* Painel escuro esquerdo com corte diagonal */
.panel-left {
    position: absolute;
    inset: 0;
    background: linear-gradient(160deg, #0d0906 0%, #1b110b 60%, #110c08 100%);
    clip-path: polygon(0 0, 60% 0, 43% 100%, 0 100%);
    z-index: 1;
}

/* Logo */
.auth-logo {
    position: absolute;
    top: 40px;
    left: 52px;
    z-index: 30;
    font-size: 26px;
    font-weight: 700;
    color: white;
    letter-spacing: -0.5px;
}
.auth-logo span { color: #e8c547; }

/* Conteudo heroi — lado esquerdo (escuro) */
.auth-hero {
    position: absolute;
    left: 52px;
    top: 50%;
    transform: translateY(-50%);
    width: 36%;
    z-index: 10;
    padding-top: 60px;
}

.hero-tagline {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 4px;
    color: #e8c547;
    text-transform: uppercase;
    margin-bottom: 24px;
}

.hero-title {
    font-size: clamp(40px, 4.8vw, 72px);
    font-weight: 900;
    line-height: 0.95;
    color: white;
    letter-spacing: -2.5px;
    margin-bottom: 28px;
}
.hero-title .highlight { color: #e8c547; }

.hero-verse {
    max-width: 380px;
    padding: 20px 24px;
    border-left: 3px solid #e8c547;
    background: rgba(232, 197, 71, 0.07);
    border-radius: 0 8px 8px 0;
}
.hero-verse .verse-text {
    font-size: 15px;
    color: rgba(255,255,255,0.72);
    font-style: italic;
    line-height: 1.75;
    margin-bottom: 10px;
}
.hero-verse .verse-ref {
    font-size: 14px;
    color: #e8c547;
    font-weight: 700;
}

/* Personagem no corte (centralizada) */
.character-wrap {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    height: 92vh;
    z-index: 5;
    pointer-events: none;
}
.character-wrap img {
    height: 100%;
    width: auto;
    display: block;
}

/* Easter egg cavaleiro */
.knight-egg {
    position: absolute;
    bottom: 32px;
    right: 56%;
    z-index: 30;
    display: flex;
    align-items: flex-end;
    gap: 12px;
}
.knight-egg img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 12px;
    border: 2px solid rgba(232,197,71,0.4);
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    transition: transform .3s ease;
}
.knight-egg img:hover { transform: scale(1.08) rotate(-3deg); }
.knight-bubble {
    background: white;
    color: #1a1a2e;
    padding: 8px 16px;
    border-radius: 20px 20px 20px 4px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    position: relative;
    bottom: 10px;
    animation: floatBubble 3s ease-in-out infinite;
}
.knight-bubble::before {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 12px;
    width: 12px;
    height: 12px;
    background: white;
    clip-path: polygon(0 0, 100% 0, 0 100%);
}
@keyframes floatBubble { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* Formulario — lado direito (parchment) */
.auth-form-section {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 44%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 60px 64px 60px 44px;
    z-index: 10;
}
.auth-form-container { width: 100%; max-width: 430px; }

/* Card no fundo parchment */
.auth-card {
    background: rgba(235, 215, 180, 0.55);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1.5px solid rgba(180, 135, 75, 0.3);
    border-radius: 28px;
    padding: 52px 44px;
    box-shadow: 0 20px 60px rgba(100, 60, 20, 0.12);
}
.auth-card h2 {
    font-size: 30px;
    font-weight: 800;
    color: #1a0f08;
    margin-bottom: 6px;
    letter-spacing: -0.5px;
    line-height: 1.2;
}
.auth-subtitle {
    font-size: 15px;
    color: #6b4530;
    margin-bottom: 40px;
}

/* Inputs no fundo claro */
.auth-page .form-group { margin-bottom: 22px; }
.auth-page .form-group label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #5c3820;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 9px;
}
.auth-page .form-group input {
    width: 100%;
    padding: 15px 20px;
    background: rgba(255, 248, 235, 0.85);
    border: 1.5px solid rgba(180, 130, 70, 0.35);
    border-radius: 14px;
    font-size: 16px;
    color: #1a0f08;
    font-family: var(--font);
    transition: all .2s ease;
    outline: none;
}
.auth-page .form-group input::placeholder { color: #b09070; }
.auth-page .form-group input:focus {
    border-color: #c9933a;
    background: rgba(255, 252, 242, 0.98);
    box-shadow: 0 0 0 3px rgba(201, 147, 58, 0.15);
}

/* Mensagens de auth */
.auth-message { margin-top: 16px; padding: 12px 16px; border-radius: 10px; text-align: center; font-size: 14px; display: none; }
.auth-message.success { display: block; background: rgba(52,211,153,0.12); color: #0e8a5a; border: 1px solid rgba(52,211,153,0.2); }
.auth-message.error { display: block; background: rgba(200,80,50,0.1); color: #a0300a; border: 1px solid rgba(200,80,50,0.2); }
.auth-form { display: none; }
.auth-form.active { display: block; animation: fadeIn .3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* Botao Entrar — ouro ambar no tema auth */
.auth-page .btn-primary {
    background: #c9933a;
    color: white;
    width: 100%;
}
.auth-page .btn-primary:hover {
    background: #dfaa48;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(201, 147, 58, 0.35);
}
.auth-page .btn-primary:active { transform: translateY(0); }


/* ===================================================
   BOTOES
   =================================================== */
.btn { padding: 13px 24px; border: none; border-radius: var(--radius-md); font-size: 15px; font-weight: 600; cursor: pointer; transition: all .25s ease; font-family: var(--font); letter-spacing: .2px; }
.btn-primary { background: var(--gold); color: #09090f; width: 100%; }
.btn-primary:hover { background: var(--gold-light); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(232,197,71,0.3); }
.btn-primary:active { transform: translateY(0); }
.btn-outline { background: transparent; border: 1px solid var(--border-hover); color: var(--text-soft); }
.btn-outline:hover { border-color: var(--gold); color: var(--gold); }
.btn-danger { background: transparent; border: 1px solid rgba(248,113,113,0.3); color: var(--expense); }
.btn-danger:hover { background: rgba(248,113,113,0.1); border-color: var(--expense); }
.btn-large { width: 100%; padding: 16px 32px; font-size: 16px; }

/* ===================================================
   DASHBOARD
   =================================================== */
.dashboard-page { min-height: 100vh; background: var(--bg); background-image: radial-gradient(ellipse at 0% 0%, rgba(232,197,71,0.03) 0%, transparent 50%), radial-gradient(ellipse at 100% 100%, rgba(139,92,246,0.04) 0%, transparent 50%); padding-bottom: 60px; }
.dashboard-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.dashboard-header .container { display: flex; justify-content: space-between; align-items: center; height: 64px; }
.header-brand { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 700; color: white; }
.brand-heart { color: white; }
.brand-name { color: var(--gold); }
.header-actions { display: flex; align-items: center; gap: 16px; }
.user-email { font-size: 13px; color: var(--text-muted); }
.dashboard-header .btn-outline { padding: 8px 18px; font-size: 13px; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.tagline-section { background: var(--surface); border-bottom: 1px solid var(--border); text-align: center; padding: 14px 20px; }
.tagline-section .tagline { font-size: 15px; font-weight: 600; color: var(--gold); margin-bottom: 3px; }
.bible-verse { font-size: 13px; color: var(--text-muted); font-style: italic; max-width: 560px; margin: 0 auto; }

/* Balance Card */
.balance-card { background: var(--surface-2); border: 1px solid var(--border); border-top: 3px solid var(--gold); padding: 40px; border-radius: var(--radius-lg); margin-top: 32px; position: relative; overflow: hidden; }
.balance-card::before { content: ''; position: absolute; top: -80px; right: -80px; width: 300px; height: 300px; background: radial-gradient(circle, rgba(232,197,71,0.06) 0%, transparent 70%); pointer-events: none; }
.balance-card h2 { font-size: 13px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px; }
.balance-amount { font-size: 52px; font-weight: 800; color: white; letter-spacing: -2px; line-height: 1; margin-bottom: 32px; }
.balance-details { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: 380px; }
.balance-item { background: rgba(255,255,255,0.04); border: 1px solid var(--border); padding: 16px 20px; border-radius: var(--radius-md); }
.balance-item .label { display: block; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; color: var(--text-muted); }
.balance-item.income .label { color: var(--income); }
.balance-item.expense .label { color: var(--expense); }
.balance-item.total-acc .label { color: var(--gold); }
.balance-item .value { display: block; font-size: 22px; font-weight: 700; color: white; }

/* Seletor de mês */
.month-selector { display: flex; align-items: center; justify-content: center; gap: 20px; margin-top: 32px; }
.month-nav { background: var(--surface-2); border: 1px solid var(--border); color: var(--text-soft); width: 40px; height: 40px; border-radius: 50%; font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all .2s ease; font-family: var(--font); }
.month-nav:hover { border-color: var(--gold); color: var(--gold); background: var(--gold-glow); }
.month-display { background: var(--surface-2); border: 1px solid var(--border); padding: 10px 28px; border-radius: 99px; min-width: 200px; text-align: center; }
.month-display span { font-size: 16px; font-weight: 700; color: white; }

/* Meta mensal */
.monthly-goal { margin-top: 32px; padding-top: 28px; border-top: 1px solid var(--border); }
.goal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.goal-label { font-size: 13px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.goal-value { font-size: 15px; font-weight: 700; color: var(--gold); }
.goal-bar { width: 100%; height: 10px; background: rgba(255,255,255,0.06); border-radius: 5px; overflow: hidden; margin-bottom: 8px; }
.goal-fill { height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-light)); border-radius: 5px; transition: width .5s ease; }
.goal-footer { display: flex; justify-content: space-between; font-size: 13px; }
.goal-footer span:first-child { color: var(--gold); font-weight: 700; }
.goal-footer span:last-child { color: var(--text-muted); }
.actions-section { margin: 28px 0; }
.actions-section .btn-primary { max-width: 280px; }

/* Flower Section */
.flower-section { margin: 40px 0; border-radius: var(--radius-lg); overflow: hidden; position: relative; height: 280px; display: flex; align-items: center; border: 1px solid rgba(232,197,71,0.12); }
.flower-bg { position: absolute; inset: 0; }
.flower-bg img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; filter: brightness(0.5) saturate(0.9); }
.flower-overlay { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(9,9,15,0.92) 0%, rgba(9,9,15,0.55) 60%, transparent 100%); }
.flower-content { position: relative; z-index: 2; padding: 0 48px; max-width: 500px; }
.flower-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 3px; color: var(--gold); margin-bottom: 14px; }
.flower-title { font-size: 36px; font-weight: 800; color: white; line-height: 1.1; letter-spacing: -1px; margin-bottom: 12px; }
.flower-title .highlight { color: var(--gold); }
.flower-subtitle { font-size: 15px; color: rgba(255,255,255,0.55); font-style: italic; }

/* Caixinhas */
.boxes-section { margin: 40px 0; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.section-header h2 { font-size: 20px; font-weight: 700; color: white; }
.section-header .btn-primary { width: auto; padding: 10px 20px; font-size: 14px; }
.boxes-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.box-card { background: var(--surface-2); border: 1px solid var(--border); padding: 24px; border-radius: var(--radius-lg); cursor: pointer; transition: all .25s ease; position: relative; overflow: hidden; }
.box-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, var(--gold), transparent); opacity: 0; transition: opacity .25s ease; }
.box-card:hover { border-color: var(--border-hover); transform: translateY(-3px); box-shadow: var(--shadow-md), 0 0 20px rgba(232,197,71,0.05); }
.box-card:hover::before { opacity: 1; }
.box-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.box-emoji { font-size: 28px; }
.box-name { font-size: 16px; font-weight: 600; color: white; }
.box-amounts { margin-bottom: 14px; }
.box-current { font-size: 26px; font-weight: 700; color: var(--gold); margin-bottom: 2px; }
.box-goal { font-size: 13px; color: var(--text-muted); }
.box-progress-bar { width: 100%; height: 6px; background: rgba(255,255,255,0.06); border-radius: 3px; overflow: hidden; margin-bottom: 6px; }
.box-progress-fill { height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-light)); border-radius: 3px; transition: width .4s ease; }
.box-percentage { font-size: 12px; font-weight: 600; color: var(--gold); text-align: right; }
.box-details { padding: 20px; background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: var(--radius-md); margin-bottom: 20px; }
.boxes-empty { text-align: center; padding: 60px 20px; color: var(--text-muted); }

/* Transacoes */
.transactions-section { margin-top: 40px; }
.transactions-section h2 { font-size: 20px; font-weight: 700; color: white; margin-bottom: 16px; }
.transactions-list { display: flex; flex-direction: column; gap: 8px; }
.transaction-item { background: var(--surface-2); border: 1px solid var(--border); padding: 18px 24px; border-radius: var(--radius-md); display: flex; justify-content: space-between; align-items: center; transition: all .2s ease; }
.transaction-item:hover { border-color: var(--border-hover); background: var(--surface-3); }
.transaction-info { flex: 1; }
.transaction-description { font-size: 15px; font-weight: 600; color: white; margin-bottom: 3px; }
.transaction-date { font-size: 13px; color: var(--text-muted); }
.transaction-amount { font-size: 18px; font-weight: 700; }
.transaction-amount.income { color: var(--income); }
.transaction-amount.expense { color: var(--expense); }
.empty-state { text-align: center; padding: 60px 20px; }
.empty-state p { font-size: 16px; margin-bottom: 6px; color: var(--text-soft); }
.empty-state-subtitle { font-size: 14px; color: var(--text-muted); }

/* Modal */
.modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 1000; align-items: center; justify-content: center; backdrop-filter: blur(4px); }
.modal.active { display: flex; animation: fadeIn .2s ease; }
.modal-content { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); width: 90%; max-width: 480px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 28px 32px 24px; border-bottom: 1px solid var(--border); }
.modal-header h2 { font-size: 20px; font-weight: 700; color: white; }
.modal-close { background: none; border: none; font-size: 24px; color: var(--text-muted); cursor: pointer; line-height: 1; transition: color .2s; }
.modal-close:hover { color: white; }
.modal-content form { padding: 28px 32px; }
.modal-footer { display: flex; gap: 10px; margin-top: 24px; }
.modal-footer .btn { flex: 1; }
.toggle-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.toggle-btn { padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: transparent; color: var(--text-soft); font-size: 14px; font-weight: 600; cursor: pointer; transition: all .2s ease; font-family: var(--font); }
.toggle-btn:hover { border-color: var(--gold); color: var(--gold); }
.toggle-btn.active { background: var(--gold); border-color: var(--gold); color: #09090f; }

/* Responsivo */
@media (max-width: 900px) {
    /* Auth mobile — stack vertical */
    .panel-left { clip-path: none; }
    .auth-page { background: #0d0906; }
    .auth-hero { position: relative; left: 0; bottom: 0; width: 100%; padding: 100px 28px 40px; }
    .hero-title { font-size: 46px; letter-spacing: -2px; }
    .character-wrap { display: none; }
    .auth-form-section { position: relative; right: 0; width: 100%; min-height: auto; padding: 20px 28px 48px; justify-content: center; }
    .auth-card { background: var(--glass); border-color: rgba(232,197,71,0.12); }
    .auth-card h2 { color: white; }
    .auth-subtitle { color: var(--text-soft); }
    .auth-page .form-group label { color: var(--text-soft); }
    .auth-page .form-group input { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.1); color: white; }
    .auth-page .form-group input::placeholder { color: var(--text-muted); }
    .auth-page .form-group input:focus { border-color: #e8c547; background: rgba(232,197,71,0.05); }
    .auth-page .btn-primary { background: #e8c547; color: #09090f; }
    .knight-egg { position: relative; bottom: auto; left: 0; margin: 0 28px 28px; }
    .auth-logo { left: 28px; top: 24px; }
}
@media (max-width: 640px) {
    .dashboard-header .container { flex-direction: column; height: auto; padding: 16px 24px; gap: 10px; }
    .balance-amount { font-size: 38px; }
    .balance-details { grid-template-columns: 1fr; }
    .flower-section { height: auto; min-height: 220px; }
    .flower-content { padding: 40px 28px; }
    .flower-title { font-size: 28px; }
    .boxes-list { grid-template-columns: 1fr; }
    .auth-card { padding: 32px 24px; }
    .modal-content form { padding: 20px 20px; }
    .modal-header { padding: 20px 20px 16px; }
}
