/**
 * ArcEdgeVPN Component Styles
 * Cards, Tables, Buttons, Modals, Forms, Badges, Charts, Toasts
 */

/* ========================================================
   AUTH OVERLAY & LOGIN SCREEN
   ======================================================== */
.auth-overlay {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at top, rgba(249, 115, 22, 0.12), transparent 70%), var(--bg-app);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.auth-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
    padding: 40px 32px;
    animation: fadeInScale var(--transition-normal);
}

.auth-header {
    text-align: center;
    margin-bottom: 28px;
}

.auth-logo {
    display: inline-flex;
    margin-bottom: 12px;
}

.auth-title {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

.auth-title span {
    color: var(--accent-primary);
}

.auth-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-security-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--bg-subtle);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
    color: var(--text-muted);
}

.form-security-badge svg {
    color: var(--accent-primary);
}

/* ========================================================
   CARDS & STATS GRID
   ======================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-card);
    transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-md);
}

.stat-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.stat-title {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.stat-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background-color: var(--accent-subtle);
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-value {
    font-family: var(--font-numbers);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.stat-value.unavailable {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-muted);
}

.stat-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Base Content Card */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    margin-bottom: 24px;
    overflow: hidden;
}

.card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.card-title {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

.card-subtitle {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-body {
    padding: 24px;
}

/* ========================================================
   TABLES
   ======================================================== */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    text-align: left;
}

.data-table th {
    background-color: var(--bg-subtle);
    padding: 12px 16px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    vertical-align: middle;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr {
    transition: background-color var(--transition-fast);
}

.data-table tbody tr:hover {
    background-color: var(--bg-card-hover);
}

.table-cell-bold {
    font-weight: 600;
    color: var(--text-primary);
}

.table-cell-mono {
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ========================================================
   BADGES & PILLS
   ======================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1;
}

.badge-active, .badge-online, .badge-success {
    background-color: var(--status-success-bg);
    color: var(--status-success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-disabled, .badge-offline {
    background-color: var(--bg-subtle);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.badge-expired, .badge-danger, .badge-limit {
    background-color: var(--status-danger-bg);
    color: var(--status-danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-warning {
    background-color: var(--status-warning-bg);
    color: var(--status-warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-info {
    background-color: var(--status-info-bg);
    color: var(--status-info);
    border: 1px solid rgba(56, 189, 248, 0.2);
}

/* ========================================================
   BUTTONS
   ======================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all var(--transition-fast);
    text-decoration: none;
    line-height: 1.2;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-hover));
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.25);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--accent-hover), var(--accent-active));
    box-shadow: 0 4px 14px rgba(249, 115, 22, 0.35);
}

.btn-secondary {
    background-color: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled) {
    background-color: var(--bg-subtle);
    border-color: var(--border-focus);
}

.btn-danger {
    background-color: var(--status-danger-bg);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--status-danger);
}

.btn-danger:hover:not(:disabled) {
    background-color: var(--status-danger);
    color: #ffffff;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    background-color: var(--bg-subtle);
    color: var(--text-primary);
    border-color: var(--border-focus);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.78rem;
    border-radius: var(--radius-sm);
}

.btn-block {
    width: 100%;
}

/* ========================================================
   FORM CONTROLS
   ======================================================== */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

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

.input-icon {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    pointer-events: none;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 10px 14px;
    background-color: var(--bg-app);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.88rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.input-wrapper .form-input {
    padding-left: 38px;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-subtle);
}

/* Switch Toggle */
.toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background-color: var(--border-color);
    border-radius: 9999px;
    transition: background-color var(--transition-fast);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background-color: #ffffff;
    border-radius: 50%;
    transition: transform var(--transition-fast);
}

input[type="checkbox"]:checked + .toggle-switch {
    background-color: var(--accent-primary);
}

input[type="checkbox"]:checked + .toggle-switch::after {
    transform: translateX(20px);
}

/* ========================================================
   MODALS
   ======================================================== */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
    padding: 20px;
    animation: fadeIn var(--transition-fast);
}

.modal-dialog {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 580px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: fadeInScale var(--transition-normal);
}

.modal-dialog.modal-sm { max-width: 420px; }
.modal-dialog.modal-lg { max-width: 760px; }

.modal-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 1.6rem;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    transition: color var(--transition-fast);
}

.modal-close-btn:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

/* ========================================================
   QR CODE & CONNECTION DISPLAY CARD
   ======================================================== */
.connection-detail-box {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.qr-code-canvas-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    background-color: #ffffff;
    border-radius: var(--radius-lg);
    margin: 0 auto;
    box-shadow: var(--shadow-md);
    max-width: 100%;
    width: fit-content;
    box-sizing: border-box;
    overflow: hidden;
}

.qr-code-canvas-container svg {
    max-width: 100% !important;
    height: auto !important;
    display: block !important;
}

/* ========================================================
   BRAND LOGOS (DARK & LIGHT THEME AUTO-SWAPPING)
   ======================================================== */
.brand-logo-auth {
    height: 64px;
    width: auto;
    max-width: 240px;
    object-fit: contain;
    display: inline-block;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.25));
}

.sidebar-brand-logo {
    height: 38px;
    width: auto;
    max-width: 140px;
    object-fit: contain;
    display: inline-block;
}

[data-theme="dark"] .logo-for-light { display: none !important; }
[data-theme="dark"] .logo-for-dark { display: inline-block !important; }
[data-theme="light"] .logo-for-dark { display: none !important; }
[data-theme="light"] .logo-for-light { display: inline-block !important; }

.code-snippet-box {
    background-color: var(--bg-app);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
    position: relative;
}

.code-snippet-text {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    word-break: break-all;
    max-height: 120px;
    overflow-y: auto;
    color: var(--text-secondary);
}

.param-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.param-card {
    background-color: var(--bg-subtle);
    padding: 10px;
    border-radius: var(--radius-md);
}

.param-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.param-val {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ========================================================
   EMPTY & UNAVAILABLE STATE
   ======================================================== */
.empty-state {
    padding: 48px 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.empty-state-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: var(--bg-subtle);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.empty-state-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.empty-state-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    max-width: 420px;
    line-height: 1.5;
}

/* ========================================================
   TOAST NOTIFICATIONS
   ======================================================== */
.toast-stack {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1100;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    min-width: 280px;
    max-width: 440px;
    animation: slideInRight var(--transition-fast);
}

.toast-success { border-left: 4px solid var(--status-success); }
.toast-error { border-left: 4px solid var(--status-danger); }
.toast-warning { border-left: 4px solid var(--status-warning); }
.toast-info { border-left: 4px solid var(--status-info); }

/* ========================================================
   ANIMATIONS
   ======================================================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.spinning {
    animation: spin 0.8s linear infinite;
}

.hidden {
    display: none !important;
}

.text-orange { color: var(--accent-primary); }
.text-success { color: var(--status-success); }
.text-warning { color: var(--status-warning); }
.text-danger { color: var(--status-danger); }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.8rem; }

/* ========================================================
   SNI GENERATOR MODULE STYLES
   ======================================================== */
.sni-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.sni-card {
    background-color: var(--bg-app);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sni-card:hover {
    border-color: var(--border-focus);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.sni-card.active {
    border-color: var(--accent-primary);
    background-color: var(--accent-subtle);
    box-shadow: 0 0 0 1px var(--accent-primary), var(--shadow-md);
}

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

.sni-card-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-primary);
}

.sni-card-domain {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--accent-primary);
    font-weight: 600;
    word-break: break-all;
    background-color: var(--bg-card);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    display: inline-block;
}

.sni-card-desc {
    font-size: 0.76rem;
    color: var(--text-muted);
}

.sni-badge-pill {
    display: inline-flex;
    align-items: center;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 9999px;
    background-color: rgba(249, 115, 22, 0.15);
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.sni-badge-dialog {
    background-color: rgba(14, 165, 233, 0.15);
    color: #0ea5e9;
}

.sni-badge-custom {
    background-color: rgba(168, 85, 247, 0.15);
    color: #a855f7;
}

.sni-layout-row {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 24px;
}

@media (max-width: 992px) {
    .sni-layout-row {
        grid-template-columns: 1fr;
    }
}

.sni-output-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 20px;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sni-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 12px;
    overflow-x: auto;
}

.sni-tab-btn {
    background: none;
    border: none;
    padding: 6px 14px;
    border-radius: var(--radius-md);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.sni-tab-btn:hover {
    color: var(--text-primary);
    background-color: var(--bg-subtle);
}

.sni-tab-btn.active {
    color: var(--text-primary);
    background-color: var(--accent-subtle);
    border: 1px solid var(--accent-primary);
}

.sni-del-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition-fast), background-color var(--transition-fast);
}

.sni-del-btn:hover {
    color: var(--status-danger);
    background-color: rgba(239, 68, 68, 0.12);
}

/* ==========================================================================
   SPECS & HARDWARE ARCHITECTURE
   ========================================================================== */
.specs-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.specs-photo-card {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.specs-photo-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
    border-color: var(--accent-primary);
}

.specs-photo-img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.specs-photo-card:hover .specs-photo-img {
    transform: scale(1.03);
}

.specs-photo-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    background: linear-gradient(0deg, rgba(10, 15, 29, 0.95) 0%, rgba(10, 15, 29, 0.6) 70%, transparent 100%);
    color: #ffffff;
}

.specs-photo-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.specs-photo-desc {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
}

.specs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.spec-list-table {
    width: 100%;
    border-collapse: collapse;
}

.spec-list-table tr {
    border-bottom: 1px solid var(--border-color);
}

.spec-list-table tr:last-child {
    border-bottom: none;
}

.spec-list-table td {
    padding: 10px 6px;
    font-size: 0.85rem;
}

.spec-list-table td.spec-prop {
    font-weight: 600;
    color: var(--text-muted);
    width: 38%;
}

.spec-list-table td.spec-val {
    color: var(--text-primary);
    font-weight: 500;
}

.spec-chip {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.76rem;
    font-weight: 700;
    font-family: var(--font-mono, monospace);
    background-color: var(--bg-subtle);
    border: 1px solid var(--border-color);
}

.spec-chip.green {
    background-color: rgba(16, 185, 129, 0.12);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.3);
}

.spec-chip.cyan {
    background-color: rgba(6, 182, 212, 0.12);
    color: #06b6d4;
    border-color: rgba(6, 182, 212, 0.3);
}

.spec-chip.red {
    background-color: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.3);
}

