:root {
    --bg: #f4f5f7;
    --card-bg: #ffffff;
    --text: #1c1f26;
    --muted: #667085;
    --border: #e3e5ea;
    --primary: #3457d5;
    --primary-dark: #2643ad;
    --danger: #d0342c;
    --danger-dark: #a8271f;
    --success-bg: #e7f6ec;
    --success-text: #1e6b3c;
    --error-bg: #fdecea;
    --error-text: #a8271f;
    --radius: 10px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #14161c;
        --card-bg: #1c1f27;
        --text: #eef0f4;
        --muted: #9aa2b1;
        --border: #2b2f3a;
        --primary: #5b7cfa;
        --primary-dark: #7a97ff;
        --danger: #ef5b53;
        --danger-dark: #ff7b74;
        --success-bg: #113321;
        --success-text: #7fe0a3;
        --error-bg: #3a1614;
        --error-text: #ff9d94;
    }
}

* { box-sizing: border-box; }

/* The header, buttons and cards come from ui.css, as on every site. 3QR's pages are forms and
   profiles: they read best narrow, and its cards stack one under the other. */
main.wrap { max-width: 860px; }
main .card { margin-bottom: 16px; }

.hero p { color: var(--muted); }
.tiers-explainer { padding-left: 20px; }
.tiers-explainer li { margin-bottom: 6px; }
.cta { margin-top: 16px; }

.form label {
    display: block;
    margin-bottom: 14px;
    font-weight: 600;
    font-size: 0.92rem;
}

.form input[type="text"],
.form input[type="email"],
.form input[type="password"],
.form select,
.form textarea {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 9px 11px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    color: var(--text);
    font: inherit;
    font-weight: 400;
}

.form-inline select {
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    color: var(--text);
    font: inherit;
}

.form textarea { resize: vertical; }

.form-inline {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin: 6px 0;
}

.form-inline input[type="text"],
.form-inline input[type="password"] {
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    color: var(--text);
    font: inherit;
}

.badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 0.8rem;
}
.badge-on { background: var(--success-bg); color: var(--success-text); }
.badge-off { background: var(--error-bg); color: var(--error-text); }
.flash-success { background: var(--success-bg); color: var(--success-text); }

.qr-card { text-align: center; }
.qr-image {
    background: #fff;
    padding: 10px;
    border-radius: 8px;
    display: block;
    margin: 0 auto 12px;
}
.qr-actions { display: flex; gap: 10px; justify-content: center; margin: 12px 0; flex-wrap: wrap; }
.profile-link { word-break: break-all; font-size: 0.9rem; }

.list { list-style: none; padding: 0; margin: 0; }
.list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.list li:last-child { border-bottom: none; }
.post-list li { align-items: flex-start; }
.post-list a { word-break: break-all; }
.list .actions { display: flex; gap: 6px; }

.profile-header { text-align: center; }
.tier h2 { margin-bottom: 8px; }
.locked { color: var(--muted); }

.galaxy-section { margin-bottom: 24px; }

.galaxy-wrap {
    position: relative;
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    height: clamp(420px, 70vh, 640px);
    background: #05060c;
    overflow: hidden;
}

.galaxy-wrap canvas {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
    cursor: grab;
}

.galaxy-wrap canvas.dragging { cursor: grabbing; }

.galaxy-hint {
    position: absolute;
    top: 14px;
    left: 14px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(10, 12, 20, 0.65);
    color: #e8eaf2;
    font-size: 0.82rem;
    pointer-events: none;
    transition: opacity 0.4s ease;
}
.galaxy-hint.hidden { opacity: 0; }

.galaxy-controls {
    position: absolute;
    bottom: 14px;
    right: 72px;
    display: flex;
    gap: 6px;
}
.galaxy-controls .btn { padding: 6px 12px; line-height: 1; }

