:root {
    --bg:     #0b0e14;
    --card:   #161b24;
    --fg:     #e8edf4;
    --muted:  #8a95a8;
    --accent: #5bb8f5;
    --ok:     #2ed882;
    --err:    #f06060;
    --warn:   #ffcc66;
    --border: #252d3a;
    --radius: 12px;
}
* { box-sizing: border-box; }
html, body {
    margin: 0; padding: 0;
    background: var(--bg); color: var(--fg);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    line-height: 1.55;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.page,
.page.wide,
.page.admin {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 28px 16px 60px;
}

/* Standalone form actions — centers a single submit button. Forms that
 * have multiple controls in a row keep their own layout. */
.form-actions {
    display: flex;
    justify-content: center;
    margin-top: 16px;
}
.form-actions.right { justify-content: flex-end; }
.form-actions button { margin-top: 0; }

/* Each test / action form is a tiny standalone block; give it air. */
.action-form { margin-top: 14px; }

/* hCaptcha widget centered. The vendor div sets its own width based on
 * the chosen size, so just center the flex container around it. */
.h-captcha-row {
    display: flex;
    justify-content: center;
    margin: 12px 0;
}
.h-captcha-row .h-captcha { margin: 0; }

.page-header {
    position: relative;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 26px 24px 18px;
    margin-bottom: 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
.header-admin-link {
    position: absolute;
    top: 12px;
    right: 14px;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(255,255,255,.06);
}
.header-admin-link:hover { color: var(--fg); text-decoration: none; }
.site-logo { display: inline-block; line-height: 0; text-decoration: none; }
.site-logo:hover { text-decoration: none; }
.site-logo img { width: 64px; height: 64px; display: block; transition: transform .15s ease; }
.site-logo:hover img { transform: scale(1.04); }
.site-name {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: .01em;
    color: var(--fg);
    line-height: 1.2;
}
@media (max-width: 480px) {
    .site-logo img { width: 52px; height: 52px; }
    .site-name     { font-size: 1.1rem; }
}
.header-nav {
    display: flex; align-items: center; justify-content: center;
    flex-wrap: wrap; gap: 12px; margin-top: 2px;
}
.admin-badge {
    font-size: .72rem; color: var(--muted);
    background: rgba(255,255,255,.06);
    padding: 3px 8px; border-radius: 4px;
    text-transform: uppercase; letter-spacing: .04em;
}
.logout-link { color: var(--err); font-size: .82rem; }
.logout-link:hover { text-decoration: underline; }

.lang-switch { display: inline-flex; gap: 5px; }
.lang-switch a {
    color: var(--muted); font-size: .72rem;
    padding: 2px 7px; border-radius: 4px;
    text-transform: uppercase; text-decoration: none;
}
.lang-switch a.active { background: var(--accent); color: #05111c; }

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 16px;
}
.card h1 { margin: 0 0 8px; font-size: 1.35rem; }
.card h2 { margin: 0 0 10px; font-size: 1.1rem; }
.card .lead   { color: var(--muted); margin: 0 0 10px; }
.card .amount { font-weight: 600; color: var(--accent); margin: 0 0 20px; }

form label { display: block; font-size: .85rem; color: var(--muted); margin: 12px 0 4px; }
input, textarea, select {
    width: 100%; padding: 10px 12px; border-radius: 8px;
    border: 1px solid var(--border); background: #0b0f17;
    color: var(--fg); font: inherit;
}

/* All buttons — normal size everywhere */
button {
    width: auto;
    padding: 9px 18px;
    border-radius: 8px;
    border: 0;
    background: var(--accent);
    color: #05111c;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    margin-top: 16px;
    transition: background .15s, transform .05s ease;
}
button:hover    { background: #7ac6f8; }
button:active   { transform: translateY(1px); }
button:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.h-captcha { margin: 12px 0; }
.result { margin: 14px 0; padding: 10px 12px; border-radius: 8px; word-break: break-all; }
.result.ok  { background: rgba(46,216,130,.1);  color: var(--ok);  border: 1px solid rgba(46,216,130,.25); }
.result.err { background: rgba(240,96,96,.1);   color: var(--err); border: 1px solid rgba(240,96,96,.25); }
.result.warn { background: rgba(255,204,102,.1); color: var(--warn); border: 1px solid rgba(255,204,102,.25); }
footer { margin-top: 22px; text-align: center; font-size: .8rem; color: var(--muted); }
.site-footer {
    margin-top: 28px;
    text-align: center;
    font-size: .78rem;
    color: var(--muted);
    padding-top: 18px;
    border-top: 1px solid var(--border);
}
.site-footer a { color: var(--accent); }
.muted { color: var(--muted); }
.mono  { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .82rem; }

.donate-section h2    { margin: 0 0 6px; font-size: 1.15rem; }
.donate-section .lead { color: var(--muted); margin: 0 0 18px; font-size: .9rem; }
.donate-inputs { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.donate-inputs > div { flex: 1; min-width: 140px; }
.donate-inputs label { margin-top: 0; }

.uri-box {
    background: #1e2635;
    border: 1px solid var(--accent);
    border-radius: 10px;
    padding: 14px 16px;
    display: flex; align-items: flex-start; gap: 12px;
    margin-bottom: 12px; overflow: hidden;
}
.uri-box-content {
    flex: 1; min-width: 0;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: .82rem; color: #d4e8ff; line-height: 1.65;
    word-break: break-all; overflow-wrap: break-word; white-space: pre-wrap;
}
.btn-copy {
    margin: 0; padding: 7px 14px;
    font-size: .82rem; font-weight: 600;
    background: var(--accent); color: #05111c;
    border: 0; border-radius: 6px;
    cursor: pointer; flex-shrink: 0; white-space: nowrap;
    align-self: flex-start;
}
.btn-copy:hover  { background: #7ac6f8; }
.btn-copy.copied { background: var(--ok); }

.pay-info {
    background: #0d1218;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 14px;
}
.pi-row {
    display: flex; align-items: baseline; gap: 10px;
    padding: 8px 14px;
    border-bottom: 1px solid var(--border);
    font-size: .82rem;
}
.pi-row:last-child { border-bottom: none; }
.pi-label { color: var(--muted); width: 70px; flex-shrink: 0; font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; }
.pi-value { flex: 1; min-width: 0; word-break: break-all; overflow-wrap: break-word; }
.pi-value.mono { font-size: .78rem; }

.donate-hint        { font-size: .82rem; color: var(--muted); margin: 0 0 12px; }
.donate-donors-link { text-align: right; font-size: .85rem; }

.donors-total { font-weight: 600; color: var(--accent); margin: 0 0 18px; }
.donors-table-wrap { overflow-x: auto; }
.donors-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.donors-table th {
    color: var(--muted); font-size: .72rem; text-transform: uppercase;
    padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.donors-table td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.donors-date   { white-space: nowrap; color: var(--muted); font-size: .8rem; }
.donors-conf   { white-space: nowrap; font-size: .78rem; text-align: center; }
.conf-ok       { color: var(--ok); }
.conf-pending  { color: var(--warn); }
.donors-tx     { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.donors-amount { white-space: nowrap; color: var(--ok); font-weight: 600; text-align: right; }

.pagination {
    display: flex; align-items: center; justify-content: center;
    gap: 16px; margin-top: 18px; font-size: .85rem;
}
.pagination-link {
    color: var(--accent); border: 1px solid var(--border);
    border-radius: 6px; padding: 6px 12px;
}
.pagination-link:hover { background: var(--card); }
.pagination-link.disabled { color: var(--muted); opacity: .5; pointer-events: none; }
.pagination-info { color: var(--muted); }

/* ── Admin layout ── */
body.admin { background: var(--bg); }
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px; margin-bottom: 16px;
}
.kpi {
    background: var(--card); border: 1px solid var(--border);
    border-radius: 10px; padding: 14px;
}
.kpi .label { color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; }
.kpi .value { font-size: 1.4rem; font-weight: 700; margin: 4px 0; }
.kpi .sub   { color: var(--muted); font-size: .8rem; }

/* Homepage KPI row: balance tile spans the full width on its own row,
   the other two tiles share the row below at 50% each. */
.home-stats { grid-template-columns: 1fr 1fr; }
.home-stats .kpi-wide { grid-column: 1 / -1; }
@media (max-width: 480px) {
    .home-stats { grid-template-columns: 1fr; }
}
section {
    background: var(--card); border: 1px solid var(--border);
    border-radius: 10px; padding: 16px; margin-bottom: 16px;
}
section h2 {
    margin: 0 0 14px; font-size: .88rem; color: var(--muted);
    text-transform: uppercase; letter-spacing: .06em;
}
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 500; font-size: .76rem; text-transform: uppercase; }
.table-scroll { overflow-x: auto; }
.status-sent    { color: var(--ok); }
.status-failed  { color: var(--err); }
.status-pending { color: var(--warn); }
.err-text { color: var(--err); }
fieldset { border: 1px solid var(--border); border-radius: 8px; margin: 14px 0; padding: 12px 16px; }
fieldset legend { color: var(--muted); padding: 0 6px; font-size: .85rem; }
.checkbox-label { display: flex !important; align-items: center; gap: 8px; margin-top: 14px !important; color: var(--fg) !important; font-size: .9rem !important; }
.checkbox-label input { width: auto; margin: 0; }
.hint { color: var(--muted); font-size: .82rem; margin: 4px 0 0; }
.hint.warn { color: var(--warn); }
