:root {
    --bg-main: #0b0f19;
    --bg-card: rgba(18, 24, 38, 0.75);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(59, 130, 246, 0.4);
    --accent: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.35);
    --emerald: #10b981;
    --amber: #f59e0b;
    --rose: #ef4444;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --radius-md: 14px;
    --radius-sm: 8px;
}

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

body {
    background: transparent;
    color: var(--text-main);
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
    padding: 1rem;
    overflow-x: hidden;
}

.acs-app-container {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Header */
.acs-header {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.acs-header-left {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.acs-logo-badge {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.2));
    border: 1px solid rgba(59, 130, 246, 0.4);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #60a5fa;
}

.acs-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
}

.acs-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.acs-header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Status Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-online {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #6ee7b7;
}
.status-online .status-dot { background: #10b981; box-shadow: 0 0 8px #10b981; }

.status-offline {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fca5a5;
}
.status-offline .status-dot { background: #ef4444; }

.status-loading {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.35);
    color: #93c5fd;
}
.status-loading .status-dot { background: #3b82f6; animation: pulse 1.5s infinite; }

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

/* Telemetry Grid */
.telemetry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.metric-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.2s ease;
}

.metric-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.metric-title {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.metric-value-row {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.metric-val {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    font-family: 'JetBrains Mono', monospace;
}

.unit-txt {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.eval-pill {
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
}

.eval-optimal { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.4); }
.eval-warning { background: rgba(245, 158, 11, 0.2); color: #fcd34d; border: 1px solid rgba(245, 158, 11, 0.4); }
.eval-critical { background: rgba(239, 68, 68, 0.2); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.4); }

.signal-bar-track {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.35rem;
}

.signal-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #06b6d4);
    border-radius: 2px;
    transition: width 0.4s ease;
}

.foot-txt {
    font-size: 0.74rem;
    color: var(--text-muted);
}

/* WiFi Grid */
.wifi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.25rem;
}

.wifi-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.35rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.wifi-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wifi-badge {
    display: flex;
    flex-direction: column;
}

.wifi-badge span {
    font-size: 1.1rem;
    font-weight: 800;
}

.wifi-badge small {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.band-24 span { color: #38bdf8; }
.band-50 span { color: #a855f7; }

/* Forms */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 0.85rem;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #cbd5e1;
}

.form-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.pass-rule-pill {
    font-size: 0.7rem;
    font-weight: 700;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
    padding: 0.1rem 0.5rem;
    border-radius: 9999px;
}

.pass-feedback-text {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 0.25rem;
    transition: all 0.2s ease;
}

.pass-feedback-text.invalid {
    color: #fbbf24;
}

.pass-feedback-text.valid {
    color: #34d399;
}

.form-control {
    width: 100%;
    background: rgba(11, 15, 25, 0.8);
    border: 1px solid var(--border-color);
    color: #fff;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    transition: all 0.2s ease;
}

.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.font-mono {
    font-family: 'JetBrains Mono', monospace;
}

.input-password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.btn-toggle-pass {
    position: absolute;
    right: 0.65rem;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-muted);
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    border: none;
    padding: 0.7rem 1.25rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    border: 1px solid var(--border-color);
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-qr {
    background: rgba(139, 92, 246, 0.15);
    color: #c4b5fd;
    border: 1px solid rgba(139, 92, 246, 0.3);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
}

.btn-qr:hover {
    background: rgba(139, 92, 246, 0.25);
    border-color: rgba(139, 92, 246, 0.5);
    color: #fff;
}

.w-full { width: 100%; }

/* Action Banner */
.action-banner {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08), rgba(245, 158, 11, 0.05));
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: var(--radius-md);
    padding: 1.15rem 1.35rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.action-banner-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.action-icon {
    font-size: 1.75rem;
}

.action-banner-info h4 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.action-banner-info p {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.btn-danger-action {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: #fff;
    border: none;
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.btn-danger-action:hover {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(220, 38, 38, 0.4);
}

/* Modals */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(6, 9, 15, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-card {
    background: #0f172a;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.modal-header h3 {
    font-size: 1.05rem;
    font-weight: 700;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
}

.text-center { text-align: center; }

.qr-box {
    display: flex;
    justify-content: center;
    background: #fff;
    padding: 1rem;
    border-radius: 10px;
    margin: 0 auto 1rem;
    width: 200px;
    height: 200px;
}

.qr-info {
    font-size: 0.95rem;
    color: #38bdf8;
    font-family: 'JetBrains Mono', monospace;
}

/* Reboot Animation */
.spin-anim {
    animation: spin 2s linear infinite;
    color: #38bdf8;
    margin: 0 auto;
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

.progress-bar-track {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin: 1.25rem 0 0.5rem;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #38bdf8, #3b82f6);
    border-radius: 4px;
    transition: width 1s linear;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background: #0f172a;
    border: 1px solid var(--border-color);
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    font-size: 0.88rem;
    z-index: 2000;
    display: none;
    align-items: center;
    gap: 0.65rem;
    transition: all 0.3s ease;
}

.toast.toast-success { border-color: rgba(16, 185, 129, 0.4); color: #6ee7b7; }
.toast.toast-error { border-color: rgba(239, 68, 68, 0.4); color: #fca5a5; }
.toast.toast-info { border-color: rgba(59, 130, 246, 0.4); color: #93c5fd; }

/* Unregistered / Pending CWMP Card */
.unregistered-card {
    background: rgba(18, 24, 38, 0.95);
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: var(--radius-md);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5), 0 0 25px rgba(245, 158, 11, 0.1);
    backdrop-filter: blur(16px);
    animation: fadeIn 0.3s ease;
}

.unreg-header {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.unreg-icon-badge {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #fbbf24;
    padding: 0.85rem;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.unreg-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: #f8fafc;
    margin: 0 0 0.4rem 0;
}

.unreg-desc {
    font-size: 0.92rem;
    color: #cbd5e1;
    line-height: 1.6;
    margin: 0;
}

.unreg-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin-bottom: 1.75rem;
    background: rgba(11, 15, 25, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 1.25rem;
    border-radius: var(--radius-sm);
}

.unreg-info-item {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.unreg-info-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

.unreg-info-val {
    font-size: 0.95rem;
    font-weight: 700;
}

.text-emerald { color: #34d399; }
.text-amber { color: #fbbf24; }

/* Responsive Media Queries */
@media (max-width: 768px) {
    body {
        padding: 0.65rem;
    }

    .acs-header {
        padding: 0.85rem 1rem;
    }

    .wifi-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .wifi-card {
        padding: 1.15rem;
    }
}

@media (max-width: 640px) {
    .telemetry-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .metric-card {
        padding: 0.85rem;
    }

    .metric-val {
        font-size: 1.25rem;
    }

    .action-banner {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        padding: 1rem;
    }

    .action-banner .btn-danger-action {
        width: 100%;
        justify-content: center;
    }

    .unreg-header {
        flex-direction: column;
        gap: 0.75rem;
    }

    .unreg-info-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 420px) {
    .telemetry-grid {
        grid-template-columns: 1fr;
    }

    .acs-header-right {
        width: 100%;
        justify-content: space-between;
    }

    .form-label-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
}