.galaxy-loc-portal {
    position: absolute;
    right: 10px;
    bottom: 10px;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 50%;
}
.galaxy-loc-portal span {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: radial-gradient(circle, #fff 0 2px, #000 3px);
    border: 1.5px solid rgba(180, 200, 255, 0.6);
    box-shadow: 0 0 12px rgba(140, 170, 255, 0.3);
}
.galaxy-loc-portal:hover span { box-shadow: 0 0 18px rgba(140, 170, 255, 0.7); }
.galaxy-loc-portal:focus-visible { outline: 2px solid #c8daff; outline-offset: 2px; }

.galaxy-caption { text-align: center; margin-top: 10px; }

.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.admin-table th, .admin-table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.admin-table th { color: var(--muted); font-weight: 600; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.03em; }
.admin-table td.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.admin-table tr:last-child td { border-bottom: none; }

.admin-banner {
    background: var(--success-bg);
    color: var(--success-text);
    padding: 8px 12px;
    border-radius: 7px;
    font-size: 0.88rem;
    margin-top: 10px;
}
.admin-banner a { color: inherit; text-decoration: underline; }

.lovus-balance { font-size: 1.8rem; font-weight: 700; margin: 4px 0 10px; }
.lovus-address {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.9rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 10px;
    word-break: break-all;
}
.lovus-deposit code {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 0.88rem;
}
.lovus-instructions { margin-top: 8px; }

.galaxy-chat-log {
    max-height: 340px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 10px;
    background: var(--bg);
}
.galaxy-chat-msg { padding: 4px 0; font-size: 0.92rem; word-break: break-word; }
.galaxy-chat-msg strong { color: var(--primary); }

.wall-list li { align-items: flex-start; }
.wall-list strong { margin-right: 6px; }

.site-footer { padding: 20px 0 28px; }
.footer-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.footer-wrap p { margin: 0; color: var(--muted); font-size: 0.88rem; }

.lang-switcher {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
}
.lang-switcher a {
    color: var(--muted);
    padding: 2px 6px;
    border-radius: 5px;
}
.lang-switcher a:hover { text-decoration: none; background: var(--bg); color: var(--text); }
.lang-switcher a.lang-active { color: var(--primary); font-weight: 700; background: var(--bg); }

@media (max-width: 480px) {
    .card { padding: 16px; }
    .site-header nav a { margin-left: 10px; font-size: 0.88rem; }
    .galaxy-wrap { height: clamp(360px, 60vh, 520px); }
    .footer-wrap { flex-direction: column; align-items: flex-start; }
}

/* --- RTL (Arabic) --- keep layout readable without a full mirrored redesign */
[dir="rtl"] .site-header nav a { margin-left: 0; margin-right: 14px; }
[dir="rtl"] .site-header nav a:first-child { margin-right: 0; }
[dir="rtl"] .galaxy-hint { left: auto; right: 14px; }
[dir="rtl"] .galaxy-controls { right: auto; left: 14px; }
[dir="rtl"] .admin-table th,
[dir="rtl"] .admin-table td { text-align: right; }
@media (max-width: 480px) {
    [dir="rtl"] .site-header nav a { margin-right: 10px; }
}

/* --- Catalog Specialiști --- */
.spec-filters label { display: block; margin-bottom: 12px; }
.spec-checkbox { display: inline-flex !important; align-items: center; gap: 6px; margin-right: 14px; font-weight: 400 !important; }
.spec-price-range { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.spec-price-range input { width: 100px; }
.spec-card-list li { align-items: flex-start; }
.spec-pagination { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.spec-pagination a { padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px; color: var(--text); }
.spec-pagination a.spec-page-active { background: var(--primary); color: #fff; border-color: var(--primary); }
.spec-row { border: 1px solid var(--border); border-radius: 8px; padding: 10px; margin-bottom: 10px; }
.spec-row legend { padding: 0 4px; color: var(--muted); font-size: 0.85rem; }
.spec-row select, .spec-row input, .spec-row textarea { margin-bottom: 6px; }
fieldset.spec-row { display: flex; flex-wrap: wrap; gap: 8px; }
fieldset.spec-row > * { flex: 1 1 160px; }

/* Family styles (shared/family): text on the primary colour follows the chosen style. */
html[data-site-theme] .spec-pagination a.spec-page-active { color: var(--primary-text); }

/* Trust score ("Scor de încredere"), shared by the hub's sites. */
.trust-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--success-bg, #e5eed8); color: var(--success-text, #3d7a3a); font-weight: 700; font-size: .85rem; }
.trust-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.trust-list .revoked { opacity: .55; text-decoration: line-through; }

/* Proof of Meeting */
.meet-qr { display: flex; justify-content: center; margin: 8px 0; }
.meet-qr img { width: min(280px, 78vw); height: auto; background: #fff; padding: 6px; border-radius: 12px; border: 1px solid var(--border); }
.meet-steps { text-align: left; max-width: 560px; margin: 14px auto 0; padding-left: 20px; display: grid; gap: 6px; }
.meet-person { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; font-size: 1.1rem; }
.meet-initial { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 800; font-size: 1.3rem; flex: none; }
.meet-done { text-align: center; }
.meet-done-mark { display: inline-grid; place-items: center; width: 64px; height: 64px; margin: 4px auto 8px; border-radius: 50%; background: var(--success-bg); color: var(--success-text); font-size: 2rem; font-weight: 800; }
.meet-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--card-bg); border: 1px solid var(--border); color: var(--text); font-weight: 700; font-size: .85rem; }
.meet-badge-you { background: var(--success-bg); color: var(--success-text); border-color: transparent; }
.muted.small { font-size: .82rem; }
.circle-card { border-left: 4px solid var(--primary); }
.circle-tag { font-size: .78rem; font-weight: 700; color: var(--primary); }
.tier3-met { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.tier3-met .check { display: flex; gap: 8px; align-items: flex-start; font-weight: 600; }
.tier3-met .check input { margin-top: 4px; }

/* Personal walls (wall_user.php) and their link on the profile's tier 2. */
.pwall-link { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 12px 0 0; }
.pwall-list li { align-items: flex-start; }
.pwall-body { overflow-wrap: anywhere; }

/* The code's style and its scans (dashboard.php, src/QrStyle.php) */
.qr-style { text-align: left; margin: 14px auto 0; max-width: 460px; }
.qr-style summary { cursor: pointer; font-weight: 700; }
.qr-style-form { display: grid; gap: 10px; margin-top: 10px; }
.qr-style-form fieldset { border: 1px solid var(--border, #e3d5bd); border-radius: 10px; padding: 8px 12px; display: grid; gap: 6px; }
.qr-style-form label { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.qr-color input[type="color"] { width: 54px; height: 34px; padding: 2px; }
.qr-initials { width: 70px !important; text-transform: uppercase; }
.qr-stats { text-align: left; margin: 18px auto 0; max-width: 460px; }
.qr-stats h3 { margin-bottom: 4px; }
.qr-bars { display: flex; align-items: flex-end; gap: 2px; height: 64px; padding: 4px 0; border-bottom: 1px solid var(--border, #e3d5bd); }
.qr-bar { flex: 1; min-height: 2px; border-radius: 3px 3px 0 0; background: var(--primary, #7c2233); opacity: .85; }
.qr-bar.h-0 { opacity: .2; }
.h-0 { height: 2px; } .h-5 { height: 5%; } .h-10 { height: 10%; } .h-15 { height: 15%; } .h-20 { height: 20%; } .h-25 { height: 25%; } .h-30 { height: 30%; }
.h-35 { height: 35%; } .h-40 { height: 40%; } .h-45 { height: 45%; } .h-50 { height: 50%; } .h-55 { height: 55%; } .h-60 { height: 60%; } .h-65 { height: 65%; }
.h-70 { height: 70%; } .h-75 { height: 75%; } .h-80 { height: 80%; } .h-85 { height: 85%; } .h-90 { height: 90%; } .h-95 { height: 95%; } .h-100 { height: 100%; }
