/* Security system visual theme. */
body.security-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(0, 255, 163, 0.10), transparent 28%),
        radial-gradient(circle at top right, rgba(51, 102, 255, 0.10), transparent 24%),
        linear-gradient(180deg, #02050a 0%, #07101a 48%, #02060c 100%);
    color: #e6f2ff;
    font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

body.frontend-app {
    position: relative;
}

body.frontend-app::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(0, 0, 0, 0.38) 0, rgba(0, 0, 0, 0.08) 18%, rgba(0, 0, 0, 0.08) 82%, rgba(0, 0, 0, 0.38) 100%);
    pointer-events: none;
}

.security-nav {
    background: rgba(3, 8, 14, 0.94);
    border-bottom: 1px solid rgba(0, 255, 163, 0.12);
    backdrop-filter: blur(14px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.navbar-brand {
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #e9fff7 !important;
    text-shadow: 0 0 18px rgba(0, 255, 163, 0.18);
}

.brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
}

.brand-logo {
    width: 42px;
    height: 42px;
    display: block;
    filter: drop-shadow(0 0 14px rgba(0, 240, 181, 0.24));
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid rgba(0, 255, 163, 0.08);
}

.login-brand-logo {
    width: 56px;
    height: 56px;
    display: block;
    filter: drop-shadow(0 0 20px rgba(0, 240, 181, 0.22));
}

.login-brand-title {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #effff8;
}

body.frontend-app .security-nav .container,
body.frontend-app main.container {
    max-width: 430px;
}

body.frontend-app .security-nav {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

body.frontend-app main.container {
    position: relative;
    z-index: 1;
    min-height: calc(100vh - 76px);
    padding-top: 1rem !important;
    padding-bottom: 1.5rem !important;
}

body.frontend-app .security-card {
    border-radius: 22px;
}

@media (min-width: 768px) {
    body.frontend-app .security-nav .container,
    body.frontend-app main.container {
        max-width: 420px;
    }

    body.frontend-app .security-nav .container {
        background: rgba(3, 8, 14, 0.98);
        border-left: 1px solid rgba(0, 255, 163, 0.08);
        border-right: 1px solid rgba(0, 255, 163, 0.08);
    }

    body.frontend-app main.container {
        background: linear-gradient(180deg, rgba(4, 11, 19, 0.92) 0%, rgba(2, 7, 13, 0.98) 100%);
        border-left: 1px solid rgba(0, 255, 163, 0.08);
        border-right: 1px solid rgba(0, 255, 163, 0.08);
        box-shadow: 0 32px 90px rgba(0, 0, 0, 0.42);
    }

    body.frontend-app .row.justify-content-center,
    body.frontend-app .row.g-4 {
        margin-left: 0;
        margin-right: 0;
    }

    body.frontend-app .col-lg-5,
    body.frontend-app .col-lg-8,
    body.frontend-app .col-lg-10,
    body.frontend-app .col-lg-4,
    body.frontend-app .col-md-6,
    body.frontend-app .col-md-4 {
        width: 100%;
        max-width: 100%;
        flex: 0 0 100%;
    }
}

.security-card {
    background:
        linear-gradient(180deg, rgba(8, 16, 28, 0.96) 0%, rgba(5, 11, 19, 0.98) 100%);
    border: 1px solid rgba(0, 255, 163, 0.12);
    color: #e5eef8;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
    border-radius: 16px;
}

.security-card .text-secondary,
.security-card .form-label,
.security-card .small {
    color: #8ea3b7 !important;
}

.security-card .form-control,
.security-card .form-select,
.security-card textarea {
    background: #030811;
    border-color: rgba(88, 112, 140, 0.28);
    color: #f8fafc;
    border-radius: 12px;
}

.security-card .form-control:focus,
.security-card .form-select:focus,
.security-card textarea:focus {
    background: #030811;
    color: #f8fafc;
    border-color: #00dca0;
    box-shadow: 0 0 0 0.2rem rgba(0, 220, 160, 0.16);
}

.btn-primary {
    background: linear-gradient(135deg, #00c389 0%, #00f0b5 100%);
    border-color: #00dca0;
    color: #02110d;
    font-weight: 700;
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, #00d39b 0%, #3ef8c6 100%);
    border-color: #3ef8c6;
    color: #02110d;
}

.btn-outline-secondary,
.btn-outline-light,
.btn-outline-danger,
.btn-outline-info {
    border-radius: 12px;
}

.consent-box {
    background: rgba(2, 8, 14, 0.94);
    border: 1px solid rgba(0, 255, 163, 0.08);
    padding: 1.1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    line-height: 1.7;
}

.scan-warning {
    font-size: 0.95rem;
    border-width: 1px;
    box-shadow: 0 0 0 1px rgba(255, 193, 7, 0.06), 0 12px 28px rgba(0, 0, 0, 0.18);
}

.scan-rules {
    display: grid;
    gap: 0.75rem;
}

.scan-rule-item {
    padding: 0.9rem 1rem;
    background: rgba(7, 15, 24, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 4px solid #00e1a6;
    border-radius: 14px;
    color: #e8f4ff;
    font-size: 0.95rem;
    line-height: 1.6;
}

.scan-progress {
    height: 18px;
    background: rgba(2, 8, 14, 0.94);
    border-radius: 999px;
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(90deg, #00c389 0%, #00f0b5 100%);
}

.scan-steps {
    list-style: none;
    padding: 0;
    margin: 0;
}

.scan-steps li {
    padding: 0.8rem 1rem;
    margin-bottom: 0.6rem;
    border-radius: 10px;
    background: rgba(3, 9, 16, 0.9);
    border: 1px solid rgba(88, 112, 140, 0.16);
    color: #c7d6e3;
}

.scan-steps li.active {
    border-color: rgba(0, 240, 181, 0.46);
    color: #ecfeff;
    box-shadow: inset 0 0 0 1px rgba(0, 240, 181, 0.12);
}

.scan-steps li.completed {
    border-color: rgba(0, 195, 137, 0.36);
    color: #bbf7d0;
}

.result-item {
    background: rgba(3, 9, 16, 0.92);
    border: 1px solid rgba(0, 255, 163, 0.08);
    border-radius: 12px;
    padding: 1rem;
    height: 100%;
}

.result-item span {
    display: block;
    color: #93a6b8;
    font-size: 0.8rem;
    text-transform: uppercase;
    margin-bottom: 0.35rem;
}

.stat-label {
    color: #84a0ba;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin-top: 0.35rem;
    color: #e9fff7;
}

.table-dark {
    --bs-table-bg: rgba(3, 9, 16, 0.95);
    --bs-table-striped-bg: rgba(6, 14, 24, 0.98);
    --bs-table-hover-bg: rgba(8, 20, 34, 0.98);
    --bs-table-border-color: rgba(88, 112, 140, 0.18);
}

.accordion-button {
    border: 1px solid rgba(0, 255, 163, 0.08);
}

.alert-info {
    background: rgba(8, 44, 72, 0.42);
    border-color: rgba(68, 161, 255, 0.22);
    color: #d7ebff;
}

.alert-success {
    background: rgba(0, 72, 46, 0.35);
    border-color: rgba(0, 240, 181, 0.16);
    color: #d8fff1;
}

.alert-danger {
    background: rgba(90, 12, 31, 0.32);
    border-color: rgba(255, 96, 133, 0.18);
    color: #ffdce5;
}

#scanStatus {
    font-size: 0.98rem;
    font-weight: 600;
}

.accordion-button:not(.collapsed) {
    box-shadow: none;
}

@media (max-width: 768px) {
    .security-card .table {
        min-width: 760px;
    }
}
