/* =====================================================
   SOLWALLET - MOBILE FIRST, FLOT PÅ ALLE SKÆRME
   ===================================================== */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
    --bg: #0b1220;
    --card: #16213a;
    --card2: #1f2d4d;
    --text: #f1f5f9;
    --muted: #8fa3c0;
    --accent: #38bdf8;
    --green: #34d399;
    --red: #f87171;
    --border: #263659;
    --shadow: 0 8px 24px rgba(0,0,0,.35);
}

html { font-size: 16px; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background:
        radial-gradient(1000px 500px at 80% -10%, rgba(56,189,248,.08), transparent 60%),
        radial-gradient(800px 400px at 0% 0%, rgba(52,211,153,.06), transparent 60%),
        var(--bg);
    color: var(--text);
    min-height: 100vh;
    padding-bottom: 90px;
}

a { color: var(--accent); text-decoration: none; }
.container { max-width: 560px; margin: 0 auto; padding: 16px; }

/* ---------- Topbar ---------- */
.topbar {
    position: sticky; top: 0; z-index: 100;
    background: rgba(11,18,32,.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 14px 20px;
    display: flex; justify-content: space-between; align-items: center;
}
.topbar h1 { font-size: 1.3rem; font-weight: 800; letter-spacing: -.02em; }
.topbar h1 span { color: var(--accent); }
.topbar .user {
    font-size: .85rem; color: var(--muted); font-weight: 600;
    padding: 8px 14px; border-radius: 20px; border: 1px solid var(--border);
}

/* ---------- Sektionstitler ---------- */
.section-title {
    font-size: 1.15rem; font-weight: 800; margin: 22px 0 14px;
    display: flex; align-items: center; gap: 8px; letter-spacing: -.01em;
}
.section-title .count { color: var(--muted); font-weight: 600; font-size: .9rem; }

/* ---------- Grid (konti + mål) ---------- */
.grid { display: grid; gap: 14px; }

/* ---------- BANKKORT ---------- */
.bank-card {
    position: relative;
    border-radius: 20px;
    padding: 20px;
    border: 1px solid rgba(255,255,255,.08);
    box-shadow: var(--shadow);
    overflow: hidden;
    color: #fff;
}
.bank-card::before {
    content: ''; position: absolute; top: -60px; right: -60px;
    width: 200px; height: 200px; border-radius: 50%;
    background: rgba(255,255,255,.07);
}
.bank-card.privat { background: linear-gradient(135deg, #0369a1 0%, #0c4a6e 55%, #16213a 100%); }
.bank-card.firma { background: linear-gradient(135deg, #047857 0%, #065f46 55%, #16213a 100%); }
.bank-card .top { display: flex; justify-content: space-between; align-items: flex-start; position: relative; }
.bank-card .type-badge {
    font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
    padding: 4px 10px; border-radius: 20px;
    background: rgba(255,255,255,.15);
    backdrop-filter: blur(4px);
}
.bank-card h3 { font-size: 1.05rem; font-weight: 600; opacity: .9; margin-top: 14px; position: relative; }
.bank-card .balance { font-size: 2rem; font-weight: 800; margin-top: 2px; position: relative; letter-spacing: -.02em; }
.bank-card .balance.neg { color: #fecaca; }
.bank-card .updated { font-size: .72rem; opacity: .65; margin-top: 4px; position: relative; }
.bank-card .edit-link {
    font-size: .8rem; font-weight: 600; opacity: .85;
    padding: 6px 12px; border-radius: 16px;
    background: rgba(255,255,255,.12); color: #fff; position: relative;
}
/* hurtig opdatering på kortet */
.bank-card .quick-update {
    display: flex; gap: 8px; margin-top: 14px; position: relative;
}
.bank-card .quick-update input {
    flex: 1; padding: 11px 14px; border-radius: 12px;
    background: rgba(0,0,0,.3); border: 1px solid rgba(255,255,255,.15);
    color: #fff; font-size: .95rem;
}
.bank-card .quick-update input::placeholder { color: rgba(255,255,255,.5); }
.bank-card .quick-update input:focus { outline: 2px solid var(--accent); }
.bank-card .quick-update button {
    padding: 11px 16px; border: none; border-radius: 12px;
    background: rgba(255,255,255,.9); color: #0c4a6e;
    font-weight: 800; font-size: .9rem; cursor: pointer;
}
.bank-card .quick-update button:active { transform: scale(.95); }

/* ---------- Samlet-kort ---------- */
.total-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px 18px;
    margin-bottom: 6px;
}
.total-card .row { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; }
.total-card .row.main { font-size: 1.05rem; }
.total-card .row.main strong { font-size: 1.25rem; color: var(--accent); }
.total-card .sub { font-size: .82rem; color: var(--muted); }

/* ---------- Hero (samlet opsparing) ---------- */
.hero {
    background: linear-gradient(135deg, #164e63 0%, #16213a 100%);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 26px 20px;
    margin: 18px 0 16px;
    text-align: center;
    box-shadow: var(--shadow);
    position: relative; overflow: hidden;
}
.hero::before {
    content: ''; position: absolute; top: -80px; left: 50%; transform: translateX(-50%);
    width: 300px; height: 300px; border-radius: 50%;
    background: radial-gradient(circle, rgba(56,189,248,.18), transparent 70%);
}
.hero .label { color: var(--muted); font-size: .85rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; position: relative; }
.hero .amount { font-size: 2.6rem; font-weight: 800; margin: 6px 0 14px; position: relative; letter-spacing: -.03em; }
.hero .split { display: flex; justify-content: center; gap: 28px; position: relative; }
.hero .split div { text-align: center; }
.hero .split .n { font-size: 1.1rem; font-weight: 800; }
.hero .split .l { font-size: .75rem; color: var(--muted); }

/* ---------- Mål-kort ---------- */
.goal-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 18px;
    display: block; color: var(--text);
    transition: border-color .15s;
}
.goal-card:hover { border-color: var(--accent); }
.goal-card .top { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.goal-card .emoji { font-size: 1.8rem; }
.goal-card .name { font-weight: 700; font-size: 1.05rem; }
.goal-card .type-badge {
    font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
    padding: 3px 9px; border-radius: 20px;
    background: rgba(56,189,248,.15); color: var(--accent);
}
.goal-card .type-badge.firma { background: rgba(52,211,153,.15); color: var(--green); }
.goal-card .nums { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.goal-card .saved { font-size: 1.3rem; font-weight: 800; }
.goal-card .target { color: var(--muted); font-size: .85rem; }

/* ---------- Progressbar ---------- */
.progress { height: 12px; background: var(--card2); border-radius: 20px; overflow: hidden; }
.progress .bar {
    height: 100%; border-radius: 20px;
    background: linear-gradient(90deg, var(--accent), var(--green));
    transition: width .4s ease;
}
.progress.done .bar { background: var(--green); }
.progress-text { display: flex; justify-content: space-between; font-size: .78rem; color: var(--muted); margin-top: 6px; }
.progress-text .pct { color: var(--green); font-weight: 700; }

/* ---------- Knapper ---------- */
.btn {
    display: block; width: 100%;
    padding: 15px 20px;
    border: none; border-radius: 14px;
    font-size: 1rem; font-weight: 700;
    cursor: pointer; text-align: center;
    transition: transform .1s, filter .15s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: linear-gradient(135deg, #38bdf8, #0ea5e9); color: #082f49; }
.btn-green { background: var(--green); color: #022c22; }
.btn-danger { background: var(--red); color: #450a0a; }
.btn-ghost { background: var(--card2); color: var(--text); border: 1px solid var(--border); }
.btn-row { display: flex; gap: 10px; margin-bottom: 14px; }
.btn-row .btn { flex: 1; }

/* ---------- Formularer ---------- */
label { display: block; font-size: .85rem; color: var(--muted); margin: 14px 0 6px; font-weight: 600; }
input, select, textarea {
    width: 100%;
    padding: 14px;
    background: var(--card2);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-size: 1rem;
}
input:focus, select:focus { outline: 2px solid var(--accent); border-color: transparent; }

/* ---------- Historik-liste ---------- */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 8px 16px;
    margin-bottom: 14px;
}
.tx {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 2px;
    border-bottom: 1px solid var(--border);
}
.tx:last-child { border-bottom: none; }
.tx .info .desc { font-weight: 600; font-size: .95rem; }
.tx .info .meta { font-size: .78rem; color: var(--muted); margin-top: 2px; }
.tx .amt { font-weight: 800; font-size: 1rem; white-space: nowrap; }
.tx .amt.plus { color: var(--green); }
.tx .amt.minus { color: var(--red); }

/* ---------- Bundmenu ---------- */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: rgba(11,18,32,.97);
    backdrop-filter: blur(14px);
    border-top: 1px solid var(--border);
    display: flex; z-index: 100;
    padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav a {
    flex: 1;
    display: flex; flex-direction: column; align-items: center;
    padding: 10px 4px 12px;
    color: var(--muted); font-size: .68rem; font-weight: 700;
    transition: color .15s;
}
.bottom-nav a.active { color: var(--accent); }
.bottom-nav a .icon { font-size: 1.4rem; margin-bottom: 2px; }

/* ---------- Beskeder ---------- */
.alert { padding: 14px 16px; border-radius: 12px; margin-bottom: 14px; font-weight: 600; font-size: .9rem; }
.alert-success { background: rgba(52,211,153,.12); color: var(--green); border: 1px solid rgba(52,211,153,.3); }
.alert-error { background: rgba(248,113,113,.12); color: var(--red); border: 1px solid rgba(248,113,113,.3); }

.empty { text-align: center; color: var(--muted); padding: 30px 0; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { width: 100%; max-width: 400px; }
.logo { text-align: center; font-size: 2.4rem; font-weight: 800; margin-bottom: 8px; letter-spacing: -.03em; }
.logo span { color: var(--accent); }
.logo-sub { text-align: center; color: var(--muted); font-size: .88rem; margin-bottom: 28px; }

/* ---------- Emoji-vælger ---------- */
.emoji-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-top: 6px; }
.emoji-grid label { margin: 0; }
.emoji-grid input { display: none; }
.emoji-grid span {
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; padding: 10px 0;
    background: var(--card2); border: 2px solid var(--border);
    border-radius: 12px; cursor: pointer;
}
.emoji-grid input:checked + span { border-color: var(--accent); background: rgba(56,189,248,.15); }

/* =====================================================
   COMPUTER / STØRRE SKÆRME
   ===================================================== */
@media (min-width: 768px) {
    .container { max-width: 960px; padding: 28px 24px; }
    html { font-size: 17px; }
    .grid.cols-2 { grid-template-columns: 1fr 1fr; }
    .grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
    .hero .amount { font-size: 3rem; }
    .bottom-nav { max-width: 600px; left: 50%; transform: translateX(-50%); border-radius: 20px 20px 0 0; border: 1px solid var(--border); border-bottom: none; }
}

@media (min-width: 1100px) {
    .container { max-width: 1140px; }
    .grid.cols-2 { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Omregnet til DKK ---------- */
.bank-card .converted { font-size: .95rem; font-weight: 700; opacity: .8; margin-top: 2px; position: relative; }

/* ---------- Fold-ud/sektion ---------- */
.collapse-toggle:hover { color: var(--accent); }
.collapse-toggle .chev { transition: transform .15s; float: right; }
