:root {
    --bg-primary: #0f172a;
    --bg-card: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent: #38bdf8;
    --accent-glow: rgba(56, 189, 248, 0.2);
    --success: #4ade80;
    --radius: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    padding: 20px;
    max-width: 600px;
    margin: 0 auto;
    padding-bottom: 100px;
}

header { text-align: center; margin-bottom: 30px; }
.subtitle { color: var(--text-secondary); font-size: 0.9rem; }

.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.net-worth-card { text-align: center; border: 1px solid var(--accent-glow); }
.big-number { font-size: 2.5rem; font-weight: 800; color: var(--accent); margin: 10px 0; }

.btn-primary {
    background: var(--accent);
    color: var(--bg-primary);
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    font-size: 1rem;
    transition: transform 0.1s;
}
.btn-primary:active { transform: scale(0.98); }

.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.btn-icon { background: var(--accent); color: var(--bg-primary); border: none; width: 32px; height: 32px; border-radius: 50%; font-size: 1.2rem; font-weight: bold; cursor: pointer; }

.goal-item {
    background: rgba(255,255,255,0.05);
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 10px;
}
.goal-header { display: flex; justify-content: space-between; margin-bottom: 8px; }
.progress-bar { height: 8px; background: rgba(255,255,255,0.1); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--success); transition: width 0.5s ease; }

/* Modal */
.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal.hidden { display: none; }
.modal-content { background: var(--bg-card); padding: 24px; border-radius: var(--radius); width: 90%; max-width: 400px; }
input { width: 100%; padding: 12px; margin-bottom: 12px; background: var(--bg-primary); border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; color: var(--text-primary); font-size: 1rem; }
.modal-actions { display: flex; gap: 10px; }
.btn-secondary { background: transparent; border: 1px solid var(--text-secondary); color: var(--text-secondary); padding: 12px; border-radius: 8px; flex: 1; cursor: pointer; }

.goal-item { position: relative; }
.goal-actions-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    line-height: 1;
}
.goal-actions-btn:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }

.goal-menu {
    display: none;
    position: absolute;
    top: 40px;
    right: 12px;
    background: var(--bg-primary);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    overflow: hidden;
    z-index: 10;
    min-width: 120px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.4);
}
.goal-menu.active { display: block; }

.goal-menu-item {
    display: block;
    width: 100%;
    padding: 10px 16px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
    font-size: 0.9rem;
}
.goal-menu-item:hover { background: rgba(255,255,255,0.05); }
.goal-menu-item.delete { color: #f87171; }
.goal-menu-item.delete:hover { background: rgba(248, 113, 113, 0.1); }

/* ═══════════════════════════════════════════════ */
/* LICENSE GATE STYLES                             */
/* ═══════════════════════════════════════════════ */
.license-gate {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: var(--bg-primary);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.license-card {
    background: var(--bg-card);
    padding: 32px 24px;
    border-radius: var(--radius);
    width: 100%;
    max-width: 400px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

.license-input {
    width: 100%;
    padding: 14px;
    margin-bottom: 10px;
    background: var(--bg-primary);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

.license-input:focus {
    border-color: var(--accent);
}

.lc-error {
    color: #f87171;
    font-size: 0.85rem;
    margin-bottom: 10px;
    min-height: 20px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255,255,255,0.1);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Hide main app initially to prevent flash of unlicensed content */
#app {
    opacity: 0; 
}