/* =====================================================================
   iMLM — dizajnový systém pre členský portál
   Identita: hlboká námornícka modrá (dôvera/stabilita) + mosadzná
   (peniaze/provízie). Signatúra: rebrík pozícií a strom siete.
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@400;500;600&display=swap');

:root {
    --ink:      #16233a;
    --ink-2:    #22344f;
    --paper:    #f6f5f0;
    --card:     #ffffff;
    --brass:    #b1802b;
    --brass-2:  #d9b869;
    --crimson:  #bd275b;
    --line:     #e4e1d8;
    --muted:    #6a7488;
    --good:     #2f7d5b;
    --ink-soft: rgba(22, 35, 58, .06);

    --display: 'Space Grotesk', system-ui, sans-serif;
    --body:    'Inter', system-ui, sans-serif;

    --radius: 14px;
    --shadow: 0 1px 2px rgba(22,35,58,.04), 0 8px 24px rgba(22,35,58,.06);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--body);
    color: var(--ink);
    background: var(--paper);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

h1, h2, h3 { font-family: var(--display); font-weight: 600; margin: 0; letter-spacing: -.01em; }

.num { font-family: var(--display); font-variant-numeric: tabular-nums; }

/* ---- Top bar ---- */
.topbar {
    background: var(--ink);
    color: #fff;
    display: flex; align-items: center; gap: 28px;
    padding: 0 26px; height: 60px;
}
.brand { font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: -.02em; }
.brand span { color: var(--brass-2); }
.nav { display: flex; gap: 22px; margin-left: auto; align-items: center; }
.nav a { color: #cdd4e0; text-decoration: none; font-size: 14px; font-weight: 500; padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover { color: #fff; }
.nav a.active { color: #fff; border-color: var(--brass-2); }

/* ---- Layout ---- */
.wrap { max-width: 1080px; margin: 0 auto; padding: 34px 26px 70px; }
.grid { display: grid; gap: 20px; }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-2 { grid-template-columns: 1.5fr 1fr; }

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
}
.card h3 { font-size: 15px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; margin-bottom: 14px; }

.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 600; }

/* ---- Stat ---- */
.stat .big { font-family: var(--display); font-size: 40px; font-weight: 600; line-height: 1; letter-spacing: -.02em; }
.stat .label { color: var(--muted); font-size: 13px; margin-top: 6px; }
.stat.money .big { color: var(--brass); }

/* ---- Position pill ---- */
.pill { display: inline-flex; align-items: center; gap: 8px; background: var(--crimson); color: #fff;
    font-family: var(--display); font-weight: 600; padding: 5px 12px; border-radius: 999px; font-size: 14px; }

/* ---- Position ladder (signature) ---- */
.ladder { list-style: none; margin: 0; padding: 0; }
.ladder li { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 12px;
    padding: 9px 0; border-bottom: 1px dashed var(--line); }
.ladder li:last-child { border-bottom: 0; }
.rung { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line); background: #fff; }
.ladder .pct { font-family: var(--display); font-weight: 600; }
.ladder .thr { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.ladder li.done .rung { border-color: var(--brass); background: var(--brass); }
.ladder li.current { background: linear-gradient(90deg, rgba(177,128,43,.10), transparent); border-radius: 8px; padding-left: 8px; margin-left: -8px; }
.ladder li.current .rung { border-color: var(--brass); box-shadow: 0 0 0 4px rgba(177,128,43,.18); }
.ladder li.current .pct { color: var(--brass); }
.ladder .keypos { color: var(--crimson); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }

/* ---- Tree ---- */
.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul { margin-left: 20px; border-left: 1px solid var(--line); padding-left: 16px; }
.node { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.node .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-2); flex: none; }
.node.me .dot { background: var(--brass); box-shadow: 0 0 0 4px rgba(177,128,43,.15); }
.node .who { font-weight: 500; }
.node .meta { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.badge { font-family: var(--display); font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px;
    background: var(--ink-soft); color: var(--ink-2); }
.badge.pos { background: rgba(189,39,91,.10); color: var(--crimson); }

/* ---- Forms ---- */
.auth { max-width: 420px; margin: 60px auto; }
.auth .card { padding: 30px; }
label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 14px 0 6px; }
input[type=text], input[type=email], input[type=password], input[type=number] {
    width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px;
    font: inherit; background: #fff; }
input:focus { outline: none; border-color: var(--brass); box-shadow: 0 0 0 3px rgba(177,128,43,.15); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: var(--ink); color: #fff; border: 0; border-radius: 10px; padding: 12px 18px;
    font: 600 15px var(--body); cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--ink-2); }
.btn.brass { background: var(--brass); }
.btn.brass:hover { background: #9c6f24; }
.btn.full { width: 100%; }
.btn.small { padding: 8px 12px; font-size: 13px; }

.alert { border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; font-size: 14px; }
.alert.err { background: rgba(189,39,91,.08); color: var(--crimson); border: 1px solid rgba(189,39,91,.25); }
.alert.ok  { background: rgba(47,125,91,.08); color: var(--good); border: 1px solid rgba(47,125,91,.25); }

.muted { color: var(--muted); }
.link { color: var(--crimson); font-weight: 600; text-decoration: none; }
.link:hover { text-decoration: underline; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* ---- Shop ---- */
.shop { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.product { display: flex; flex-direction: column; }
.product .name { font-weight: 600; margin-bottom: 8px; min-height: 44px; }
.price { display: flex; align-items: baseline; gap: 8px; }
.price .member { font-family: var(--display); font-size: 22px; font-weight: 600; }
.price .old { color: var(--muted); text-decoration: line-through; font-size: 14px; }
.product .pts { color: var(--brass); font-weight: 600; font-size: 13px; margin: 4px 0 14px; }
.product form { margin-top: auto; display: flex; gap: 8px; }
.product input[type=number] { width: 64px; }

@media (max-width: 820px) {
    .cols-3, .cols-2, .shop { grid-template-columns: 1fr; }
    .nav { gap: 14px; }
}

@media (prefers-reduced-motion: no-preference) {
    .card, .auth { animation: rise .4s ease both; }
    @keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}
