:root {
    --bg: #0e1015;
    --panel: #171a22;
    --panel-2: #1f232e;
    --text: #e8eaf0;
    --muted: #9aa1b2;
    --brand: #6c8cff;
    --brand-2: #8a5cff;
    --green: #35c88a;
    --amber: #f0b429;
    --red: #ef5350;
    --border: #2a2f3c;
    --radius: 14px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: radial-gradient(1200px 600px at 70% -10%, #1b2030, var(--bg));
    color: var(--text);
    line-height: 1.6;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
    background: var(--panel-2);
    padding: 2px 6px;
    border-radius: 6px;
    font-size: .9em;
}

/* Header / footer */
.site-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: rgba(14,16,21,.85);
    backdrop-filter: blur(8px);
    z-index: 10;
}
.brand { font-weight: 800; font-size: 1.4rem; color: var(--text); }
.brand span { color: var(--brand); }
.site-head nav a { margin-left: 18px; color: var(--muted); font-weight: 600; }
.site-head nav a:hover { color: var(--text); text-decoration: none; }

main { max-width: 860px; margin: 0 auto; padding: 32px 20px 64px; }

.site-foot {
    border-top: 1px solid var(--border);
    color: var(--muted);
    text-align: center;
    padding: 24px;
    font-size: .9rem;
}

/* Hero */
.hero { padding: 40px 0 24px; text-align: center; }
.hero h1 {
    font-size: 2.6rem;
    line-height: 1.15;
    margin: 0 0 16px;
    background: linear-gradient(90deg, var(--brand), var(--brand-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.lead { font-size: 1.15rem; color: var(--muted); max-width: 640px; margin: 0 auto 24px; }

/* Buttons */
.btn {
    display: inline-block;
    background: var(--panel-2);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 10px 18px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    font-size: 1rem;
    transition: transform .05s ease, filter .15s ease;
}
.btn:hover { filter: brightness(1.15); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-big {
    background: linear-gradient(90deg, var(--brand), var(--brand-2));
    border: none;
    padding: 14px 26px;
    font-size: 1.1rem;
}
.btn-small { padding: 7px 12px; font-size: .9rem; }
.btn-yes { background: var(--green); border: none; color: #04150d; }
.btn-changes { background: var(--amber); border: none; color: #211800; }
.btn-pay { background: #ffc439; border: none; color: #12233b; }
.btn-download { background: var(--green); border: none; color: #04150d; }
.btn-danger { background: transparent; border: 1px solid var(--red); color: var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; }

/* Sections */
section { margin-bottom: 40px; }
h2 { font-size: 1.5rem; margin-top: 0; }

.step-list { list-style: none; padding: 0; }
.step-list li {
    background: var(--panel);
    border: 1px solid var(--border);
    padding: 16px 18px;
    border-radius: var(--radius);
    margin-bottom: 12px;
}

.pay-note {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 22px;
}

/* Forms */
.card-form, .join {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}
.join .card-form { background: var(--panel-2); }
label { display: block; margin-bottom: 14px; font-weight: 600; }
input, textarea, select {
    width: 100%;
    margin-top: 6px;
    padding: 11px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font: inherit;
}
input[type=file] { padding: 8px; }
textarea { resize: vertical; }

.flash {
    background: #14351f;
    border: 1px solid var(--green);
    color: #b6f2d3;
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
}

.muted { color: var(--muted); }
.small { font-size: .9rem; }

/* Client portal */
.status-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-left: 4px solid var(--brand);
    border-radius: var(--radius);
    padding: 18px 20px;
    margin-bottom: 20px;
}
.status-line { display: flex; align-items: center; gap: 10px; font-size: 1.1rem; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 12px var(--brand); }
.status-review { border-left-color: var(--amber); }
.status-review .dot { background: var(--amber); box-shadow: 0 0 12px var(--amber); }
.status-awaiting_payment { border-left-color: #ffc439; }
.status-paid, .status-completed { border-left-color: var(--green); }
.status-paid .dot, .status-completed .dot { background: var(--green); box-shadow: 0 0 12px var(--green); }
.position { margin: 10px 0 0; }

.project-summary, .review-box, .pay-box, .download-box, .chat {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 22px;
    margin-bottom: 20px;
}
.review-box { border-color: var(--amber); }
.pay-box { border-color: #ffc439; text-align: center; }
.download-box { border-color: var(--green); text-align: center; }
.price { font-size: 2rem; font-weight: 800; margin: 6px 0; }
.fine { color: var(--muted); font-size: .9rem; }
.changes-form { margin-top: 16px; }
.inline-form { margin-top: 10px; }

/* Chat thread */
.thread { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.msg { padding: 10px 14px; border-radius: 12px; max-width: 85%; }
.msg-meta { font-size: .75rem; color: var(--muted); margin-bottom: 3px; }
.msg-admin { background: var(--panel-2); align-self: flex-start; border: 1px solid var(--border); }
.msg-client { background: linear-gradient(90deg, #263255, #2b2350); align-self: flex-end; }
.portal-link { margin-top: 24px; word-break: break-all; }

/* Admin */
.admin-top { display: flex; justify-content: space-between; align-items: center; }
.admin-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    margin-bottom: 16px;
}
.admin-card.first { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.admin-card.done { opacity: .85; }
.admin-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.queue-num { color: var(--muted); font-weight: 700; margin-right: 6px; }
.badge {
    background: var(--brand);
    color: #061033;
    font-size: .7rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 20px;
    margin-left: 8px;
    letter-spacing: .04em;
}
.pill {
    display: inline-block;
    font-size: .72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    margin-left: 8px;
    background: var(--panel-2);
    border: 1px solid var(--border);
    color: var(--muted);
}
.pill-review { color: var(--amber); border-color: var(--amber); }
.pill-awaiting_payment { color: #ffc439; border-color: #ffc439; }
.pill-paid, .pill-completed { color: var(--green); border-color: var(--green); }
.pill-needs_changes { color: var(--red); border-color: var(--red); }

.brief { background: var(--bg); padding: 10px 14px; border-radius: 10px; border: 1px solid var(--border); }
details summary { cursor: pointer; font-weight: 600; margin: 8px 0; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-top: 12px; }
.admin-actions form { margin: 0; }
.upload-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end;
    background: var(--panel-2); padding: 12px; border-radius: 10px; }
.upl { margin: 0; font-size: .85rem; }
.upl input { margin-top: 4px; }

.login { max-width: 420px; margin: 40px auto; }

@media (max-width: 600px) {
    .hero h1 { font-size: 2rem; }
    .site-head nav a { margin-left: 12px; }
    .msg { max-width: 100%; }
}
