*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #f0f2f5;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ------- flash messages ------- */
.flash-success {
    padding: 12px 24px; background: #d4edda; color: #155724;
    border-bottom: 1px solid #c3e6cb;
    font-size: 14px; text-align: center;
}
.flash-info {
    padding: 12px 24px; background: #d1ecf1; color: #0c5460;
    border-bottom: 1px solid #bee5eb;
    font-size: 14px; text-align: center;
}
.flash-error {
    padding: 12px 24px; background: #f8d7da; color: #721c24;
    border-bottom: 1px solid #f5c6cb;
    font-size: 14px; text-align: center;
}

/* ------- test banner ------- */
.test-banner {
    background: #fff3cd; color: #856404;
    text-align: center; padding: 8px;
    font-size: 13px; border-bottom: 1px solid #ffc107;
}

/* ------- navbar ------- */
.navbar {
    background: #1a1a2e;
    border-bottom: 3px solid #5b6abf;
    position: sticky; top: 0; z-index: 100;
}
.navbar-inner {
    max-width: 960px; margin: 0 auto; padding: 0 24px;
    display: flex; align-items: center; justify-content: space-between;
    height: 62px;
}
.navbar-brand {
    display: flex; align-items: center; gap: 10px;
    text-decoration: none; font-weight: 700; font-size: 18px; color: #fff;
}
.brand-logo {
    width: 56px; height: 56px;
    margin: -4px 0;
    border-radius: 10px; object-fit: contain;
}
.brand-text { font-size: 20px; letter-spacing: -0.5px; }