/* ==========================================================================
   SPEEDTEST 10G/12G TACHOMETER & BENCHMARK
   ========================================================================== */
.speedtest-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    background: radial-gradient(circle at center, var(--accent-subtle) 0%, var(--bg-card) 70%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
    margin-bottom: 24px;
}

.speedtest-gauge-wrap {
    position: relative;
    width: 320px;
    height: 240px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
}

.speedtest-dial-svg {
    width: 300px;
    height: 200px;
    overflow: visible;
}

.gauge-track {
    fill: none;
    stroke: var(--border-color);
    stroke-width: 14;
    stroke-linecap: round;
}

.gauge-progress {
    fill: none;
    stroke: url(#speedGaugeGrad);
    stroke-width: 14;
    stroke-linecap: round;
    stroke-dasharray: 440;
    stroke-dashoffset: 440;
    transition: stroke-dashoffset 0.12s linear;
}

.gauge-needle {
    transform-origin: 150px 150px;
    transition: transform 0.12s linear;
}

.speed-digital-display {
    position: absolute;
    bottom: 20px;
    text-align: center;
}

.speed-digital-number {
    font-size: 3.2rem;
    font-weight: 900;
    font-family: var(--font-mono, monospace);
    line-height: 1;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
}

.speed-digital-unit {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
}

.speedtest-action-btn {
    margin-top: 20px;
    padding: 14px 40px;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    border-radius: 9999px;
    background: linear-gradient(135deg, var(--accent-primary) 0%, #dc2626 100%);
    color: #ffffff;
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(220, 38, 38, 0.4);
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.speedtest-action-btn:hover:not(:disabled) {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 12px 30px rgba(220, 38, 38, 0.6);
}

.speedtest-action-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    filter: grayscale(0.5);
    transform: none;
}

.speedtest-stat-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 900px) {
    .speedtest-stat-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 520px) {
    .speedtest-stat-cards {
        grid-template-columns: 1fr;
    }
}

.speed-metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 18px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.speed-metric-label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.speed-metric-value {
    font-size: 1.8rem;
    font-weight: 800;
    font-family: var(--font-mono, monospace);
    color: var(--text-primary);
}

.speed-metric-sub {
    font-size: 0.74rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.speedtest-lockout-banner {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.16) 0%, rgba(185, 28, 28, 0.24) 100%);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin-bottom: 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    animation: pulseLockout 3s infinite alternate;
}

@keyframes pulseLockout {
    0% { border-color: rgba(239, 68, 68, 0.4); box-shadow: 0 0 0 rgba(239, 68, 68, 0); }
    100% { border-color: rgba(239, 68, 68, 0.8); box-shadow: 0 0 20px rgba(239, 68, 68, 0.25); }
}

.lockout-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lockout-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #ef4444;
    margin-bottom: 4px;
}

.lockout-desc {
    font-size: 0.88rem;
    color: var(--text-primary);
    line-height: 1.5;
}

.lockout-timer-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ef4444;
    color: #ffffff;
    font-weight: 800;
    font-family: var(--font-mono, monospace);
    font-size: 0.85rem;
    padding: 3px 10px;
    border-radius: 9999px;
    margin-top: 8px;
}


