/* Fonte base, variáveis de tema e reset simples */
:root {
    /* Cores base do tema (Midnight Neon padrão) */
    --bg-page: #0B0E14;
    --bg-app: #0B0E14;
    --card-bg: #151921;
    --card-border: rgba(80, 90, 120, 0.7);
    --text-main: #A9B1D6;
    --text-muted: #6b7280;
    --heading: #00E5FF;
    --accent: #FF007C;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg-page);
    color: var(--text-main);
    min-height: 100vh;
}

.app-background {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background:
        radial-gradient(circle at 0% 0%, color-mix(in srgb, var(--accent) 32%, transparent), transparent 55%),
        radial-gradient(circle at 100% 100%, color-mix(in srgb, #22c55e 26%, transparent), transparent 50%),
        radial-gradient(circle at 100% 0%, color-mix(in srgb, #0ea5e9 22%, transparent), transparent 55%);
}

.app-glass {
    backdrop-filter: blur(14px);
}

.auth-container {
    width: 100%;
    max-width: 420px;
}

.auth-card {
    background: var(--card-bg);
    border-radius: 24px;
    padding: 28px 24px 24px;
    border: 1px solid var(--card-border);
    box-shadow:
        0 24px 60px rgba(15, 23, 42, 0.9),
        inset 0 0 0 0.5px rgba(255, 255, 255, 0.04);
}

.app-title {
    font-size: 1.4rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 4px;
    letter-spacing: 0.03em;
}

.app-subtitle {
    font-size: 0.9rem;
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 12px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.form-group input,
.form-group select {
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: rgba(15, 23, 42, 0.9);
    color: var(--text-main);
    padding: 10px 12px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.form-group input:focus,
.form-group select:focus {
    border-color: rgba(129, 140, 248, 0.9);
    box-shadow: 0 0 0 1px rgba(129, 140, 248, 0.6);
    background: rgba(15, 23, 42, 0.95);
}

.btn-primary {
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 60%, #22c55e 40%), #22c55e);
    color: white;
    font-weight: 600;
    padding: 12px 18px;
    font-size: 0.95rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow:
        0 12px 30px rgba(79, 70, 229, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.08);
    transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.btn-primary:hover {
    transform: translateY(-1px) scale(1.01);
    filter: brightness(1.05);
    box-shadow:
        0 18px 40px rgba(79, 70, 229, 0.9),
        0 0 0 1px rgba(255, 255, 255, 0.12);
}

.btn-primary:active {
    transform: translateY(0) scale(0.99);
    box-shadow:
        0 8px 18px rgba(15, 23, 42, 0.95),
        0 0 0 1px rgba(255, 255, 255, 0.06);
}

.btn-full {
    width: 100%;
}

.auth-footer {
    margin-top: 18px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.link-ghost {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.link-ghost:hover {
    text-decoration: underline;
}

.alert {
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 0.8rem;
    margin-bottom: 10px;
}

.alert-error {
    background: rgba(248, 113, 113, 0.18);
    border: 1px solid rgba(248, 113, 113, 0.5);
    color: #fecaca;
}

/* Dashboard básico */
.dashboard-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 12px 12px 18px;
    gap: 10px;
}

.dash-header {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.user-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    background: radial-gradient(circle at 0% 0%, rgba(255, 255, 255, 0.12), transparent 55%);
    border: 1px solid var(--card-border);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: conic-gradient(from 180deg, var(--accent), #22c55e, #06b6d4, var(--accent));
    box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.9);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.8rem;
    font-weight: 600;
}

.user-role {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.dash-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.icon-button {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    cursor: pointer;
}

.dash-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 10px;
}

@media (max-width: 768px) {
    .dash-grid {
        grid-template-columns: 1fr;
    }
}

.card {
    background: var(--card-bg);
    border-radius: 24px;
    border: 1px solid var(--card-border);
    padding: 14px 14px 12px;
}

.card-hero {
    position: relative;
    padding-top: 18px;
    padding-bottom: 16px;
    box-shadow:
        0 18px 40px rgba(15, 23, 42, 0.9),
        0 0 0 1px rgba(255, 255, 255, 0.03);
}

.hero-greeting {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.hero-quote {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.hero-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.hero-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 8px;
}

.hero-total-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.hero-variation {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
}

.hero-variation span {
    font-size: 0.75rem;
}

.hero-variation-positive {
    color: #4ade80;
}

.hero-variation-negative {
    color: #f97373;
}

.hero-individual {
    margin-top: 10px;
    font-size: 0.8rem;
    display: flex;
    justify-content: space-between;
    color: var(--text-main);
}

.hero-teto-bar {
    margin-top: 6px;
}

.hero-teto-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.card-title {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--heading);
}

.amount-highlight {
    font-size: 1.4rem;
    font-weight: 700;
}

.pill {
    font-size: 0.7rem;
    padding: 3px 7px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent) 65%, var(--card-bg) 35%);
    border: 1px solid color-mix(in srgb, var(--accent) 80%, #ffffff 20%);
    color: #ffffff;
}

.orbit-buttons {
    margin-top: 6px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.orbit-button {
    aspect-ratio: 1 / 1;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background:
        radial-gradient(circle at 30% 0%, rgba(255, 255, 255, 0.16), transparent 55%),
        radial-gradient(circle at 100% 100%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 50%),
        color-mix(in srgb, var(--card-bg) 70%, #020617 30%);
    box-shadow:
        0 10px 24px rgba(15, 23, 42, 0.95),
        0 0 0 1px rgba(15, 23, 42, 1),
        0 0 25px var(--accent);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    font-size: 0.65rem;
    text-align: center;
    padding: 4px;
    transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.orbit-button .icon {
    font-size: 1.4rem;
    color: var(--accent);
    filter: drop-shadow(0 0 10px color-mix(in srgb, var(--accent) 80%, transparent));
}

.orbit-button:hover {
    transform: translateY(-2px) scale(1.03);
    border-color: var(--accent);
    box-shadow:
        0 14px 32px rgba(15, 23, 42, 1),
        0 0 32px var(--accent);
}

.orbit-button:active {
    transform: translateY(0) scale(0.98);
}

.ranking-list {
    margin-top: 4px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ranking-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
}

.ranking-name {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ranking-badge {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
}

.badge-economy {
    color: #bbf7d0;
}

.badge-spender {
    color: #fecaca;
}

.progress-wrapper {
    margin-top: 6px;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    margin-bottom: 4px;
}

.progress-bar {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 1);
    border: 1px solid rgba(148, 163, 184, 0.3);
    overflow: hidden;
}

.progress-inner {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #22c55e, #a3e635, #facc15);
    width: 30%;
}

.member-summary {
    margin-top: 4px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.75rem;
}

.member-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.member-name {
    display: flex;
    align-items: center;
    gap: 4px;
}

.member-initial {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: #e5e7eb;
}

.member-amount {
    font-weight: 500;
}

.member-percent {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Modal teclado numérico */
.backdrop {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at top, rgba(15, 23, 42, 0.8), rgba(2, 6, 23, 0.95));
    display: none;
    align-items: flex-end;
    justify-content: center;
    padding: 12px;
    z-index: 40;
}

.backdrop.visible {
    display: flex;
}

.numpad-sheet {
    width: 100%;
    max-width: 480px;
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.9));
    border-radius: 24px 24px 18px 18px;
    border: 1px solid rgba(148, 163, 184, 0.5);
    padding: 12px 14px 14px;
    box-shadow: 0 -18px 40px rgba(0, 0, 0, 0.8);
}

.numpad-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.numpad-title {
    font-size: 0.85rem;
    color: #9ca3af;
}

.numpad-display {
    font-size: 1.6rem;
    font-weight: 700;
    text-align: right;
    margin-bottom: 6px;
}

.numpad-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 6px;
}

.numpad-key {
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: rgba(15, 23, 42, 0.95);
    color: #e5e7eb;
    padding: 12px 0;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.numpad-key.confirm {
    background: radial-gradient(circle at top, rgba(34, 197, 94, 0.3), rgba(21, 128, 61, 0.9));
    border-color: rgba(34, 197, 94, 0.9);
}

.numpad-key.delete {
    background: radial-gradient(circle at top, rgba(248, 113, 113, 0.3), rgba(185, 28, 28, 0.9));
    border-color: rgba(248, 113, 113, 0.9);
}