.navbar-links { display: flex; align-items: center; gap: 6px; }
.navbar-links a {
    color: #ccc; text-decoration: none; font-size: 14px; font-weight: 500;
    padding: 6px 14px; border-radius: 8px; transition: all 0.2s;
    white-space: nowrap;
}
.navbar-links a:hover { color: #fff; background: rgba(255,255,255,0.1); }

.nav-login {
    color: #5b6abf !important; border: 1px solid #5b6abf;
}
.nav-login:hover { background: #5b6abf !important; color: #fff !important; }

.nav-register {
    background: #5b6abf; color: #fff !important;
}
.nav-register:hover { background: #4a59a8 !important; }

.nav-logout { color: #f87171 !important; }
.nav-logout:hover { background: rgba(248,113,113,0.15) !important; color: #f87171 !important; }

/* ------- containers ------- */
.container {
    max-width: 600px;
    margin: 60px auto;
    padding: 40px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    text-align: center;
}

.dashboard-container { max-width: 900px; }
.auth-container { max-width: 400px; }

h1 { font-size: 28px; margin-bottom: 8px; }
.container > p { color: #777; margin-bottom: 30px; }

/* ------- forms ------- */
.qr-form { text-align: left; }
.qr-form label { display: block; margin-bottom: 6px; font-weight: 600; }
.qr-form input[type="text"],
.qr-form input[type="email"],
.qr-form input[type="password"],
.qr-form input[type="url"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 16px;
    margin-bottom: 16px;
    transition: border-color 0.3s;
}
.qr-form input:focus { outline: none; border-color: #5b6abf; }
.qr-form small { display: block; margin: -8px 0 16px; color: #999; font-size: 13px; }

.color-row { display: flex; gap: 12px; margin-bottom: 16px; }
.color-field { flex: 1; }
.color-field label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 14px; }
.color-field input[type="color"] {
    width: 100%; height: 48px; padding: 4px;
    border: 2px solid #ddd; border-radius: 10px;
    cursor: pointer; background: #fff;
}

.checkbox-label {
    display: flex; align-items: center; gap: 8px;
    font-weight: 400 !important; margin-bottom: 20px; cursor: pointer;
    font-size: 14px;
}

button[type="submit"], .btn-create {
    width: 100%; padding: 14px;
    background: #5b6abf; color: #fff;
    border: none; border-radius: 10px;
    font-size: 17px; font-weight: 600; cursor: pointer;
    transition: background 0.3s; text-decoration: none; display: inline-block;
}
button[type="submit"]:hover, .btn-create:hover { background: #4a59a8; }

.btn-link {
    display: inline-block; padding: 10px 20px;
    color: #5b6abf; text-decoration: none; font-weight: 600;
}
.btn-disabled {
    display: inline-block; padding: 12px 20px;
    background: #e9ecef; color: #888; border-radius: 10px; font-size: 14px;
}

/* ------- result block ------- */
.result { margin-top: 40px; padding-top: 30px; border-top: 1px solid #eee; }
.qr-preview { width: 220px; height: 220px; margin: 20px 0; border-radius: 12px; }
.btn-download {
    display: inline-block; padding: 12px 30px;
    background: #28a745; color: #fff;
    text-decoration: none; border-radius: 10px;
    font-weight: 600; transition: background 0.3s;
}
.btn-download:hover { background: #218838; }

.logo-preview-info {
    margin: 10px 0; display: flex; align-items: center; justify-content: center; gap: 10px;
    font-size: 13px; color: #666;
}
.logo-thumb {
    width: 40px; height: 40px; border-radius: 8px;
    border: 2px solid #5b6abf; object-fit: contain;
}

.dynamic-info {
    margin-top: 16px; padding: 12px;
    background: #fff3cd; border-radius: 8px; font-size: 14px; text-align: left;
}
.dynamic-info p { margin: 4px 0; }
.dynamic-info code { background: #e9ecef; padding: 2px 6px; border-radius: 4px; font-size: 13px; }
.btn-copy {
    padding: 4px 12px; background: #5b6abf; color: #fff;
    border: none; border-radius: 6px; font-size: 13px; cursor: pointer;
}

/* ------- auth ------- */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 20px; font-size: 14px; }
.alert-error { background: #fee; color: #c00; border: 1px solid #fcc; }
.auth-link { margin-top: 20px; text-align: center; font-size: 14px; }
.auth-link a { color: #5b6abf; text-decoration: none; font-weight: 600; }
.user-links, .guest-actions, .dashboard-actions {
    margin-top: 24px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
}

/* ------- dashboard ------- */
.dashboard-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.user-info { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.btn-logout { color: #c00; text-decoration: none; font-size: 13px; }

/* ------- dashboard QR cards ------- */
.qr-cards-grid { display: flex; flex-direction: column; gap: 24px; margin-top: 24px; }

.qr-card-full {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    gap: 20px;
    padding: 20px;
    transition: box-shadow 0.2s;
}
.qr-card-full:hover { box-shadow: 0 4px 24px rgba(0,0,0,0.1); }

.qr-card-preview {
    flex-shrink: 0;
    width: 120px; height: 120px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #eee;
}
.qr-card-preview img {
    width: 100%; height: 100%;
    object-fit: contain;
    display: block;
}

.qr-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; }

.qr-card-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.qr-card-code { font-size: 13px; color: #666; }
.qr-card-code strong { color: #333; font-size: 14px; }

.qr-card-url {
    font-size: 14px; color: #5b6abf;
    word-break: break-all;
    padding: 8px 12px; background: #f8f9ff;
    border-radius: 8px; border: 1px solid #e8ecf8;
}

.qr-card-redirect {
    font-size: 13px;
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 8px;
    padding: 8px 12px;
    display: flex; align-items: center; gap: 8px;
    flex-wrap: wrap;
}
.qr-card-redirect .label { color: #795548; font-weight: 600; white-space: nowrap; }
.qr-card-redirect code {
    background: #fff; color: #333;
    padding: 3px 8px; border-radius: 4px;
    font-size: 12px; word-break: break-all;
    flex: 1;
}

.qr-card-copy {
    padding: 4px 12px; background: #5b6abf; color: #fff;
    border: none; border-radius: 6px; font-size: 12px; cursor: pointer;
    white-space: nowrap;
}
.qr-card-copy:hover { background: #4a59a8; }

.qr-card-stats { display: flex; gap: 16px; flex-wrap: wrap; }
.stat {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 8px 14px;
    text-align: center;
    min-width: 70px;
}
.stat-value { display: block; font-weight: 700; font-size: 15px; color: #333; }
.stat-label { display: block; font-size: 10px; color: #999; text-transform: uppercase; margin-top: 2px; }
.stat-expiry .stat-value { color: #c00; }

.btn-download-sm {
    display: inline-block; padding: 8px 18px;
    background: #28a745; color: #fff;
    text-decoration: none; border-radius: 8px;
    font-size: 13px; font-weight: 600; transition: background 0.2s;
    white-space: nowrap;
}
.btn-download-sm:hover { background: #218838; }
.badge { padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.badge-dynamic { background: #d4edda; color: #155724; }
.badge-static { background: #e2e3e5; color: #383d41; }
.badge-pending { background: #fff3cd; color: #856404; }
.badge-approved { background: #d4edda; color: #155724; }
.badge-rejected { background: #f8d7da; color: #721c24; }
.expiry { color: #c00; font-weight: 600; }

.qr-card-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.update-form { display: flex; gap: 8px; }
.update-form input { padding: 8px 12px; border: 2px solid #ccc; border-radius: 6px; font-size: 14px; width: 240px; background: #fff; }
.update-form input:focus { border-color: #5b6abf; outline: none; }
.update-form button, .btn-delete, .btn-approve {
    padding: 8px 16px; border: none; border-radius: 6px; font-size: 13px; cursor: pointer; font-weight: 600;
}
.update-form button { background: #5b6abf; color: #fff; }
.btn-delete { background: #fee; color: #c00; }
.btn-delete:hover { background: #fcc; }
.btn-approve { background: #28a745; color: #fff; }
.empty-state { text-align: center; padding: 60px 20px; color: #999; }

/* ------- pricing ------- */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px; margin-top: 30px;
}
.pricing-card {
    background: #f8f9fa; border: 1px solid #e9ecef; border-radius: 12px;
    padding: 24px; text-align: center;
    display: flex; flex-direction: column;
    position: relative;
}
.pricing-card-popular { border-color: #5b6abf; box-shadow: 0 0 0 1px #5b6abf; }
.popular-badge {
    position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
    background: #5b6abf; color: #fff; padding: 4px 16px;
    border-radius: 12px; font-size: 12px; font-weight: 700;
    white-space: nowrap;
}
.pricing-card h2 { margin-bottom: 8px; margin-top: 8px; }
.pricing-card .price { font-size: 32px; font-weight: 700; margin: 12px 0 4px; }
.price-period { font-size: 13px; color: #999; margin-bottom: 16px; }
.pricing-card ul { list-style: none; margin-bottom: 20px; font-size: 14px; text-align: left; }
.pricing-card li { padding: 7px 0 7px 24px; border-bottom: 1px solid #eee; position: relative; }
.feature-yes::before { content: '+'; position: absolute; left: 0; color: #28a745; font-weight: 700; font-size: 16px; }
.feature-no::before  { content: '-'; position: absolute; left: 0; color: #ccc;    font-weight: 700; font-size: 16px; }

.pricing-faq { max-width: 700px; margin: 0 auto; }
.faq-item { margin-bottom: 24px; }
.faq-item h3 { font-size: 16px; color: #333; margin-bottom: 8px; font-weight: 600; }
.faq-item p { color: #555; line-height: 1.7; }

/* ------- SBP payment ------- */
.sbp-steps { margin: 20px 0; text-align: left; }
.sbp-steps p { margin: 6px 0; }
.sbp-phone {
    font-size: 26px; font-weight: 700; background: #eef1ff;
    padding: 14px; border-radius: 10px; margin: 10px 0 4px; letter-spacing: 1px;
}
.sbp-holder { color: #777; font-size: 13px; margin-bottom: 20px; }

/* ------- admin ------- */
.stats-bar {
    display: flex; gap: 24px; padding: 16px 20px;
    background: #eef1ff; border-radius: 10px; margin-bottom: 30px;
    font-weight: 600;
}

/* ------- footer ------- */
.site-footer {
    margin-top: auto; padding: 24px 0;
    background: #1a1a2e; color: #aaa; font-size: 13px;
}
.footer-inner {
    max-width: 800px; margin: 0 auto; padding: 0 20px;
    display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}
.site-footer nav { display: flex; gap: 16px; flex-wrap: wrap; }
.site-footer a { color: #ccc; text-decoration: none; }
.site-footer a:hover { color: #fff; }

/* ------- legal pages ------- */
.legal-disclaimer {
    background: #fff3cd; color: #856404;
    border: 1px solid #ffc107; border-radius: 10px;
    padding: 14px 18px; margin-bottom: 24px;
    font-size: 13px; line-height: 1.6; font-weight: 600;
}
.legal-disclaimer-inline {
    color: #999; font-size: 12px; margin-top: 8px;
    font-style: italic;
}
.legal-requisites {
    margin-top: 30px; padding: 18px 20px;
    background: #f8f9fa; border-radius: 10px;
    border: 1px solid #e9ecef;
}
.legal-requisites p { margin-bottom: 4px; }
.legal-content {
    max-width: 750px; margin: 40px auto; padding: 40px;
    background: #fff; border-radius: 16px; box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}
.legal-content h1 { font-size: 24px; margin-bottom: 8px; }
.legal-content h2 { font-size: 18px; margin: 28px 0 10px; color: #222; padding-bottom: 6px; border-bottom: 1px solid #eee; }
.legal-content h3 { font-size: 15px; margin: 16px 0 6px; color: #333; }
.legal-content p, .legal-content li { font-size: 15px; color: #444; margin-bottom: 8px; line-height: 1.75; }
.legal-content ul { padding-left: 20px; margin-bottom: 12px; }
.legal-content strong { color: #222; }

/* ------- guide / features ------- */
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; margin-top: 24px; }
.feature-block { background: #f8f9fa; border-radius: 12px; padding: 20px; border: 1px solid #e9ecef; }
.feature-icon { width: 32px; height: 32px; background: #5b6abf; color: #fff; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-weight: 700; margin-bottom: 12px; font-size: 18px; }
.feature-block strong { display: block; font-size: 15px; margin-bottom: 6px; color: #222; }
.feature-block p { font-size: 13px; color: #666; line-height: 1.6; margin: 0; }

.step-list { display: flex; flex-direction: column; gap: 24px; margin-top: 20px; }
.step { display: flex; gap: 16px; }
.step-num { flex-shrink: 0; width: 36px; height: 36px; background: #5b6abf; color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; }
.step-body strong { display: block; font-size: 15px; margin-bottom: 4px; }
.step-body p { font-size: 14px; color: #555; line-height: 1.7; margin: 0; }

.compare-table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 14px; }
.compare-table th { background: #5b6abf; color: #fff; padding: 10px 14px; text-align: left; font-weight: 600; }
.compare-table th:first-child { border-radius: 8px 0 0 0; }
.compare-table th:last-child { border-radius: 0 8px 0 0; }
.compare-table td { padding: 10px 14px; border-bottom: 1px solid #eee; }
.compare-table tr:last-child td:first-child { border-radius: 0 0 0 8px; }
.compare-table tr:last-child td:last-child { border-radius: 0 0 8px 0; }
.compare-table tr:nth-child(even) td { background: #f8f9fa; }

/* ------- mobile ------- */
@media (max-width: 600px) {
    .container { margin: 20px auto; padding: 20px; }
    .navbar-inner { flex-direction: column; height: auto; padding: 12px 16px; gap: 10px; }
    .navbar-links { flex-wrap: wrap; justify-content: center; gap: 4px; }
    .navbar-links a { font-size: 13px; padding: 6px 10px; }
    .qr-card-full { flex-direction: column; align-items: center; text-align: center; }
    .qr-card-preview { width: 140px; height: 140px; }
    .qr-card-body { text-align: left; }
    .qr-card-stats { justify-content: center; }
    .qr-card-redirect { flex-direction: column; text-align: left; }
    .qr-card-redirect code { width: 100%; }
    .update-form { flex-direction: column; width: 100%; }
    .update-form input { width: 100%; }
    .pricing-grid { grid-template-columns: 1fr; }
    .features-grid { grid-template-columns: 1fr; }
    .compare-table { font-size: 12px; }
    .compare-table th, .compare-table td { padding: 8px 10px; }
}
